From c783ecbf2284998ee6dea50de16807e8399eeb4a Mon Sep 17 00:00:00 2001 From: nukeykt Date: Tue, 3 Dec 2019 06:19:27 +0900 Subject: [PATCH] Fix explode trigger seq counter randomization --- source/exhumed/src/object.cpp | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/source/exhumed/src/object.cpp b/source/exhumed/src/object.cpp index 8733716e4..ab05e0b91 100644 --- a/source/exhumed/src/object.cpp +++ b/source/exhumed/src/object.cpp @@ -1859,7 +1859,24 @@ int BuildObject(short nSprite, int nOjectType, int nHitag) short nSeq = ObjectSeq[nOjectType]; - if (nSeq <= -1) + if (nSeq > -1) + { + ObjectList[nObject].field_8 = SeqOffsets[nSeq]; + + if (!nOjectType) // if not Explosion Trigger (e.g. Exploding Fire Cauldron) + { + ObjectList[nObject].field_0 = RandomSize(4) % (SeqSize[ObjectList[nObject].field_8] - 1); + } + + int nSprite2 = insertsprite(sprite[nSprite].sectnum, 0); + ObjectList[nObject].field_10 = nSprite2; + + sprite[nSprite2].cstat = 0x8000; + sprite[nSprite2].x = sprite[nSprite].x; + sprite[nSprite2].y = sprite[nSprite].y; + sprite[nSprite2].z = sprite[nSprite].z; + } + else { ObjectList[nObject].field_0 = 0; ObjectList[nObject].field_8 = -1; @@ -1871,23 +1888,6 @@ int BuildObject(short nSprite, int nOjectType, int nHitag) ObjectList[nObject].field_10 = -nHitag; } } - else - { - ObjectList[nObject].field_8 = SeqOffsets[nSeq]; - - if (!nOjectType) // if not Explosion Trigger (e.g. Exploding Fire Cauldron) - { - ObjectList[nObject].field_0 = RandomSize(4) % (SeqSize[nSeq] - 1); - } - - int nSprite2 = insertsprite(sprite[nSprite].sectnum, 0); - ObjectList[nObject].field_10 = nSprite2; - - sprite[nSprite2].cstat = 0x8000; - sprite[nSprite2].x = sprite[nSprite].x; - sprite[nSprite2].y = sprite[nSprite].y; - sprite[nSprite2].z = sprite[nSprite].z; - } return nObject | 0x170000; }