Fix Duel Bonus items being shortcircuited in P_AllowMobjSpawn

This commit is contained in:
AJ Martinez 2023-10-29 05:28:45 -07:00
parent b2349ed6bf
commit 1a75bc2e00
3 changed files with 9 additions and 2 deletions

View file

@ -122,6 +122,11 @@ void K_TimerReset(void)
g_pointlimit = 0;
}
boolean K_ShouldSpawnDuelItems(void)
{
return (inDuel == true || (grandprixinfo.gp && grandprixinfo.eventmode == GPEVENT_BONUS));
}
static void K_SpawnItemCapsules(void)
{
mapthing_t *mt = mapthings;
@ -263,7 +268,7 @@ void K_TimerInit(void)
timelimitintics = K_TimeLimitForGametype();
g_pointlimit = K_PointLimitForGametype();
if (inDuel == true || (grandprixinfo.gp && grandprixinfo.eventmode == GPEVENT_BONUS))
if (K_ShouldSpawnDuelItems())
{
K_SpawnDuelOnlyItems();
}

View file

@ -210,6 +210,8 @@ void K_KartEbrakeVisuals(player_t *p);
void K_HandleDirectionalInfluence(player_t *player);
fixed_t K_DefaultPlayerRadius(player_t *player);
boolean K_ShouldSpawnDuelItems(void);
// sound stuff for lua
void K_PlayAttackTaunt(mobj_t *source);
void K_PlayBoostTaunt(mobj_t *source);

View file

@ -12757,7 +12757,7 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i)
break;
}
if (inDuel == false)
if (!K_ShouldSpawnDuelItems())
{
if (K_IsDuelItem(i) == true
&& K_DuelItemAlwaysSpawns(mthing) == false)