diff --git a/src/k_battle.c b/src/k_battle.c index 7c6dd7d09..5010052e5 100644 --- a/src/k_battle.c +++ b/src/k_battle.c @@ -435,6 +435,7 @@ void K_RunPaperItemSpawners(void) mobj_t *spotList[MAXITEM]; UINT8 spotMap[MAXITEM]; UINT8 spotCount = 0, spotBackup = 0, spotAvailable = 0; + UINT8 monitorsSpawned = 0; for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { @@ -458,6 +459,10 @@ void K_RunPaperItemSpawners(void) spotMap[spotAvailable] = spotCount; spotAvailable++; } + else + { + monitorsSpawned++; + } spotList[spotCount] = mo; spotCount++; @@ -484,7 +489,7 @@ void K_RunPaperItemSpawners(void) //CONS_Printf("leveltime = %d ", leveltime); - if (spotAvailable > 0) + if (spotAvailable > 0 && monitorsSpawned < BATTLE_MONITOR_SPAWN_LIMIT) { const UINT8 r = spotMap[P_RandomKey(PR_ITEM_ROULETTE, spotAvailable)]; diff --git a/src/k_battle.h b/src/k_battle.h index bd15f8b55..716124f72 100644 --- a/src/k_battle.h +++ b/src/k_battle.h @@ -12,6 +12,8 @@ extern "C" { #define BATTLE_DESPAWN_TIME (15*TICRATE) #define BATTLE_POWERUP_TIME (20*TICRATE) +#define BATTLE_MONITOR_SPAWN_LIMIT (3) + extern struct battleovertime { UINT16 enabled; ///< Has this been initalized yet?