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:
James R 2023-03-08 01:12:34 -08:00
parent 700331fdd6
commit 5cebe7ab35

View file

@ -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;