mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-24 00:42:32 +00:00
Battle: count emeralds inside of monitors during Overtime too
Don't spawn extra emeralds during Overtime since some monitors could survive.
This commit is contained in:
parent
700331fdd6
commit
5cebe7ab35
1 changed files with 17 additions and 13 deletions
|
|
@ -312,6 +312,21 @@ static inline boolean IsOnInterval(tic_t interval)
|
|||
return ((leveltime - starttime) % interval) == 0;
|
||||
}
|
||||
|
||||
static UINT32 CountEmeraldsSpawned(const mobj_t *mo)
|
||||
{
|
||||
switch (mo->type)
|
||||
{
|
||||
case MT_EMERALD:
|
||||
return mo->extravalue1;
|
||||
|
||||
case MT_MONITOR:
|
||||
return Obj_MonitorGetEmerald(mo);
|
||||
|
||||
default:
|
||||
return 0U;
|
||||
}
|
||||
}
|
||||
|
||||
void K_RunPaperItemSpawners(void)
|
||||
{
|
||||
const boolean overtime = (battleovertime.enabled >= 10*TICRATE);
|
||||
|
|
@ -375,10 +390,7 @@ void K_RunPaperItemSpawners(void)
|
|||
|
||||
mo = (mobj_t *)th;
|
||||
|
||||
if (mo->type == MT_EMERALD)
|
||||
{
|
||||
emeraldsSpawned |= mo->extravalue1;
|
||||
}
|
||||
emeraldsSpawned |= CountEmeraldsSpawned(mo);
|
||||
}
|
||||
|
||||
if (canmakeemeralds)
|
||||
|
|
@ -437,15 +449,7 @@ void K_RunPaperItemSpawners(void)
|
|||
|
||||
mo = (mobj_t *)th;
|
||||
|
||||
if (mo->type == MT_EMERALD)
|
||||
{
|
||||
emeraldsSpawned |= mo->extravalue1;
|
||||
}
|
||||
|
||||
if (mo->type == MT_MONITOR)
|
||||
{
|
||||
emeraldsSpawned |= Obj_MonitorGetEmerald(mo);
|
||||
}
|
||||
emeraldsSpawned |= CountEmeraldsSpawned(mo);
|
||||
|
||||
if (mo->type != MT_PAPERITEMSPOT)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue