Skip to content

Commit

Permalink
Fixed merge bug in libcommon's spawnMapObjects which attempted
Browse files Browse the repository at this point in the history
to use the unitialized value of local var mobjtype_t type when
deciding if a mobj should be spawned on client side.
  • Loading branch information
danij-deng committed Sep 16, 2011
1 parent ac997a3 commit fd66ae5
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions doomsday/plugins/common/src/p_mapsetup.c
Expand Up @@ -651,30 +651,31 @@ static void spawnMapObjects(void)

// A spot that should auto-spawn one (or more) mobjs.

// Check for things that clients don't spawn on their own.
if(IS_CLIENT)
// Find which type to spawn.
type = P_DoomEdNumToMobjType(spot->doomEdNum);
if(type != MT_NONE)
{
// Client is allowed to spawn objects that are flagged local.
// The server will not send any information about them.
if(!(MOBJINFO[type].flags & MF_LOCAL))
mobj_t* mo;

// Check for things that clients don't spawn on their own.
if(IS_CLIENT)
{
if(!P_IsClientAllowedToSpawn(spot->doomEdNum))
continue;
// Client is allowed to spawn objects that are flagged local.
// The server will not send any information about them.
if(!(MOBJINFO[type].flags & MF_LOCAL))
{
if(!P_IsClientAllowedToSpawn(spot->doomEdNum))
continue;
}
}
}

// Find which type to spawn.
if((type = P_DoomEdNumToMobjType(spot->doomEdNum)) != MT_NONE)
{ // A known type; spawn it!
mobj_t* mo;
/*#if _DEBUG
Con_Message("spawning x:[%g, %g, %g] angle:%i ednum:%i flags:%i\n",
spot->pos[VX], spot->pos[VY], spot->pos[VZ], spot->angle,
spot->doomedNum, spot->flags);
Con_Message("spawning x:[%g, %g, %g] angle:%i ednum:%i flags:%i\n",
spot->pos[VX], spot->pos[VY], spot->pos[VZ], spot->angle,
spot->doomedNum, spot->flags);
#endif*/

if((mo = P_SpawnMobj3fv(type, spot->pos, spot->angle,
spot->flags)))
if((mo = P_SpawnMobj3fv(type, spot->pos, spot->angle, spot->flags)))
{
if(mo->tics > 0)
mo->tics = 1 + (P_Random() % mo->tics);
Expand Down

0 comments on commit fd66ae5

Please sign in to comment.