- clear some data on init.

This commit is contained in:
Christoph Oelckers 2021-12-07 19:05:40 +01:00
parent 8dde6a3074
commit 1d371b8cbf
3 changed files with 5 additions and 0 deletions

View file

@ -46,6 +46,7 @@ public:
enum { count = size };
void Clear()
{
memset(DataList, 0, sizeof(DataList));
freecount = size;
for (int i = 0; i < size; i++)
{
@ -61,6 +62,8 @@ public:
void Release(int i)
{
// Important: This must not clear the released objects because several
// linked list loops are written to access the 'next' field after the Release call!
FreeList[freecount++] = i;
}

View file

@ -539,6 +539,7 @@ loc_1868A:
{
nLastFlash = edi;
}
pFlash->pActor = nullptr;
sFlash.Release(nFlash);
}
}

View file

@ -801,6 +801,7 @@ int GetUpAngle(DExhumedActor* pActor1, int nVal, DExhumedActor* pActor2, int ecx
void InitPushBlocks()
{
nPushBlocks = 0;
memset(sBlockInfo, 0, sizeof(sBlockInfo));
}
int GrabPushBlock()