Have replay recording of "hits" use the reference count system

https://git.srb2.org/KartKrew/RingRacers/-/commit/fa8bffabfc51ea1d7be86d833190bb7dcf494fca
This commit is contained in:
Alug committed 2025-03-05 11:08:18 +01:00
1 parent e3af2b0d58
commit 4d7c223565
1 file changed
+2 -1
+2 -1
View File
@@ -4872,7 +4872,7 @@ void G_GhostAddHit(INT32 playernum, mobj_t *victim)
ghostext[playernum].flags |= EZT_HIT;
ghostext[playernum].hits++;
ghostext[playernum].hitlist = Z_Realloc(ghostext[playernum].hitlist, ghostext[playernum].hits * sizeof(mobj_t *), PU_LEVEL, NULL);
ghostext[playernum].hitlist[ghostext[playernum].hits-1] = victim;
P_SetTarget(ghostext[playernum].hitlist + (ghostext[playernum].hits-1), victim);
}
void G_WriteAllGhostTics(void)
@@ -5081,6 +5081,7 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
WRITEFIXED(demobuf.p,mo->y);
WRITEFIXED(demobuf.p,mo->z);
WRITEANGLE(demobuf.p,mo->angle);
P_SetTarget(ghostext[playernum].hitlist+i, NULL);
}
Z_Free(ghostext[playernum].hitlist);
ghostext[playernum].hits = 0;