- Blood: fixed loading of maps with tracking conditions.

These use a pointer in the DBloodActor structure, but this part wasn't cleared for sprites loaded with the map.

# Conflicts:
#	source/games/blood/src/nnexts.cpp
This commit is contained in:
Christoph Oelckers 2021-11-13 13:49:26 +01:00
parent 01deb13694
commit 5732bb2db3
3 changed files with 4 additions and 3 deletions

View file

@ -749,7 +749,7 @@ void callbackCondition(DBloodActor* actor, int)
XSPRITE* pXSprite = &actor->x();
if (pXSprite->isTriggered) return;
TRCONDITION* pCond = &gCondition[pXSprite->sysData1];
TRCONDITION const* pCond = &gCondition[pXSprite->sysData1];
for (unsigned i = 0; i < pCond->length; i++) {
EVENT evn;
evn.type = pCond->obj[i].type;

View file

@ -995,6 +995,7 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor
{
sprite[i].cstat &= ~0x30;
}
bloodActors[i].Clear();
}
unsigned int nCRC = fr.ReadUInt32();

View file

@ -498,7 +498,7 @@ void nnExtResetGlobals()
for (int i = 0; i < gTrackingCondsCount; i++)
{
TRCONDITION* pCond = &gCondition[i];
for (unsigned k = 0; k < pCond->length; k++)
for (unsigned k = 0; k < kMaxTracedObjects; k++)
{
pCond->obj[k].actor = nullptr;
pCond->obj[k].index_ = pCond->obj[k].cmd = 0;
@ -1150,7 +1150,7 @@ void nnExtProcessSuperSprites()
{
for (int i = 0; i < gTrackingCondsCount; i++)
{
TRCONDITION* pCond = &gCondition[i];
TRCONDITION const* pCond = &gCondition[i];
XSPRITE* pXCond = &pCond->actor->x();
if (pXCond->locked || pXCond->isTriggered || ++pXCond->busy < pXCond->busyTime)
continue;