Move bonus time handling into new function P_SetBonusTime()
This commit is contained in:
parent
ac3a57aaf5
commit
a57f903933
20
src/p_mobj.c
20
src/p_mobj.c
|
@ -13221,11 +13221,15 @@ void P_SpawnHoop(mapthing_t *mthing)
|
||||||
P_SpawnHoopInternal(mthing, 8 + (4*(mthing->options & 0xF)), 4*FRACUNIT);
|
P_SpawnHoopInternal(mthing, 8 + (4*(mthing->options & 0xF)), 4*FRACUNIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void P_SpawnBonusTimeItem(mapthing_t *mthing)
|
void P_SetBonusTime(mobj_t *mobj)
|
||||||
{
|
{
|
||||||
mobj_t *mobj = P_SpawnMapThing(mthing);
|
if (!mobj)
|
||||||
if (mobj && (mobj->type == MT_BLUESPHERE || mobj->type == MT_NIGHTSCHIP))
|
return;
|
||||||
P_SetMobjState(mobj, mobj->info->raisestate);
|
|
||||||
|
if (mobj->type != MT_BLUESPHERE && mobj->type != MT_NIGHTSCHIP)
|
||||||
|
return;
|
||||||
|
|
||||||
|
P_SetMobjState(mobj, mobj->info->raisestate);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t* itemtypes, UINT8 numitemtypes, INT32 numitems, fixed_t horizontalspacing, fixed_t verticalspacing, INT16 fixedangle, boolean bonustime)
|
static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t* itemtypes, UINT8 numitemtypes, INT32 numitems, fixed_t horizontalspacing, fixed_t verticalspacing, INT16 fixedangle, boolean bonustime)
|
||||||
|
@ -13274,8 +13278,8 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t* itemtypes, UINT8 numi
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mobj->spawnpoint = NULL;
|
mobj->spawnpoint = NULL;
|
||||||
if (bonustime && (mobj->type == MT_BLUESPHERE || mobj->type == MT_NIGHTSCHIP))
|
if (bonustime)
|
||||||
P_SetMobjState(mobj, mobj->info->raisestate);
|
P_SetBonusTime(mobj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13338,8 +13342,8 @@ static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 n
|
||||||
|
|
||||||
mobj->z -= mobj->height/2;
|
mobj->z -= mobj->height/2;
|
||||||
mobj->spawnpoint = NULL;
|
mobj->spawnpoint = NULL;
|
||||||
if (bonustime && (mobj->type == MT_BLUESPHERE || mobj->type == MT_NIGHTSCHIP))
|
if (bonustime)
|
||||||
P_SetMobjState(mobj, mobj->info->raisestate);
|
P_SetBonusTime(mobj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -458,7 +458,7 @@ void P_AfterPlayerSpawn(INT32 playernum);
|
||||||
|
|
||||||
mobj_t *P_SpawnMapThing(mapthing_t *mthing);
|
mobj_t *P_SpawnMapThing(mapthing_t *mthing);
|
||||||
void P_SpawnHoop(mapthing_t *mthing);
|
void P_SpawnHoop(mapthing_t *mthing);
|
||||||
void P_SpawnBonusTimeItem(mapthing_t *mthing);
|
void P_SetBonusTime(mobj_t *mobj);
|
||||||
void P_SpawnItemPattern(mapthing_t *mthing, boolean bonustime);
|
void P_SpawnItemPattern(mapthing_t *mthing, boolean bonustime);
|
||||||
void P_SpawnHoopOfSomething(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle);
|
void P_SpawnHoopOfSomething(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle);
|
||||||
void P_SpawnPrecipitation(void);
|
void P_SpawnPrecipitation(void);
|
||||||
|
|
|
@ -816,7 +816,7 @@ void P_ReloadRings(void)
|
||||||
|| mt->type == mobjinfo[MT_BLUESPHERE].doomednum || mt->type == mobjinfo[MT_BOMBSPHERE].doomednum)
|
|| mt->type == mobjinfo[MT_BLUESPHERE].doomednum || mt->type == mobjinfo[MT_BOMBSPHERE].doomednum)
|
||||||
{
|
{
|
||||||
mt->mobj = NULL;
|
mt->mobj = NULL;
|
||||||
P_SpawnBonusTimeItem(mt);
|
P_SetBonusTime(P_SpawnMapThing(mt));
|
||||||
}
|
}
|
||||||
else if (mt->type >= 600 && mt->type <= 609) // Item patterns
|
else if (mt->type >= 600 && mt->type <= 609) // Item patterns
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue