mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 12:03:07 +01:00
Peeps no longer interact with provisional paths
In most cases peeps treaded provisional paths like paths that were already built. Since provisional paths aren't synced in muliplayer mode this caused a lot of desync.
This commit is contained in:
@@ -364,8 +364,11 @@ void game_logic_update()
|
||||
scenario_update();
|
||||
climate_update();
|
||||
map_update_tiles();
|
||||
// Temporarily remove provisional paths to prevent peep from interacting with them
|
||||
map_remove_provisional_elements();
|
||||
map_update_path_wide_flags();
|
||||
peep_update_all();
|
||||
map_restore_provisional_elements();
|
||||
vehicle_update_all();
|
||||
sprite_misc_update_all();
|
||||
ride_update_all();
|
||||
|
||||
@@ -34,6 +34,8 @@ void sub_6A7642(int x, int y, rct_map_element *mapElement);
|
||||
|
||||
uint8 gFootpathProvisionalFlags;
|
||||
rct_xyz16 gFootpathProvisionalPosition;
|
||||
uint8 gFootpathProvisionalType;
|
||||
uint8 gFootpathProvisionalSlope;
|
||||
uint8 gFootpathConstructionMode;
|
||||
uint16 gFootpathSelectedId;
|
||||
uint8 gFootpathSelectedType;
|
||||
@@ -614,9 +616,11 @@ money32 footpath_provisional_set(int type, int x, int y, int z, int slope)
|
||||
|
||||
cost = footpath_place(type, x, y, z, slope, GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_4 | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_APPLY);
|
||||
if (cost != MONEY32_UNDEFINED) {
|
||||
gFootpathProvisionalType = type;
|
||||
gFootpathProvisionalPosition.x = x;
|
||||
gFootpathProvisionalPosition.y = y;
|
||||
gFootpathProvisionalPosition.z = z & 0xFF;
|
||||
gFootpathProvisionalSlope = slope;
|
||||
gFootpathProvisionalFlags |= PROVISIONAL_PATH_FLAG_1;
|
||||
|
||||
if (gFootpathGroundFlags & ELEMENT_IS_UNDERGROUND) {
|
||||
|
||||
@@ -52,6 +52,8 @@ enum {
|
||||
|
||||
extern uint8 gFootpathProvisionalFlags;
|
||||
extern rct_xyz16 gFootpathProvisionalPosition;
|
||||
extern uint8 gFootpathProvisionalType;
|
||||
extern uint8 gFootpathProvisionalSlope;
|
||||
extern uint8 gFootpathConstructionMode;
|
||||
extern uint16 gFootpathSelectedId;
|
||||
extern uint8 gFootpathSelectedType;
|
||||
|
||||
@@ -4442,6 +4442,28 @@ static void map_set_grass_length(int x, int y, rct_map_element *mapElement, int
|
||||
map_invalidate_tile(x, y, z0, z1);
|
||||
}
|
||||
|
||||
void map_remove_provisional_elements()
|
||||
{
|
||||
if (gFootpathProvisionalFlags & PROVISIONAL_PATH_FLAG_1)
|
||||
{
|
||||
footpath_provisional_remove();
|
||||
gFootpathProvisionalFlags |= PROVISIONAL_PATH_FLAG_1;
|
||||
}
|
||||
}
|
||||
|
||||
void map_restore_provisional_elements()
|
||||
{
|
||||
if (gFootpathProvisionalFlags & PROVISIONAL_PATH_FLAG_1)
|
||||
{
|
||||
gFootpathProvisionalFlags &= ~PROVISIONAL_PATH_FLAG_1;
|
||||
footpath_provisional_set(gFootpathProvisionalType,
|
||||
gFootpathProvisionalPosition.x,
|
||||
gFootpathProvisionalPosition.y,
|
||||
gFootpathProvisionalPosition.z,
|
||||
gFootpathProvisionalSlope);
|
||||
}
|
||||
}
|
||||
|
||||
int map_element_get_banner_index(rct_map_element *mapElement)
|
||||
{
|
||||
rct_scenery_entry* sceneryEntry;
|
||||
|
||||
@@ -407,6 +407,8 @@ rct_map_element *map_get_small_scenery_element_at(int x, int y, int z, int type,
|
||||
int map_element_height(int x, int y);
|
||||
void sub_68B089();
|
||||
int map_coord_is_connected(int x, int y, int z, uint8 faceDirection);
|
||||
void map_remove_provisional_elements();
|
||||
void map_restore_provisional_elements();
|
||||
void map_update_path_wide_flags();
|
||||
bool map_is_location_valid(int x, int y);
|
||||
bool map_is_location_owned(int x, int y, int z);
|
||||
|
||||
Reference in New Issue
Block a user