diff --git a/source/games/blood/src/bloodactor.h b/source/games/blood/src/bloodactor.h index 51b2b8fd0..c6e5fbfca 100644 --- a/source/games/blood/src/bloodactor.h +++ b/source/games/blood/src/bloodactor.h @@ -37,7 +37,7 @@ public: int& xvel() { return Blood::xvel[index]; } int& yvel() { return Blood::yvel[index]; } int& zvel() { return Blood::zvel[index]; } - int GetIndex() { return s().index; } // this is for error printing only! + int GetIndex() { return s().time; } // For error printing only! This is only identical with the sprite index for items spawned at map start. GENDUDEEXTRA& genDudeExtra() { return Blood::gGenDudeExtra[index]; } POINT3D& basePoint() { return Blood::baseSprite[index]; } diff --git a/source/games/blood/src/db.cpp b/source/games/blood/src/db.cpp index 00cc34e58..f8731f72c 100644 --- a/source/games/blood/src/db.cpp +++ b/source/games/blood/src/db.cpp @@ -848,6 +848,7 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor } } initspritelists(); + leveltimer = mapHeader.numsprites; for (int i = 0; i < mapHeader.numsprites; i++) { RemoveSpriteStat(i); @@ -883,6 +884,7 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor pSprite->detail = load.detail; pSprite->shade = load.shade; pSprite->blend = 0; + pSprite->time = i; InsertSpriteSect(i, sprite[i].sectnum); InsertSpriteStat(i, sprite[i].statnum); diff --git a/source/games/blood/src/eventq.cpp b/source/games/blood/src/eventq.cpp index 50275b099..acf517d25 100644 --- a/source/games/blood/src/eventq.cpp +++ b/source/games/blood/src/eventq.cpp @@ -394,6 +394,7 @@ void evSend(DBloodActor* actor, int nIndex, int nType, int rxId, COMMAND_ID comm else viewSetSystemMessage("Invalid Total-Secrets command by xobject #%d (object type %d)", nIndex, nType); break; case kChannelSecretFound: + if (actor != nullptr) nIndex = actor->GetIndex(); // the hint system needs the sprite index. if (SECRET_Trigger(nIndex + 65536 * nType)) // if the hint system knows this secret it's a retrigger - skip that. { if (command >= kCmdNumberic)