From 9495626de351f5b406e287b1da99e4c380c235e5 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 21:54:57 +0200 Subject: [PATCH 01/18] reimplement: SHC_3BB0A8C1_0x00500D60 100.00% Reimplemented --- .../addWallPlacementInfoForTile.cpp | 35 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp diff --git a/src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp b/src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp new file mode 100644 index 000000000..828459145 --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp @@ -0,0 +1,35 @@ +#include "../WallAndPitchState.func.hpp" + +#include "OpenSHC/Game/GameMode2.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode2; + + /* + WARNING: Enum "MappersEnum": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00500D60 + void WallAndPitchState::addWallPlacementInfoForTile(int tile) + { + if (((DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER) + && (DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SIEGE_THAT)) + && (this->index < 100)) { + this->wallPlacementInfoArray[this->index].tile_OR_pitchID = tile; + this->wallPlacementInfoArray[this->index].height = DAT_TileMapState::instance.HeightLayer[tile]; + this->wallPlacementInfoArray[this->index].logic = DAT_TileMapState::instance.LogicLayer[tile] & 0x470b00; + this->wallPlacementInfoArray[this->index].damage = DAT_TileMapState::instance.DamageLayer[tile]; + this->index = this->index + 1; + } + return; + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index b80b8635f..353e3bb16 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41481,7 +41481,7 @@ SHC_3BB0A8C1_0x00500CF0 | 0.0% | Pending SHC_3BB0A8C1_0x00500D30 | 0.0% | Pending -SHC_3BB0A8C1_0x00500D60 | 0.0% | Pending +SHC_3BB0A8C1_0x00500D60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500DD0 | 0.0% | Pending From d20b395c747f22de6e4968d60c0df46a90553112 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 21:54:57 +0200 Subject: [PATCH 02/18] reimplement: SHC_3BB0A8C1_0x005118C0 51.79% tail-merge of arms differs --- .../confirmAndQueueDestructionCommand.cpp | 78 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp diff --git a/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp new file mode 100644 index 000000000..bc61582b3 --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp @@ -0,0 +1,78 @@ +#include "../WallAndPitchState.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Commands::GameCommandType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names + */ + /* + WARNING: Enum "DPERRInt": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x005118C0 + void WallAndPitchState::confirmAndQueueDestructionCommand() + { + if (this->countdown != 0) { + this->countdown = this->countdown + 1; + MACRO_CALL_MEMBER(OpenSHC::Map::WallAndPitchState_Func::updateDestructionConfirmationCountdown, this)(); + if (this->countdown != 0) { + switch (this->state) { + case 0: + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->id; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 100; + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 + = DAT_BuildingsState::instance.buildings[this->id].uid; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_DESTROY_BUILDING); + break; + case 1: + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 1; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->id; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)((GameCommandType)75); + break; + case 2: + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 2; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->id; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)((GameCommandType)75); + break; + case 3: + DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = 3; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->counter; + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = this->flag; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)((GameCommandType)76); + break; + case 4: + DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = 4; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->counter; + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = this->flag; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)((GameCommandType)76); + break; + } + } + } + this->countdown = 0; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 353e3bb16..5f3b8aec2 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -44191,7 +44191,7 @@ SHC_3BB0A8C1_0x005116E0 | 0.0% | Pending SHC_3BB0A8C1_0x00511850 | 0.0% | Pending -SHC_3BB0A8C1_0x005118C0 | 0.0% | Pending +SHC_3BB0A8C1_0x005118C0 | 51.8% | tail-merge of arms differs SHC_3BB0A8C1_0x005119A4 | 0.0% | Pending From c0ed1e449179f277e2326309cc91ede3d930076e Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 21:54:58 +0200 Subject: [PATCH 03/18] reimplement: SHC_3BB0A8C1_0x00500EE0 100.00% Reimplemented --- .../Map/WallAndPitchState/destroyPitch.cpp | 36 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Map/WallAndPitchState/destroyPitch.cpp diff --git a/src/OpenSHC/Map/WallAndPitchState/destroyPitch.cpp b/src/OpenSHC/Map/WallAndPitchState/destroyPitch.cpp new file mode 100644 index 000000000..214268068 --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/destroyPitch.cpp @@ -0,0 +1,36 @@ +#include "../WallAndPitchState.func.hpp" + +#include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" +#include "OpenSHC/Map/TileMapState.func.hpp" +#include "OpenSHC/UI/MinimapViewState.func.hpp" +#include "OpenSHC/Game/Resources/ResourceType.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_MinimapViewState.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::Resources::ResourceType; + + /* + WARNING: Enum "MappersEnum": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00500EE0 + void WallAndPitchState::destroyPitch(int playerID, int count, int amount, int param_4) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Buildings::BuildingsState_Func::processResourceGain, DAT_BuildingsState::ptr)( + playerID, OpenSHC::Game::Resources::RT_PITCH, amount / 4); + for (int i = 0; i < count; i++) { + MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::destroyPitchDitch, DAT_TileMapState::ptr)( + this->receivedWallPlacementInfoArray[i].tile_OR_pitchID); + } + MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::triggerMinimapRedraw, DAT_MinimapViewState::ptr)(1); + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 5f3b8aec2..050e503c7 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41487,7 +41487,7 @@ SHC_3BB0A8C1_0x00500DD0 | 0.0% | Pending SHC_3BB0A8C1_0x00500E20 | 0.0% | Pending -SHC_3BB0A8C1_0x00500EE0 | 0.0% | Pending +SHC_3BB0A8C1_0x00500EE0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500F40 | 0.0% | Pending From 68b9eda04ba76fa3aabed09ac77b12e70ccd7aab Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 21:54:58 +0200 Subject: [PATCH 04/18] reimplement: SHC_3BB0A8C1_0x00500E20 56.90% reg alloc, this clobbered --- .../Map/WallAndPitchState/destroyWall.cpp | 53 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp diff --git a/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp b/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp new file mode 100644 index 000000000..f1fd2b8f3 --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp @@ -0,0 +1,53 @@ +#include "../WallAndPitchState.func.hpp" + +#include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" +#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" +#include "OpenSHC/UI/MinimapViewState.func.hpp" +#include "OpenSHC/Game/Resources/ResourceType.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_MinimapViewState.hpp" +#include "OpenSHC/Globals/DAT_PathFindingState.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" +#include "OpenSHC/Globals/DAT_ViewportRenderState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::Resources::ResourceType; + + /* + WARNING: Enum "MappersEnum": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00500E20 + void WallAndPitchState::destroyWall(int playerID, int count, int amount, int param_4) + { + if (param_4 == 0) { + MACRO_CALL_MEMBER(OpenSHC::Map::Buildings::BuildingsState_Func::processResourceGain, + DAT_BuildingsState::ptr)(playerID, OpenSHC::Game::Resources::RT_STONE, amount); + } else { + MACRO_CALL_MEMBER(OpenSHC::Map::Buildings::BuildingsState_Func::processResourceGain, + DAT_BuildingsState::ptr)(playerID, OpenSHC::Game::Resources::RT_WOOD, amount); + } + for (int i = 0; i < count; i++) { + int _tile = this->receivedWallPlacementInfoArray[i].tile_OR_pitchID; + uint _y = (uint)DAT_ViewportRenderState::instance.tileTranslationMatrix_YComponent[_tile]; + DAT_TileMapState::instance.DamageLayer[_tile] = this->receivedWallPlacementInfoArray[i].damage; + DAT_TileMapState::instance.HeightLayer[_tile] = this->receivedWallPlacementInfoArray[i].height; + DAT_TileMapState::instance.LogicLayer[_tile] = DAT_TileMapState::instance.LogicLayer[_tile] & 0xffb8f4ff; + DAT_TileMapState::instance.LogicLayer[_tile] + = this->receivedWallPlacementInfoArray[i].logic | DAT_TileMapState::instance.LogicLayer[_tile]; + MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::updatePathLinkagesInAllEightDirections, + DAT_PathFindingState::ptr)(_y, _tile); + MACRO_CALL_MEMBER( + OpenSHC::Map::Navigation::PathFindingState_Func::updateWalkAndPathLayer, DAT_PathFindingState::ptr)( + 9, (uint)(_tile - DAT_ViewportRenderState::instance.translationMatrix[_y].addXgetTile), _y); + } + MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::triggerMinimapRedraw, DAT_MinimapViewState::ptr)(1); + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 050e503c7..6c6eb502d 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41485,7 +41485,7 @@ SHC_3BB0A8C1_0x00500D60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500DD0 | 0.0% | Pending -SHC_3BB0A8C1_0x00500E20 | 0.0% | Pending +SHC_3BB0A8C1_0x00500E20 | 56.9% | reg alloc, this clobbered SHC_3BB0A8C1_0x00500EE0 | 100.0% | Reimplemented From 83831134aea769cc17e213716c9a2fd846bb2b91 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 21:54:58 +0200 Subject: [PATCH 05/18] reimplement: SHC_3BB0A8C1_0x00500DD0 100.00% Reimplemented --- .../Map/WallAndPitchState/placePitchDitch.cpp | 36 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp diff --git a/src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp b/src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp new file mode 100644 index 000000000..7a04f965e --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp @@ -0,0 +1,36 @@ +#include "../WallAndPitchState.func.hpp" + +#include "OpenSHC/Game/GameMode2.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode2; + + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00500DD0 + void WallAndPitchState::placePitchDitch(int pitchID) + { + if ((DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER) + && (DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SIEGE_THAT)) { + if (this->countdown == 0) { + this->countdown = 400; + this->index = 0; + this->counter = 0; + } + if (this->index < 100) { + this->wallPlacementInfoArray[this->index].tile_OR_pitchID = pitchID; + this->index = this->index + 1; + this->counter = this->counter + 1; + this->countdown = 400; + } + } + return; + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 6c6eb502d..77f77d3bf 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41483,7 +41483,7 @@ SHC_3BB0A8C1_0x00500D30 | 0.0% | Pending SHC_3BB0A8C1_0x00500D60 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00500DD0 | 0.0% | Pending +SHC_3BB0A8C1_0x00500DD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500E20 | 56.9% | reg alloc, this clobbered From 4093cdc0279042b8b9a7a4c4c7d9a534d8133926 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 21:54:59 +0200 Subject: [PATCH 06/18] reimplement: SHC_3BB0A8C1_0x00500C80 100.00% Reimplemented --- .../resetWallAndPitchState.cpp | 33 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Map/WallAndPitchState/resetWallAndPitchState.cpp diff --git a/src/OpenSHC/Map/WallAndPitchState/resetWallAndPitchState.cpp b/src/OpenSHC/Map/WallAndPitchState/resetWallAndPitchState.cpp new file mode 100644 index 000000000..d0048f91c --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/resetWallAndPitchState.cpp @@ -0,0 +1,33 @@ +#include "../WallAndPitchState.func.hpp" + +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode2; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00500C80 + void WallAndPitchState::resetWallAndPitchState() + { + if ((DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER) + && (DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SIEGE_THAT)) { + this->state = 4; + this->countdown = 400; + this->index = 0; + this->counter = 0; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + } + return; + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 77f77d3bf..ca39cb565 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41473,7 +41473,7 @@ SHC_3BB0A8C1_0x00500BB0 | 0.0% | Pending SHC_3BB0A8C1_0x00500C20 | 0.0% | Pending -SHC_3BB0A8C1_0x00500C80 | 0.0% | Pending +SHC_3BB0A8C1_0x00500C80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500CB0 | 0.0% | Pending From 52b7a71edcd39fc0138b6a4e2fd68108d2f39bb5 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 21:54:59 +0200 Subject: [PATCH 07/18] reimplement: SHC_3BB0A8C1_0x00500D30 100.00% Reimplemented --- .../resetWallPlacementInfo.cpp | 33 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Map/WallAndPitchState/resetWallPlacementInfo.cpp diff --git a/src/OpenSHC/Map/WallAndPitchState/resetWallPlacementInfo.cpp b/src/OpenSHC/Map/WallAndPitchState/resetWallPlacementInfo.cpp new file mode 100644 index 000000000..532c87382 --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/resetWallPlacementInfo.cpp @@ -0,0 +1,33 @@ +#include "../WallAndPitchState.func.hpp" + +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode2; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00500D30 + void WallAndPitchState::resetWallPlacementInfo() + { + if ((DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER) + && (DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SIEGE_THAT)) { + this->state = 3; + this->countdown = 400; + this->index = 0; + this->counter = 0; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + } + return; + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index ca39cb565..4a2675247 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41479,7 +41479,7 @@ SHC_3BB0A8C1_0x00500CB0 | 0.0% | Pending SHC_3BB0A8C1_0x00500CF0 | 0.0% | Pending -SHC_3BB0A8C1_0x00500D30 | 0.0% | Pending +SHC_3BB0A8C1_0x00500D30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500D60 | 100.0% | Reimplemented From 5995926aced71c494ac29a742dc947bec893d673 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 21:54:59 +0200 Subject: [PATCH 08/18] reimplement: SHC_3BB0A8C1_0x00500C20 95.65% add -0x28 vs sub 0x28 --- .../startBuildingDestructionConfirmation.cpp | 38 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp diff --git a/src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp b/src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp new file mode 100644 index 000000000..815f6d46d --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp @@ -0,0 +1,38 @@ +#include "../WallAndPitchState.func.hpp" + +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode2; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00500C20 + void WallAndPitchState::startBuildingDestructionConfirmation(int buildingID) + { + if ((DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER) + && (DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SIEGE_THAT)) { + if ((int)(short)DAT_BuildingsState::instance.buildings[buildingID].buildingType - 0x28U <= 4) { + this->countdown = 0; + return; + } + this->state = 0; + this->countdown = 400; + this->id = buildingID; + this->uid = DAT_BuildingsState::instance.buildings[buildingID].uid; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + } + return; + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 4a2675247..2fa13e6f8 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41471,7 +41471,7 @@ SHC_3BB0A8C1_0x00500B50 | 0.0% | Pending SHC_3BB0A8C1_0x00500BB0 | 0.0% | Pending -SHC_3BB0A8C1_0x00500C20 | 0.0% | Pending +SHC_3BB0A8C1_0x00500C20 | 95.7% | add -0x28 vs sub 0x28 SHC_3BB0A8C1_0x00500C80 | 100.0% | Reimplemented From 379fc452503298da8ac45cad4b0d1b36e75e7580 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 21:55:00 +0200 Subject: [PATCH 09/18] reimplement: SHC_3BB0A8C1_0x00500CB0 100.00% Reimplemented --- .../startEntityDestructionConfirmation.cpp | 34 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Map/WallAndPitchState/startEntityDestructionConfirmation.cpp diff --git a/src/OpenSHC/Map/WallAndPitchState/startEntityDestructionConfirmation.cpp b/src/OpenSHC/Map/WallAndPitchState/startEntityDestructionConfirmation.cpp new file mode 100644 index 000000000..6ad27cfc0 --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/startEntityDestructionConfirmation.cpp @@ -0,0 +1,34 @@ +#include "../WallAndPitchState.func.hpp" + +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_EntityState.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode2; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00500CB0 + void WallAndPitchState::startEntityDestructionConfirmation(int entityID) + { + if ((DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER) + && (DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SIEGE_THAT)) { + this->id = entityID; + this->state = 1; + this->countdown = 400; + this->uid = DAT_EntityState::instance.entityArray[entityID].uid; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + } + return; + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 2fa13e6f8..e53a99dc2 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41475,7 +41475,7 @@ SHC_3BB0A8C1_0x00500C20 | 95.7% | add -0x28 vs sub 0x28 SHC_3BB0A8C1_0x00500C80 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00500CB0 | 0.0% | Pending +SHC_3BB0A8C1_0x00500CB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500CF0 | 0.0% | Pending From 65f5f2fbc763c6bc3c16176aec9100b6227c7bba Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 21:55:00 +0200 Subject: [PATCH 10/18] reimplement: SHC_3BB0A8C1_0x00500CF0 100.00% Reimplemented --- .../startUnitDestructionConfirmation.cpp | 34 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Map/WallAndPitchState/startUnitDestructionConfirmation.cpp diff --git a/src/OpenSHC/Map/WallAndPitchState/startUnitDestructionConfirmation.cpp b/src/OpenSHC/Map/WallAndPitchState/startUnitDestructionConfirmation.cpp new file mode 100644 index 000000000..c2ef5d356 --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/startUnitDestructionConfirmation.cpp @@ -0,0 +1,34 @@ +#include "../WallAndPitchState.func.hpp" + +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode2; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00500CF0 + void WallAndPitchState::startUnitDestructionConfirmation(int unitID) + { + if ((DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER) + && (DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SIEGE_THAT)) { + this->id = unitID; + this->state = 2; + this->countdown = 400; + this->uid = DAT_UnitsState::instance.units[unitID].uid; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + } + return; + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index e53a99dc2..f48f349ed 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41477,7 +41477,7 @@ SHC_3BB0A8C1_0x00500C80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500CB0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00500CF0 | 0.0% | Pending +SHC_3BB0A8C1_0x00500CF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500D30 | 100.0% | Reimplemented From 9ce63dd6b06849829e92576b3451531e803e8c1f Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 21:55:00 +0200 Subject: [PATCH 11/18] reimplement: SHC_3BB0A8C1_0x00500F40 100.00% Reimplemented --- ...updateDestructionConfirmationCountdown.cpp | 104 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp diff --git a/src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp b/src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp new file mode 100644 index 000000000..2b03e8917 --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp @@ -0,0 +1,104 @@ +#include "../WallAndPitchState.func.hpp" + +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode2; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + /* + WARNING: Enum "MappersEnum": Some values do not have unique names + */ + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + // FUNCTION: STRONGHOLDCRUSADER 0x00500F40 + void WallAndPitchState::updateDestructionConfirmationCountdown() + { + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER) { + this->countdown = 0; + } + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + this->countdown = 0; + return; + } + if (this->countdown == 0) { + return; + } + this->countdown = this->countdown - 1; + switch (this->state) { + case 0: + if (DAT_BuildingsState::instance.buildings[this->id].uid != this->uid) { + this->countdown = 0; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + return; + } + if (DAT_BuildingsState::instance.buildings[this->id].currentHealth + != DAT_BuildingsState::instance.buildings[this->id].maxHealth) { + this->countdown = 0; + } + for (int i = 0; i != 25; i++) { + if (DAT_BuildingsState::instance.buildings[this->id].resources[i] != 0) { + this->countdown = 0; + } + } + break; + case 2: + if (DAT_UnitsState::instance.units[this->id].uid != this->uid) { + this->countdown = 0; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + return; + } + if (DAT_UnitsState::instance.units[this->id] + .digTileX__OR__countCurrentlyManningEnginers__OR__forCowsRandomBelow300 + != 0) { + this->countdown = 0; + } + if (DAT_UnitsState::instance.units[this->id].health != DAT_UnitsState::instance.units[this->id].maxHealth) { + this->countdown = 0; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + return; + } + break; + case 3: + if (this->index == 0) { + this->countdown = 0; + } + for (int i = 0; i < this->index; i++) { + int _tile = this->wallPlacementInfoArray[i].tile_OR_pitchID; + if ((DAT_TileMapState::instance.LogicLayer[_tile] & 0x100) == 0) { + this->countdown = 0; + } + if (DAT_TileMapState::instance.DamageLayer[_tile] != 0) { + this->countdown = 0; + } + } + break; + case 4: + for (int i = 0; i < this->index; i++) { + if (this->wallPlacementInfoArray[i].tile_OR_pitchID == 0 + || (DAT_TileMapState::instance.LogicLayer[DAT_TileMapState::instance + .pitchDitches[this->wallPlacementInfoArray[i].tile_OR_pitchID] + .tile] + & 8) + == 0) { + this->countdown = 0; + } + } + } + if (this->countdown == 0) { + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index f48f349ed..875db15de 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41489,7 +41489,7 @@ SHC_3BB0A8C1_0x00500E20 | 56.9% | reg alloc, this clobbered SHC_3BB0A8C1_0x00500EE0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00500F40 | 0.0% | Pending +SHC_3BB0A8C1_0x00500F40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00501070 | 0.0% | Pending From c60bf623b212b4b7a599272013333bfae18ad243 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 22:04:22 +0200 Subject: [PATCH 12/18] cleanup: drop Ghidra comments and trailing returns in Map::WallAndPitchState Remove the decompiler-generated `WARNING: Enum ...` and `decompilerscript: committed: ...` block comments, and the loose `return;` at the end of each void function body. The `// FUNCTION:` address lines and the early returns inside the functions are untouched. Deletions only; rebuilt with the struct resolvers on and every reccmp percentage is unchanged (avg 90.42 over 11). Co-Authored-By: Claude Opus 5 --- .../WallAndPitchState/addWallPlacementInfoForTile.cpp | 7 ------- .../confirmAndQueueDestructionCommand.cpp | 9 --------- src/OpenSHC/Map/WallAndPitchState/destroyPitch.cpp | 6 ------ src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp | 6 ------ src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp | 4 ---- .../Map/WallAndPitchState/resetWallAndPitchState.cpp | 4 ---- .../Map/WallAndPitchState/resetWallPlacementInfo.cpp | 4 ---- .../startBuildingDestructionConfirmation.cpp | 4 ---- .../startEntityDestructionConfirmation.cpp | 4 ---- .../startUnitDestructionConfirmation.cpp | 4 ---- .../updateDestructionConfirmationCountdown.cpp | 6 ------ 11 files changed, 58 deletions(-) diff --git a/src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp b/src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp index 828459145..666f5d8fb 100644 --- a/src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp @@ -10,12 +10,6 @@ namespace Map { using OpenSHC::Game::GameMode2; - /* - WARNING: Enum "MappersEnum": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00500D60 void WallAndPitchState::addWallPlacementInfoForTile(int tile) { @@ -28,7 +22,6 @@ namespace Map { this->wallPlacementInfoArray[this->index].damage = DAT_TileMapState::instance.DamageLayer[tile]; this->index = this->index + 1; } - return; } } diff --git a/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp index bc61582b3..133178616 100644 --- a/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp @@ -14,15 +14,6 @@ namespace Map { using OpenSHC::Commands::GameCommandType; using OpenSHC::WindowsHelper::Enums::BOOLEnum; - /* - WARNING: Enum "DPSEND_EnumInt": Some values do not have unique names - */ - /* - WARNING: Enum "DPERRInt": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x005118C0 void WallAndPitchState::confirmAndQueueDestructionCommand() { diff --git a/src/OpenSHC/Map/WallAndPitchState/destroyPitch.cpp b/src/OpenSHC/Map/WallAndPitchState/destroyPitch.cpp index 214268068..4acabbce8 100644 --- a/src/OpenSHC/Map/WallAndPitchState/destroyPitch.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/destroyPitch.cpp @@ -14,12 +14,6 @@ namespace Map { using OpenSHC::Game::Resources::ResourceType; - /* - WARNING: Enum "MappersEnum": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00500EE0 void WallAndPitchState::destroyPitch(int playerID, int count, int amount, int param_4) { diff --git a/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp b/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp index f1fd2b8f3..1c75af019 100644 --- a/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp @@ -16,12 +16,6 @@ namespace Map { using OpenSHC::Game::Resources::ResourceType; - /* - WARNING: Enum "MappersEnum": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00500E20 void WallAndPitchState::destroyWall(int playerID, int count, int amount, int param_4) { diff --git a/src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp b/src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp index 7a04f965e..311858895 100644 --- a/src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp @@ -9,9 +9,6 @@ namespace Map { using OpenSHC::Game::GameMode2; - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00500DD0 void WallAndPitchState::placePitchDitch(int pitchID) { @@ -29,7 +26,6 @@ namespace Map { this->countdown = 400; } } - return; } } diff --git a/src/OpenSHC/Map/WallAndPitchState/resetWallAndPitchState.cpp b/src/OpenSHC/Map/WallAndPitchState/resetWallAndPitchState.cpp index d0048f91c..c749f00e0 100644 --- a/src/OpenSHC/Map/WallAndPitchState/resetWallAndPitchState.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/resetWallAndPitchState.cpp @@ -12,9 +12,6 @@ namespace Map { using OpenSHC::Game::GameMode2; using OpenSHC::WindowsHelper::Enums::BOOLEnum; - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00500C80 void WallAndPitchState::resetWallAndPitchState() { @@ -26,7 +23,6 @@ namespace Map { this->counter = 0; DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; } - return; } } diff --git a/src/OpenSHC/Map/WallAndPitchState/resetWallPlacementInfo.cpp b/src/OpenSHC/Map/WallAndPitchState/resetWallPlacementInfo.cpp index 532c87382..53507efc7 100644 --- a/src/OpenSHC/Map/WallAndPitchState/resetWallPlacementInfo.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/resetWallPlacementInfo.cpp @@ -12,9 +12,6 @@ namespace Map { using OpenSHC::Game::GameMode2; using OpenSHC::WindowsHelper::Enums::BOOLEnum; - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00500D30 void WallAndPitchState::resetWallPlacementInfo() { @@ -26,7 +23,6 @@ namespace Map { this->counter = 0; DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; } - return; } } diff --git a/src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp b/src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp index 815f6d46d..1ebb2589d 100644 --- a/src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp @@ -13,9 +13,6 @@ namespace Map { using OpenSHC::Game::GameMode2; using OpenSHC::WindowsHelper::Enums::BOOLEnum; - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00500C20 void WallAndPitchState::startBuildingDestructionConfirmation(int buildingID) { @@ -31,7 +28,6 @@ namespace Map { this->uid = DAT_BuildingsState::instance.buildings[buildingID].uid; DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; } - return; } } diff --git a/src/OpenSHC/Map/WallAndPitchState/startEntityDestructionConfirmation.cpp b/src/OpenSHC/Map/WallAndPitchState/startEntityDestructionConfirmation.cpp index 6ad27cfc0..ee60e03b6 100644 --- a/src/OpenSHC/Map/WallAndPitchState/startEntityDestructionConfirmation.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/startEntityDestructionConfirmation.cpp @@ -13,9 +13,6 @@ namespace Map { using OpenSHC::Game::GameMode2; using OpenSHC::WindowsHelper::Enums::BOOLEnum; - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00500CB0 void WallAndPitchState::startEntityDestructionConfirmation(int entityID) { @@ -27,7 +24,6 @@ namespace Map { this->uid = DAT_EntityState::instance.entityArray[entityID].uid; DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; } - return; } } diff --git a/src/OpenSHC/Map/WallAndPitchState/startUnitDestructionConfirmation.cpp b/src/OpenSHC/Map/WallAndPitchState/startUnitDestructionConfirmation.cpp index c2ef5d356..bf606af15 100644 --- a/src/OpenSHC/Map/WallAndPitchState/startUnitDestructionConfirmation.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/startUnitDestructionConfirmation.cpp @@ -13,9 +13,6 @@ namespace Map { using OpenSHC::Game::GameMode2; using OpenSHC::WindowsHelper::Enums::BOOLEnum; - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00500CF0 void WallAndPitchState::startUnitDestructionConfirmation(int unitID) { @@ -27,7 +24,6 @@ namespace Map { this->uid = DAT_UnitsState::instance.units[unitID].uid; DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; } - return; } } diff --git a/src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp b/src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp index 2b03e8917..1c632542a 100644 --- a/src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp @@ -15,12 +15,6 @@ namespace Map { using OpenSHC::Game::GameMode2; using OpenSHC::WindowsHelper::Enums::BOOLEnum; - /* - WARNING: Enum "MappersEnum": Some values do not have unique names - */ - /* - decompilerscript: committed: 2025-01-30 21:57:43.216000 - */ // FUNCTION: STRONGHOLDCRUSADER 0x00500F40 void WallAndPitchState::updateDestructionConfirmationCountdown() { From fe4130206cbb98dbc5050a651a2a1b89502d198c Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 22:21:54 +0200 Subject: [PATCH 13/18] reimplement: SHC_3BB0A8C1_0x00500E20 100.00% Reimplemented --- src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp | 8 ++++---- status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp b/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp index 1c75af019..cc5c81157 100644 --- a/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp @@ -28,17 +28,17 @@ namespace Map { } for (int i = 0; i < count; i++) { int _tile = this->receivedWallPlacementInfoArray[i].tile_OR_pitchID; - uint _y = (uint)DAT_ViewportRenderState::instance.tileTranslationMatrix_YComponent[_tile]; + int _y = (int)DAT_ViewportRenderState::instance.tileTranslationMatrix_YComponent[_tile]; DAT_TileMapState::instance.DamageLayer[_tile] = this->receivedWallPlacementInfoArray[i].damage; DAT_TileMapState::instance.HeightLayer[_tile] = this->receivedWallPlacementInfoArray[i].height; DAT_TileMapState::instance.LogicLayer[_tile] = DAT_TileMapState::instance.LogicLayer[_tile] & 0xffb8f4ff; DAT_TileMapState::instance.LogicLayer[_tile] = this->receivedWallPlacementInfoArray[i].logic | DAT_TileMapState::instance.LogicLayer[_tile]; + int _tileDelta = _tile - DAT_ViewportRenderState::instance.translationMatrix[_y].addXgetTile; MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::updatePathLinkagesInAllEightDirections, DAT_PathFindingState::ptr)(_y, _tile); - MACRO_CALL_MEMBER( - OpenSHC::Map::Navigation::PathFindingState_Func::updateWalkAndPathLayer, DAT_PathFindingState::ptr)( - 9, (uint)(_tile - DAT_ViewportRenderState::instance.translationMatrix[_y].addXgetTile), _y); + MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::updateWalkAndPathLayer, + DAT_PathFindingState::ptr)(9, (uint)_tileDelta, _y); } MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::triggerMinimapRedraw, DAT_MinimapViewState::ptr)(1); } diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 875db15de..67d6799dc 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41485,7 +41485,7 @@ SHC_3BB0A8C1_0x00500D60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500DD0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00500E20 | 56.9% | reg alloc, this clobbered +SHC_3BB0A8C1_0x00500E20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500EE0 | 100.0% | Reimplemented From 0456a129a4e024e221021819b4f51f0feb67a29a Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 28 Sep 2026 23:13:43 +0200 Subject: [PATCH 14/18] reimplement: SHC_3BB0A8C1_0x005118C0 59.32% MSVC merges Param0 not Param2 --- .../confirmAndQueueDestructionCommand.cpp | 8 ++++---- status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp index 133178616..736ae56bf 100644 --- a/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp @@ -43,18 +43,18 @@ namespace Map { DAT_GameSynchronyState::ptr)((GameCommandType)75); break; case 3: - DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = 3; DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->counter; - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = this->flag; + DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = 3; + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)((GameCommandType)76); break; case 4: - DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = 4; DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->counter; - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = this->flag; + DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = 4; + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)((GameCommandType)76); break; diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 67d6799dc..e5388a7b8 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -44191,7 +44191,7 @@ SHC_3BB0A8C1_0x005116E0 | 0.0% | Pending SHC_3BB0A8C1_0x00511850 | 0.0% | Pending -SHC_3BB0A8C1_0x005118C0 | 51.8% | tail-merge of arms differs +SHC_3BB0A8C1_0x005118C0 | 59.3% | MSVC merges Param0 not Param2 SHC_3BB0A8C1_0x005119A4 | 0.0% | Pending From 10e449e513d2551218c78a8d95a4d47d178037a1 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 28 Sep 2026 22:07:06 +0000 Subject: [PATCH 15/18] cleanup: use compound assignment in Map::WallAndPitchState Rewrite the decompiler's expanded arithmetic and bitwise assignments into their compound forms: this->index = this->index + 1 -> this->index += 1 this->countdown = this->countdown - 1 -> this->countdown -= 1 layer[t] = layer[t] & 0xffb8f4ff -> layer[t] &= 0xffb8f4ff layer[t] = info.logic | layer[t] -> layer[t] |= info.logic Code-generation neutral: with the struct resolvers enabled, reccmp reports the identical match percentage for all eleven functions before and after (addWallPlacementInfoForTile, placePitchDitch, resetWallPlacementInfo, resetWallAndPitchState, startEntityDestructionConfirmation, startUnitDestructionConfirmation and updateDestructionConfirmationCountdown at 100.00%, startBuildingDestructionConfirmation 95.65%, destroyWall 93.22%, destroyPitch 80.65%, confirmAndQueueDestructionCommand 59.32%). Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01APv1k4u7nvSoJ6qABsdVev --- .../Map/WallAndPitchState/addWallPlacementInfoForTile.cpp | 2 +- .../WallAndPitchState/confirmAndQueueDestructionCommand.cpp | 2 +- src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp | 5 ++--- src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp | 4 ++-- .../updateDestructionConfirmationCountdown.cpp | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp b/src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp index 666f5d8fb..c2be908a8 100644 --- a/src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/addWallPlacementInfoForTile.cpp @@ -20,7 +20,7 @@ namespace Map { this->wallPlacementInfoArray[this->index].height = DAT_TileMapState::instance.HeightLayer[tile]; this->wallPlacementInfoArray[this->index].logic = DAT_TileMapState::instance.LogicLayer[tile] & 0x470b00; this->wallPlacementInfoArray[this->index].damage = DAT_TileMapState::instance.DamageLayer[tile]; - this->index = this->index + 1; + this->index += 1; } } diff --git a/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp index 736ae56bf..d3b3b7c09 100644 --- a/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp @@ -18,7 +18,7 @@ namespace Map { void WallAndPitchState::confirmAndQueueDestructionCommand() { if (this->countdown != 0) { - this->countdown = this->countdown + 1; + this->countdown += 1; MACRO_CALL_MEMBER(OpenSHC::Map::WallAndPitchState_Func::updateDestructionConfirmationCountdown, this)(); if (this->countdown != 0) { switch (this->state) { diff --git a/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp b/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp index cc5c81157..a78bf9903 100644 --- a/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/destroyWall.cpp @@ -31,9 +31,8 @@ namespace Map { int _y = (int)DAT_ViewportRenderState::instance.tileTranslationMatrix_YComponent[_tile]; DAT_TileMapState::instance.DamageLayer[_tile] = this->receivedWallPlacementInfoArray[i].damage; DAT_TileMapState::instance.HeightLayer[_tile] = this->receivedWallPlacementInfoArray[i].height; - DAT_TileMapState::instance.LogicLayer[_tile] = DAT_TileMapState::instance.LogicLayer[_tile] & 0xffb8f4ff; - DAT_TileMapState::instance.LogicLayer[_tile] - = this->receivedWallPlacementInfoArray[i].logic | DAT_TileMapState::instance.LogicLayer[_tile]; + DAT_TileMapState::instance.LogicLayer[_tile] &= 0xffb8f4ff; + DAT_TileMapState::instance.LogicLayer[_tile] |= this->receivedWallPlacementInfoArray[i].logic; int _tileDelta = _tile - DAT_ViewportRenderState::instance.translationMatrix[_y].addXgetTile; MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::updatePathLinkagesInAllEightDirections, DAT_PathFindingState::ptr)(_y, _tile); diff --git a/src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp b/src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp index 311858895..cc6de55ea 100644 --- a/src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/placePitchDitch.cpp @@ -21,8 +21,8 @@ namespace Map { } if (this->index < 100) { this->wallPlacementInfoArray[this->index].tile_OR_pitchID = pitchID; - this->index = this->index + 1; - this->counter = this->counter + 1; + this->index += 1; + this->counter += 1; this->countdown = 400; } } diff --git a/src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp b/src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp index 1c632542a..5589d5c88 100644 --- a/src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/updateDestructionConfirmationCountdown.cpp @@ -28,7 +28,7 @@ namespace Map { if (this->countdown == 0) { return; } - this->countdown = this->countdown - 1; + this->countdown -= 1; switch (this->state) { case 0: if (DAT_BuildingsState::instance.buildings[this->id].uid != this->uid) { From 48f3a52c3ca606f199ace68e27e00a67b93da24f Mon Sep 17 00:00:00 2001 From: Gynt Date: Tue, 6 Oct 2026 00:20:29 +0200 Subject: [PATCH 16/18] reimplement: SHC_3BB0A8C1_0x005118C0 76.92% case 4 register allocation --- .../confirmAndQueueDestructionCommand.cpp | 38 ++++++++++++------- status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp index d3b3b7c09..997aeb93e 100644 --- a/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp @@ -22,43 +22,53 @@ namespace Map { MACRO_CALL_MEMBER(OpenSHC::Map::WallAndPitchState_Func::updateDestructionConfirmationCountdown, this)(); if (this->countdown != 0) { switch (this->state) { - case 0: - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->id; + case 0: { + int id = this->id; + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = id; + int uid = DAT_BuildingsState::instance.buildings[id].uid; DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = 100; - DAT_GameSynchronyState::instance.DAT_GameCommandParam2 - = DAT_BuildingsState::instance.buildings[this->id].uid; + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = uid; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_DESTROY_BUILDING); break; - case 1: + } + case 1: { + int id = this->id; DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 1; - DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->id; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = id; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)((GameCommandType)75); break; - case 2: + } + case 2: { + int id = this->id; DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 2; - DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->id; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = id; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)((GameCommandType)75); break; - case 3: + } + case 3: { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->counter; - DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = this->flag; + int flag = this->flag; DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = 3; - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = flag; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)((GameCommandType)76); break; - case 4: + } + case 4: { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->counter; - DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = this->flag; + int flag = this->flag; DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = 4; - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = flag; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)((GameCommandType)76); break; } + } } } this->countdown = 0; diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index e5388a7b8..6e84754fa 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -44191,7 +44191,7 @@ SHC_3BB0A8C1_0x005116E0 | 0.0% | Pending SHC_3BB0A8C1_0x00511850 | 0.0% | Pending -SHC_3BB0A8C1_0x005118C0 | 59.3% | MSVC merges Param0 not Param2 +SHC_3BB0A8C1_0x005118C0 | 76.9% | case 4 register allocation SHC_3BB0A8C1_0x005119A4 | 0.0% | Pending From 028146604cdf8f728266e278c381f018500e49f2 Mon Sep 17 00:00:00 2001 From: Gynt Date: Tue, 6 Oct 2026 00:20:30 +0200 Subject: [PATCH 17/18] reimplement: SHC_3BB0A8C1_0x00500C20 100.00% Reimplemented --- .../startBuildingDestructionConfirmation.cpp | 4 +++- status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp b/src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp index 1ebb2589d..edf6f3adb 100644 --- a/src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/startBuildingDestructionConfirmation.cpp @@ -18,7 +18,9 @@ namespace Map { { if ((DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER) && (DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SIEGE_THAT)) { - if ((int)(short)DAT_BuildingsState::instance.buildings[buildingID].buildingType - 0x28U <= 4) { + int buildingType = DAT_BuildingsState::instance.buildings[buildingID].buildingType; + if (buildingType >= OpenSHC::Map::Buildings::BT_MANORHOUSE + && buildingType <= OpenSHC::Map::Buildings::BT_KEEPFIVE) { this->countdown = 0; return; } diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 6e84754fa..f170e4fb3 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -41471,7 +41471,7 @@ SHC_3BB0A8C1_0x00500B50 | 0.0% | Pending SHC_3BB0A8C1_0x00500BB0 | 0.0% | Pending -SHC_3BB0A8C1_0x00500C20 | 95.7% | add -0x28 vs sub 0x28 +SHC_3BB0A8C1_0x00500C20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500C80 | 100.0% | Reimplemented From c6347d6c5689388f0e31d007fc0a20b90e6174a8 Mon Sep 17 00:00:00 2001 From: Gynt Date: Tue, 6 Oct 2026 00:22:31 +0200 Subject: [PATCH 18/18] reimplement: SHC_3BB0A8C1_0x005118C0 100.00% Reimplemented --- .../WallAndPitchState/confirmAndQueueDestructionCommand.cpp | 6 ++---- status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp index 997aeb93e..24536bcd4 100644 --- a/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp +++ b/src/OpenSHC/Map/WallAndPitchState/confirmAndQueueDestructionCommand.cpp @@ -51,9 +51,8 @@ namespace Map { case 3: { DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->counter; - int flag = this->flag; + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = this->flag; DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = 3; - DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = flag; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)((GameCommandType)76); break; @@ -61,9 +60,8 @@ namespace Map { case 4: { DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = this->index; DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = this->counter; - int flag = this->flag; + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = this->flag; DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = 4; - DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = flag; MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)((GameCommandType)76); break; diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index f170e4fb3..0f8aea1d0 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -44191,7 +44191,7 @@ SHC_3BB0A8C1_0x005116E0 | 0.0% | Pending SHC_3BB0A8C1_0x00511850 | 0.0% | Pending -SHC_3BB0A8C1_0x005118C0 | 76.9% | case 4 register allocation +SHC_3BB0A8C1_0x005118C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005119A4 | 0.0% | Pending