Merge branch '64-crash-fix' into 'master'

Fix Record Attack ghosts crashing x64 builds

See merge request KartKrew/Kart-Public!45
This commit is contained in:
Sal 2019-02-02 01:45:54 -05:00
commit 594c0838e7

View file

@ -5134,22 +5134,20 @@ void G_GhostTicker(void)
if (ziptic & EZT_HIT) if (ziptic & EZT_HIT)
{ // Spawn hit poofs for killing things! { // Spawn hit poofs for killing things!
UINT16 i, count = READUINT16(g->p), health; UINT16 i, count = READUINT16(g->p), health;
UINT32 type; //UINT32 type;
fixed_t x,y,z; fixed_t x,y,z;
angle_t angle; angle_t angle;
mobj_t *poof; mobj_t *poof;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
g->p += 4; // reserved g->p += 4; // reserved
type = READUINT32(g->p); g->p += 4; // backwards compat., type used to be here
health = READUINT16(g->p); health = READUINT16(g->p);
x = READFIXED(g->p); x = READFIXED(g->p);
y = READFIXED(g->p); y = READFIXED(g->p);
z = READFIXED(g->p); z = READFIXED(g->p);
angle = READANGLE(g->p); angle = READANGLE(g->p);
if (!(mobjinfo[type].flags & MF_SHOOTABLE) if (health != 0 || i >= 4) // only spawn for the first 4 hits per frame, to prevent ghosts from splode-spamming too bad.
|| !(mobjinfo[type].flags & (MF_ENEMY|MF_MONITOR))
|| health != 0 || i >= 4) // only spawn for the first 4 hits per frame, to prevent ghosts from splode-spamming too bad.
continue; continue;
poof = P_SpawnMobj(x, y, z, MT_GHOST); poof = P_SpawnMobj(x, y, z, MT_GHOST);
poof->angle = angle; poof->angle = angle;