1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Initialize gCommandPosition with LOCATION_NULL in case its not set.

This commit is contained in:
Matt
2018-12-30 00:04:34 +01:00
parent 19ffc6208f
commit 38dc762f62
2 changed files with 6 additions and 1 deletions

View File

@@ -435,6 +435,11 @@ int32_t game_do_command_p(
*ebx &= ~GAME_COMMAND_FLAG_APPLY;
// Make sure the camera position won't change if the command skips setting them.
gCommandPosition.x = LOCATION_NULL;
gCommandPosition.y = LOCATION_NULL;
gCommandPosition.z = LOCATION_NULL;
// First call for validity and price check
new_game_command_table[command](eax, ebx, ecx, edx, esi, edi, ebp);
cost = *ebx;

View File

@@ -69,7 +69,7 @@ public:
rct_string_id ErrorTitle = STR_NONE;
rct_string_id ErrorMessage = STR_NONE;
std::array<uint8_t, 12> ErrorMessageArgs;
CoordsXYZ Position = {};
CoordsXYZ Position = { LOCATION_NULL, LOCATION_NULL, LOCATION_NULL };
money32 Cost = 0;
uint16_t ExpenditureType = 0;