mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-28 09:14:58 +01:00
Integrate variables in park.c
This commit is contained in:
@@ -118,6 +118,8 @@ money32 gLandRightsCost;
|
||||
|
||||
rct_xyz16 gCommandPosition;
|
||||
|
||||
uint8 gUnk9E2E28;
|
||||
|
||||
static void map_update_grass_length(int x, int y, rct_map_element *mapElement);
|
||||
static void map_set_grass_length(int x, int y, rct_map_element *mapElement, int length);
|
||||
static void clear_elements_at(int x, int y);
|
||||
@@ -1867,16 +1869,15 @@ static money32 map_set_land_ownership(uint8 flags, sint16 x1, sint16 y1, sint16
|
||||
if (!(flags & GAME_COMMAND_FLAG_APPLY))
|
||||
return 0;
|
||||
|
||||
RCT2_GLOBAL(0x009E2E28, uint8) = 0;
|
||||
|
||||
// Clamp to maximum addressable element to prevent long loop spamming the log
|
||||
x1 = clamp(0, x1, gMapSizeUnits);
|
||||
y1 = clamp(0, y1, gMapSizeUnits);
|
||||
x2 = min(x2, gMapSizeUnits);
|
||||
y2 = min(y2, gMapSizeUnits);
|
||||
gUnk9E2E28 = 0;
|
||||
map_buy_land_rights(x1, y1, x2, y2, 6, flags | (newOwnership << 8));
|
||||
|
||||
if (!(RCT2_GLOBAL(0x9E2E28, uint8) & 1)) {
|
||||
if (!(gUnk9E2E28 & 1)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -383,6 +383,8 @@ extern money32 gLandRightsCost;
|
||||
|
||||
extern rct_xyz16 gCommandPosition;
|
||||
|
||||
extern uint8 gUnk9E2E28;
|
||||
|
||||
void map_init(int size);
|
||||
void map_update_tile_pointers();
|
||||
rct_map_element *map_get_first_element_at(int x, int y);
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "../addresses.h"
|
||||
#include "../cheats.h"
|
||||
#include "../config.h"
|
||||
#include "../game.h"
|
||||
@@ -70,10 +69,10 @@ int _suggestedGuestMaximum;
|
||||
*/
|
||||
int _guestGenerationProbability;
|
||||
|
||||
sint16 *gParkEntranceX = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, sint16);
|
||||
sint16 *gParkEntranceY = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_Y, sint16);
|
||||
sint16 *gParkEntranceZ = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_Z, sint16);
|
||||
uint8 *gParkEntranceDirection = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_DIRECTION, uint8);
|
||||
sint16 gParkEntranceX[4];
|
||||
sint16 gParkEntranceY[4];
|
||||
sint16 gParkEntranceZ[4];
|
||||
uint8 gParkEntranceDirection[4];
|
||||
|
||||
bool gParkEntranceGhostExists;
|
||||
rct_xyz16 gParkEntranceGhostPosition;
|
||||
@@ -142,7 +141,6 @@ void park_init()
|
||||
gScenarioObjectiveNumGuests = 1000;
|
||||
gLandPrice = MONEY(90, 00);
|
||||
gConstructionRightsPrice = MONEY(40,00);
|
||||
RCT2_GLOBAL(0x01358774, uint16) = 0;
|
||||
gParkFlags = PARK_FLAGS_NO_MONEY | PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
|
||||
park_reset_history();
|
||||
finance_reset_history();
|
||||
@@ -364,13 +362,12 @@ money32 calculate_company_value()
|
||||
void reset_park_entrances()
|
||||
{
|
||||
gParkName = 0;
|
||||
|
||||
for (short i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
gParkEntranceX[i] = 0x8000;
|
||||
}
|
||||
|
||||
gPeepSpawns[0].x = UINT16_MAX;
|
||||
RCT2_GLOBAL(0x013573F8, uint16) = 0xFFFF;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
gPeepSpawns[i].x = UINT16_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1076,7 +1073,7 @@ static money32 map_buy_land_rights_for_tile(int x, int y, int setting, int flags
|
||||
update_park_fences(x + 32, y);
|
||||
update_park_fences(x, y + 32);
|
||||
update_park_fences(x, y - 32);
|
||||
RCT2_GLOBAL(0x9E2E28, uint8) |= 1;
|
||||
gUnk9E2E28 |= 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,10 +65,10 @@ extern uint8 gGuestsInParkHistory[32];
|
||||
extern int _guestGenerationProbability;
|
||||
extern int _suggestedGuestMaximum;
|
||||
|
||||
extern sint16 *gParkEntranceX;
|
||||
extern sint16 *gParkEntranceY;
|
||||
extern sint16 *gParkEntranceZ;
|
||||
extern uint8 *gParkEntranceDirection;
|
||||
extern sint16 gParkEntranceX[4];
|
||||
extern sint16 gParkEntranceY[4];
|
||||
extern sint16 gParkEntranceZ[4];
|
||||
extern uint8 gParkEntranceDirection[4];
|
||||
|
||||
extern bool gParkEntranceGhostExists;
|
||||
extern rct_xyz16 gParkEntranceGhostPosition;
|
||||
|
||||
Reference in New Issue
Block a user