From 5374dafb5685912f0040ae1586ac46bbf8c9c76b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 22 Nov 2021 21:37:33 +0100 Subject: [PATCH] - switches --- source/games/exhumed/src/aistuff.h | 6 ++-- source/games/exhumed/src/exhumed.cpp | 2 +- source/games/exhumed/src/fish.cpp | 2 +- source/games/exhumed/src/object.cpp | 4 +-- source/games/exhumed/src/player.cpp | 2 +- source/games/exhumed/src/queen.cpp | 3 +- source/games/exhumed/src/runlist.cpp | 42 ++++++++++++------------- source/games/exhumed/src/sound.cpp | 4 +-- source/games/exhumed/src/sound.h | 2 +- source/games/exhumed/src/switch.cpp | 47 ++++++++++++++-------------- 10 files changed, 56 insertions(+), 58 deletions(-) diff --git a/source/games/exhumed/src/aistuff.h b/source/games/exhumed/src/aistuff.h index 3456e8ba5..2e849a8ad 100644 --- a/source/games/exhumed/src/aistuff.h +++ b/source/games/exhumed/src/aistuff.h @@ -760,10 +760,10 @@ void FuncSwPressSector(int, int, int, int); void FuncSwPressWall(int, int, int, int); std::pair BuildSwPause(int nChannel, int nLink, int ebx); -std::pair BuildSwNotOnPause(int nChannel, int nLink, int nSector, int ecx); +std::pair BuildSwNotOnPause(int nChannel, int nLink, sectortype* nSector, int ecx); int BuildLink(int nCount, ...); -std::pair BuildSwPressSector(int nChannel, int nLink, int nSector, int ecx); -std::pair BuildSwStepOn(int nChannel, int nLink, int nSector); +std::pair BuildSwPressSector(int nChannel, int nLink, sectortype* nSector, int ecx); +std::pair BuildSwStepOn(int nChannel, int nLink, sectortype* nSector); std::pair BuildSwReady(int nChannel, int nLink); std::pair BuildSwPressWall(int nChannel, int nLink, walltype* pWall); diff --git a/source/games/exhumed/src/exhumed.cpp b/source/games/exhumed/src/exhumed.cpp index 7a5aadfba..45643a0e4 100644 --- a/source/games/exhumed/src/exhumed.cpp +++ b/source/games/exhumed/src/exhumed.cpp @@ -174,7 +174,7 @@ void DoRedAlert(int nVal) if (nVal) { auto spri = &ac->s(); - PlayFXAtXYZ(StaticSound[kSoundAlarm], spri->x, spri->y, spri->z, spri->sectnum); + PlayFXAtXYZ(StaticSound[kSoundAlarm], spri->x, spri->y, spri->z); AddFlash(spri->sector(), spri->x, spri->y, spri->z, 192); } } diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index 690b72140..9b58e8165 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -293,7 +293,7 @@ void AIFish::Damage(RunListEvent* ev) BuildFishLimb(pActor, i); } - PlayFXAtXYZ(StaticSound[kSound40], pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum); + PlayFXAtXYZ(StaticSound[kSound40], pSprite->x, pSprite->y, pSprite->z); DestroyFish(pActor); } else diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 0bd790304..8877fd86e 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -605,7 +605,7 @@ int CheckSectorSprites(int nSector, int nVal) pSprite->x, pSprite->y, pSprite->z, - pSprite->sectnum, CHANF_NONE, 0x4000); + CHANF_NONE, 0x4000); } } } @@ -836,7 +836,7 @@ void AIElev::Tick(RunListEvent* ev) } auto sp = &pElevSpr->s(); - PlayFXAtXYZ(StaticSound[kSound26], sp->x, sp->y, sp->z, sp->sectnum); + PlayFXAtXYZ(StaticSound[kSound26], sp->x, sp->y, sp->z); } if (var_18 & 0x4) diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index e916e27bc..4ebe533dc 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -1008,7 +1008,7 @@ void AIPlayer::Tick(RunListEvent* ev) pPlayerSprite->yvel = 0; StopActorSound(pPlayerActor); - PlayFXAtXYZ(StaticSound[kSoundJonFDie], pPlayerSprite->x, pPlayerSprite->y, pPlayerSprite->z, pPlayerSprite->sectnum, CHANF_NONE, 1); // CHECKME + PlayFXAtXYZ(StaticSound[kSoundJonFDie], pPlayerSprite->x, pPlayerSprite->y, pPlayerSprite->z, CHANF_NONE, 1); // CHECKME } else { diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index 936636590..60ad096b9 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -1412,8 +1412,7 @@ void AIQueen::Tick(RunListEvent* ev) StaticSound[kSound40], pSprite->x, pSprite->y, - pSprite->z, - pSprite->sectnum); + pSprite->z); BuildQueenHead(nQueen); diff --git a/source/games/exhumed/src/runlist.cpp b/source/games/exhumed/src/runlist.cpp index 34db40d0e..2aa19459d 100644 --- a/source/games/exhumed/src/runlist.cpp +++ b/source/games/exhumed/src/runlist.cpp @@ -671,7 +671,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwPress = BuildSwPressSector(nChannel, BuildLink(1, 1), nSector, keyMask); + auto nSwPress = BuildSwPressSector(nChannel, BuildLink(1, 1), sectp, keyMask); runlist_AddRunRec(sRunChannels[nChannel].a, nSwPress.first, nSwPress.second); @@ -690,7 +690,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwPress = BuildSwPressSector(nChannel, BuildLink(1, 1), nSector, keyMask); + auto nSwPress = BuildSwPressSector(nChannel, BuildLink(1, 1), sectp, keyMask); runlist_AddRunRec(sRunChannels[nChannel].a, nSwPress.first, nSwPress.second); @@ -751,7 +751,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwitch = BuildSwStepOn(nChannel, BuildLink(2, 1, 1), nSector); + auto nSwitch = BuildSwStepOn(nChannel, BuildLink(2, 1, 1), sectp); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); @@ -769,11 +769,11 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), nSector); + auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), sectp); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); - auto nSwitch2 = BuildSwNotOnPause(nChannel, BuildLink(2, -1, 0), nSector, 8); + auto nSwitch2 = BuildSwNotOnPause(nChannel, BuildLink(2, -1, 0), sectp, 8); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch2.first, nSwitch2.second); return; @@ -817,11 +817,11 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), nSector); + auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), sectp); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); - auto nSwitch2 = BuildSwNotOnPause(nChannel, BuildLink(2, -1, 0), nSector, 8); + auto nSwitch2 = BuildSwNotOnPause(nChannel, BuildLink(2, -1, 0), sectp, 8); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch2.first, nSwitch2.second); return; @@ -915,7 +915,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), nSector); + auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), sectp); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); @@ -951,7 +951,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev2, 0); - auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), nSector); + auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), sectp); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); return; @@ -959,7 +959,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) case 21: // Touchplate { - auto nSwitch = BuildSwStepOn(nChannel, BuildLink(2, 1, 1), nSector); + auto nSwitch = BuildSwStepOn(nChannel, BuildLink(2, 1, 1), sectp); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); return; @@ -1079,7 +1079,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), nSector); + auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), sectp); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); return; @@ -1157,11 +1157,11 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), nSector); + auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), sectp); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); - auto nSwitch2 = BuildSwNotOnPause(nChannel, BuildLink(2, -1, 0), nSector, 8); + auto nSwitch2 = BuildSwNotOnPause(nChannel, BuildLink(2, -1, 0), sectp, 8); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch2.first, nSwitch2.second); return; @@ -1281,7 +1281,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwitch = BuildSwPressSector(nChannel, BuildLink(1, 1), nSector, keyMask); + auto nSwitch = BuildSwPressSector(nChannel, BuildLink(1, 1), sectp, keyMask); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); @@ -1321,7 +1321,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwitch = BuildSwPressSector(nChannel, BuildLink(1, 1), nSector, keyMask); + auto nSwitch = BuildSwPressSector(nChannel, BuildLink(1, 1), sectp, keyMask); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); return; @@ -1337,7 +1337,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwitch = BuildSwPressSector(nChannel, BuildLink(1, 1), nSector, keyMask); + auto nSwitch = BuildSwPressSector(nChannel, BuildLink(1, 1), sectp, keyMask); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); return; @@ -1369,7 +1369,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) case 58: { - auto nSwitch = BuildSwPressSector(nChannel, BuildLink(1, 1), nSector, keyMask); + auto nSwitch = BuildSwPressSector(nChannel, BuildLink(1, 1), sectp, keyMask); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); @@ -1401,11 +1401,11 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), nSector); + auto nSwitch = BuildSwStepOn(nChannel, BuildLink(1, 1), sectp); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); - auto nSwitch2 = BuildSwNotOnPause(nChannel, BuildLink(1, 1), nSector, 60); + auto nSwitch2 = BuildSwNotOnPause(nChannel, BuildLink(1, 1), sectp, 60); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch2.first, nSwitch2.second); return; @@ -1461,7 +1461,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) case 64: { - auto nSwitch = BuildSwStepOn(nChannel, BuildLink(2, 0, 0), nSector); + auto nSwitch = BuildSwStepOn(nChannel, BuildLink(2, 0, 0), sectp); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); return; } @@ -1489,7 +1489,7 @@ void runlist_ProcessSectorTag(int nSector, int nLotag, int nHitag) runlist_AddRunRec(sRunChannels[nChannel].a, nElev, 0); - auto nSwitch = BuildSwPressSector(nChannel, BuildLink(1, 1), nSector, keyMask); + auto nSwitch = BuildSwPressSector(nChannel, BuildLink(1, 1), sectp, keyMask); runlist_AddRunRec(sRunChannels[nChannel].a,nSwitch.first, nSwitch.second); diff --git a/source/games/exhumed/src/sound.cpp b/source/games/exhumed/src/sound.cpp index 8640356db..c004821d6 100644 --- a/source/games/exhumed/src/sound.cpp +++ b/source/games/exhumed/src/sound.cpp @@ -552,7 +552,6 @@ void GameInterface::UpdateSounds() //========================================================================== int soundx, soundy, soundz; -int soundsect; void PlayFX2(unsigned int nSound, DExhumedActor* pActor, int sectf, EChanFlags chanflags, int sprflags) { @@ -655,12 +654,11 @@ void PlayFX2(unsigned int nSound, DExhumedActor* pActor, int sectf, EChanFlags c // //========================================================================== -void PlayFXAtXYZ(unsigned int ax, int x, int y, int z, int nSector, EChanFlags chanflags, int sectf) +void PlayFXAtXYZ(unsigned int ax, int x, int y, int z, EChanFlags chanflags, int sectf) { soundx = x; soundy = y; soundz = z; - soundsect = nSector; PlayFX2(ax, nullptr, sectf, chanflags); } diff --git a/source/games/exhumed/src/sound.h b/source/games/exhumed/src/sound.h index 8f491bc61..8c92e56b2 100644 --- a/source/games/exhumed/src/sound.h +++ b/source/games/exhumed/src/sound.h @@ -132,7 +132,7 @@ void CheckAmbience(int nSector); void PlayFX2(unsigned int nSound, DExhumedActor* nSprite, int sectf = 0, EChanFlags chanflags = CHANF_NONE, int sprflags = 0); -void PlayFXAtXYZ(unsigned int nSound, int x, int y, int z, int nSector, EChanFlags chanflags = CHANF_NONE, int sectf = 0); +void PlayFXAtXYZ(unsigned int nSound, int x, int y, int z, EChanFlags chanflags = CHANF_NONE, int sectf = 0); inline void D3PlayFX(unsigned int nSound, DExhumedActor* actor, int flags = 0) { PlayFX2(nSound, actor, 0, CHANF_NONE, flags); diff --git a/source/games/exhumed/src/switch.cpp b/source/games/exhumed/src/switch.cpp index c6d91607a..5c8760438 100644 --- a/source/games/exhumed/src/switch.cpp +++ b/source/games/exhumed/src/switch.cpp @@ -38,9 +38,9 @@ struct Link struct Switch { walltype* pWall; + sectortype* pSector; int nChannel; int nLink; - int nSector; int16_t nWaitTimer; int16_t nWait; int16_t nRunPtr; @@ -68,7 +68,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Switch& w, Switch* ("channel", w.nChannel) ("link", w.nLink) ("runptr", w.nRunPtr) - ("sector", w.nSector) + ("sector", w.pSector) ("run2", w.nRun2) ("wall", w.pWall) ("run3", w.nRun3) @@ -234,16 +234,16 @@ void AISWPause::Process(RunListEvent* ev) SwitchData[nSwitch].nWaitTimer = eax; } -std::pair BuildSwStepOn(int nChannel, int nLink, int nSector) +std::pair BuildSwStepOn(int nChannel, int nLink, sectortype* pSector) { - if (SwitchCount <= 0 || nLink < 0 || nSector < 0) + if (SwitchCount <= 0 || nLink < 0 || pSector == nullptr) I_Error("Too many switches!\n"); int nSwitch = --SwitchCount; SwitchData[nSwitch].nChannel = nChannel; SwitchData[nSwitch].nLink = nLink; - SwitchData[nSwitch].nSector = nSector; + SwitchData[nSwitch].pSector = pSector; SwitchData[nSwitch].nRun2 = -1; return { nSwitch , 0x30000 }; @@ -256,7 +256,7 @@ void AISWStepOn::ProcessChannel(RunListEvent* ev) int nLink = SwitchData[nSwitch].nLink; int nChannel = SwitchData[nSwitch].nChannel; - int nSector =SwitchData[nSwitch].nSector; + auto pSector =SwitchData[nSwitch].pSector; assert(sRunChannels[nChannel].c < 8); @@ -270,7 +270,7 @@ void AISWStepOn::ProcessChannel(RunListEvent* ev) if (var_14 >= 0) { - SwitchData[nSwitch].nRun2 = runlist_AddRunRec(sector[nSector].lotag - 1, &RunData[ev->nRun]); + SwitchData[nSwitch].nRun2 = runlist_AddRunRec(pSector->lotag - 1, &RunData[ev->nRun]); } } @@ -281,7 +281,7 @@ void AISWStepOn::TouchFloor(RunListEvent* ev) int nLink = SwitchData[nSwitch].nLink; int nChannel = SwitchData[nSwitch].nChannel; - int nSector =SwitchData[nSwitch].nSector; + auto pSector = SwitchData[nSwitch].pSector; assert(sRunChannels[nChannel].c < 8); @@ -289,8 +289,8 @@ void AISWStepOn::TouchFloor(RunListEvent* ev) if (var_14 != sRunChannels[nChannel].c) { - int nWall = sector[nSector].wallptr; - PlayFXAtXYZ(StaticSound[nSwitchSound], wall[nWall].x, wall[nWall].y, sector[nSector].floorz, nSector); + auto pWall = pSector->firstWall(); + PlayFXAtXYZ(StaticSound[nSwitchSound], pWall->x, pWall->y, pSector->floorz); assert(sRunChannels[nChannel].c < 8); @@ -298,9 +298,9 @@ void AISWStepOn::TouchFloor(RunListEvent* ev) } } -std::pair BuildSwNotOnPause(int nChannel, int nLink, int nSector, int ecx) +std::pair BuildSwNotOnPause(int nChannel, int nLink, sectortype* pSector, int ecx) { - if (SwitchCount <= 0 || nLink < 0 || nSector < 0) + if (SwitchCount <= 0 || nLink < 0 || pSector == nullptr) I_Error("Too many switches!\n"); int nSwitch = --SwitchCount; @@ -308,7 +308,7 @@ std::pair BuildSwNotOnPause(int nChannel, int nLink, int nSector, int SwitchData[nSwitch].nChannel = nChannel; SwitchData[nSwitch].nLink = nLink; SwitchData[nSwitch].nWait = ecx; - SwitchData[nSwitch].nSector = nSector; + SwitchData[nSwitch].pSector = pSector; SwitchData[nSwitch].nRunPtr = -1; SwitchData[nSwitch].nRun2 = -1; @@ -368,10 +368,10 @@ void AISWNotOnPause::Process(RunListEvent* ev) { SwitchData[nSwitch].nRunPtr = runlist_AddRunRec(NewRun, &RunData[ev->nRun]); - int nSector =SwitchData[nSwitch].nSector; + auto pSector = SwitchData[nSwitch].pSector; SwitchData[nSwitch].nWaitTimer = SwitchData[nSwitch].nWait; - SwitchData[nSwitch].nRun2 = runlist_AddRunRec(sector[nSector].lotag - 1, &RunData[ev->nRun]); + SwitchData[nSwitch].nRun2 = runlist_AddRunRec(pSector->lotag - 1, &RunData[ev->nRun]); } } } @@ -384,16 +384,16 @@ void AISWNotOnPause::TouchFloor(RunListEvent* ev) return; } -std::pair BuildSwPressSector(int nChannel, int nLink, int nSector, int keyMask) +std::pair BuildSwPressSector(int nChannel, int nLink, sectortype* pSector, int keyMask) { - if (SwitchCount <= 0 || nLink < 0 || nSector < 0) + if (SwitchCount <= 0 || nLink < 0 || pSector == nullptr) I_Error("Too many switches!\n"); int nSwitch = --SwitchCount; SwitchData[nSwitch].nChannel = nChannel; SwitchData[nSwitch].nLink = nLink; - SwitchData[nSwitch].nSector = nSector; + SwitchData[nSwitch].pSector = pSector; SwitchData[nSwitch].nKeyMask = keyMask; SwitchData[nSwitch].nRun2 = -1; @@ -420,9 +420,9 @@ void AISWPressSector::ProcessChannel(RunListEvent* ev) return; } - int nSector =SwitchData[nSwitch].nSector; + auto pSector = SwitchData[nSwitch].pSector; - SwitchData[nSwitch].nRun2 = runlist_AddRunRec(sector[nSector].lotag - 1, &RunData[ev->nRun]); + SwitchData[nSwitch].nRun2 = runlist_AddRunRec(pSector->lotag - 1, &RunData[ev->nRun]); } void AISWPressSector::Use(RunListEvent* ev) @@ -443,7 +443,7 @@ void AISWPressSector::Use(RunListEvent* ev) if (SwitchData[nSwitch].nKeyMask) { auto pSprite = &PlayerList[nPlayer].Actor()->s(); - PlayFXAtXYZ(StaticSound[nSwitchSound], pSprite->x, pSprite->y, 0, pSprite->sectnum, CHANF_LISTENERZ); + PlayFXAtXYZ(StaticSound[nSwitchSound], pSprite->x, pSprite->y, 0, CHANF_LISTENERZ); StatusMessage(300, "YOU NEED THE KEY FOR THIS DOOR"); } @@ -463,6 +463,7 @@ std::pair BuildSwPressWall(int nChannel, int nLink, walltype* pWall) SwitchData[SwitchCount].nLink = nLink; SwitchData[SwitchCount].pWall = pWall; SwitchData[SwitchCount].nRun3 = -1; + SwitchData[SwitchCount].pSector = nullptr; return { SwitchCount, 0x60000 }; } @@ -507,9 +508,9 @@ void AISWPressWall::Use(RunListEvent* ev) } auto pWall = SwitchData[nSwitch].pWall; - int nSector =SwitchData[nSwitch].nSector; // CHECKME - where is this set?? + auto pSector = SwitchData[nSwitch].pSector; - PlayFXAtXYZ(StaticSound[nSwitchSound], pWall->x, pWall->y, 0, nSector, CHANF_LISTENERZ); + PlayFXAtXYZ(StaticSound[nSwitchSound], pWall->x, pWall->y, 0, CHANF_LISTENERZ); } END_PS_NS