Fix Sryder's Pleasure Castle ghost segfaulting... again (closes #114)

This commit is contained in:
GenericHeroGuy 2025-09-16 22:38:41 +02:00
parent 77e1e3fe38
commit 8a6a2b5bf3

View file

@ -2004,8 +2004,8 @@ void G_GhostTicker(void)
for (UINT16 i = 0; i < zt.damagecount; i++)
{
zipticdamage_t *damage = &zt.damage[i];
if (!(mobjinfo[damage->type].flags & MF_SHOOTABLE)
|| !(mobjinfo[damage->type].flags & (MF_ENEMY|MF_MONITOR))
// MAP15S03 has a broken EZT_HIT at leveltime 3455 which is all 0xff... so bounds check damage->type
if ((damage->type < nummobjtypes && !(mobjinfo[damage->type].flags & (MF_SHOOTABLE|MF_ENEMY|MF_MONITOR)))
|| damage->health != 0 || i >= 4) // only spawn for the first 4 hits per frame, to prevent ghosts from splode-spamming too bad.
continue;
mobj_t *poof = P_SpawnMobj(damage->x, damage->y, damage->z, MT_GHOST);