mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 13:33:02 +01:00
Create update_park_fences_around_tile
This commit is contained in:
committed by
Michael Steenbeek
parent
36ca5b30ac
commit
f2d7c0bbaa
@@ -148,11 +148,7 @@ static money32 ParkEntrancePlace(sint32 flags, sint16 x, sint16 y, uint8 z, uint
|
||||
footpath_connect_edges(x, y, newElement, 1);
|
||||
}
|
||||
|
||||
update_park_fences(x, y);
|
||||
update_park_fences(x - 32, y);
|
||||
update_park_fences(x + 32, y);
|
||||
update_park_fences(x, y - 32);
|
||||
update_park_fences(x, y + 32);
|
||||
update_park_fences_around_tile(x, y);
|
||||
|
||||
map_invalidate_tile(x, y, newElement->base_height * 8, newElement->clearance_height * 8);
|
||||
|
||||
|
||||
@@ -774,6 +774,15 @@ void update_park_fences(sint32 x, sint32 y)
|
||||
}
|
||||
}
|
||||
|
||||
void update_park_fences_around_tile(sint32 x, sint32 y)
|
||||
{
|
||||
update_park_fences(x, y);
|
||||
update_park_fences(x + 32, y);
|
||||
update_park_fences(x - 32, y);
|
||||
update_park_fences(x, y + 32);
|
||||
update_park_fences(x, y - 32);
|
||||
}
|
||||
|
||||
void park_set_name(const char *name)
|
||||
{
|
||||
gGameCommandErrorTitle = STR_CANT_RENAME_PARK;
|
||||
@@ -860,21 +869,13 @@ static money32 map_buy_land_rights_for_tile(sint32 x, sint32 y, sint32 setting,
|
||||
}
|
||||
if (flags & GAME_COMMAND_FLAG_APPLY) {
|
||||
surfaceElement->properties.surface.ownership |= OWNERSHIP_OWNED;
|
||||
update_park_fences(x, y);
|
||||
update_park_fences(x - 32, y);
|
||||
update_park_fences(x + 32, y);
|
||||
update_park_fences(x, y + 32);
|
||||
update_park_fences(x, y - 32);
|
||||
update_park_fences_around_tile(x, y);
|
||||
}
|
||||
return gLandPrice;
|
||||
case 1:
|
||||
if (flags & GAME_COMMAND_FLAG_APPLY) {
|
||||
surfaceElement->properties.surface.ownership &= ~(OWNERSHIP_OWNED | OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED);
|
||||
update_park_fences(x, y);
|
||||
update_park_fences(x - 32, y);
|
||||
update_park_fences(x + 32, y);
|
||||
update_park_fences(x, y + 32);
|
||||
update_park_fences(x, y - 32);
|
||||
update_park_fences_around_tile(x, y);
|
||||
}
|
||||
return 0;
|
||||
case 2:
|
||||
@@ -958,11 +959,7 @@ static money32 map_buy_land_rights_for_tile(sint32 x, sint32 y, sint32 setting,
|
||||
}
|
||||
surfaceElement->properties.surface.ownership &= 0x0F;
|
||||
surfaceElement->properties.surface.ownership |= newOwnership;
|
||||
update_park_fences(x, y);
|
||||
update_park_fences(x - 32, y);
|
||||
update_park_fences(x + 32, y);
|
||||
update_park_fences(x, y + 32);
|
||||
update_park_fences(x, y - 32);
|
||||
update_park_fences_around_tile(x, y);
|
||||
gUnk9E2E28 |= 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ rct_peep * park_generate_new_guest();
|
||||
void park_update();
|
||||
void park_update_histories();
|
||||
void update_park_fences(sint32 x, sint32 y);
|
||||
void update_park_fences_around_tile(sint32 x, sint32 y);
|
||||
|
||||
uint8 calculate_guest_initial_happiness(uint8 percentage);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user