Skip to content

Commit

Permalink
jDoom64: Fixed a problem with the spawnmobj ccmd which could not only…
Browse files Browse the repository at this point in the history
… lead to a segfault if the spawn was not possible (in the void for example) but also the fade-in wasn't initialized correctly.
  • Loading branch information
danij committed Jun 20, 2008
1 parent bb28b3c commit d4a6efc
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions doomsday/plugins/common/src/p_player.c
Expand Up @@ -813,7 +813,7 @@ DEFCC(CCmdCycleSpy)

DEFCC(CCmdSpawnMobj)
{
int type;
mobjtype_t type;
float pos[3];
mobj_t *mo;

Expand Down Expand Up @@ -858,26 +858,29 @@ DEFCC(CCmdSpawnMobj)
}

mo = P_SpawnMobj3fv(type, pos);
if(mo && argc == 6)
if(mo)
{
mo->angle = ((int) (strtod(argv[5], 0) / 360 * FRACUNIT)) << 16;
}
if(argc == 6)
{
mo->angle = ((int) (strtod(argv[5], 0) / 360 * FRACUNIT)) << 16;
}

#if __JDOOM64__
// jd64 > kaiser - another cheesy hack!!!
if(mo->type == MT_DART)
{
S_StartSound(SFX_SKESWG, mo); // We got darts! spawn skeswg sound!
}
else
{
mo->translucency = 255;

S_StartSound(SFX_ITMBK, mo); // If not dart, then spawn itmbk sound
mo->intFlags = MIF_FADE;
mo->translucency = 255;
}
// jd64 > kaiser - another cheesy hack!!!
if(mo->type == MT_DART)
{
S_StartSound(SFX_SKESWG, mo); // We got darts! spawn skeswg sound!
}
else
{
S_StartSound(SFX_ITMBK, mo); // If not dart, then spawn itmbk sound
mo->translucency = 255;
mo->spawnFadeTics = 0;
mo->intFlags |= MIF_FADE;
}
// << d64tc
#endif
}

return true;
}

0 comments on commit d4a6efc

Please sign in to comment.