From 1ab1852af8bcf005e2da5eed7ad96104b42c0c2d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 6 Feb 2022 22:59:30 +0100 Subject: [PATCH] - do not use ovel to store a sound index. --- source/games/duke/src/actors.cpp | 6 +++--- source/games/duke/src/spawn.cpp | 2 +- source/games/duke/src/types.h | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index a087e9013..c61726b4f 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -2800,8 +2800,8 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6) { if (statstate) { - if (!S_CheckSoundPlaying(actor->ovel.X)) - S_PlayActorSound(actor->ovel.X, actor); + if (!S_CheckSoundPlaying(actor->tempsound)) + S_PlayActorSound(actor->tempsound, actor); } if ((!checkstat || !statstate) && (ud.monsters_off == 0 && sc->floorpal == 0 && (sc->floorstat & CSTAT_SECTOR_SKY) && rnd(8))) { @@ -2817,7 +2817,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6) } if (actor->spr.xvel <= 64 && statstate) - S_StopSound(actor->ovel.X, actor); + S_StopSound(actor->tempsound, actor); if ((sc->int_floorz() - sc->int_ceilingz()) < (108 << 8)) { diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 2c8986c04..28978d396 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -1043,7 +1043,7 @@ void spawneffector(DDukeActor* actor, TArray* actors) else if (actor->sector()->floorpal == 7) j = 456; else j = 75; } - actor->ovel.X = j; + actor->tempsound = j; } [[fallthrough]]; case SE_30_TWO_WAY_TRAIN: diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index ea28464d5..1df91d4b9 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -55,6 +55,7 @@ public: { int saved_ammo; int palvals; + int tempsound; }; int temp_data[6]; // Some SE's stored indices in temp_data. For purposes of clarity avoid that. These variables are meant to store these elements now