P_TrackRoundConditionTargetDamage, Obj_SpecialUFODamage: Fix incorrect non-g_localplayers indexing into player table

Destroying the UFO has now been promoted to a full deferred condition check
This commit is contained in:
toaster 2023-10-19 16:13:01 +01:00
parent a6ef8d357c
commit 5680e00deb
2 changed files with 4 additions and 13 deletions

View file

@ -18,6 +18,7 @@
#include "../k_objects.h"
#include "../m_random.h"
#include "../p_local.h"
#include "../m_cond.h"
#include "../r_main.h"
#include "../s_sound.h"
#include "../g_game.h"
@ -923,17 +924,7 @@ boolean Obj_SpecialUFODamage(mobj_t *ufo, mobj_t *inflictor, mobj_t *source, UIN
// Destroy the UFO parts, and make the emerald collectible!
UFOKillPieces(ufo);
{
UINT8 i;
for (i = 0; i <= splitscreen; i++)
{
if (!playeringame[g_localplayers[i]])
continue;
if (players[g_localplayers[i]].spectator)
continue;
players[i].roundconditions.checkthisframe = true;
}
}
gamedata->deferredconditioncheck = true; // Check Challenges!
ufo->flags = (ufo->flags & ~MF_SHOOTABLE) | (MF_SPECIAL|MF_PICKUPFROMBELOW);
ufo->shadowscale = FRACUNIT/3;

View file

@ -997,10 +997,10 @@ void P_TrackRoundConditionTargetDamage(targetdamaging_t targetdamaging)
continue;
if (players[g_localplayers[i]].spectator)
continue;
players[i].roundconditions.targetdamaging |= targetdamaging;
players[g_localplayers[i]].roundconditions.targetdamaging |= targetdamaging;
/* -- the following isn't needed because we can just check for targetdamaging == UFOD_GACHABOM
if (targetdamaging != UFOD_GACHABOM)
players[i].roundconditions.gachabom_miser = 0xFF;
players[g_localplayers[i]].roundconditions.gachabom_miser = 0xFF;
*/
}
}