From a8cf6381da17ef32a06f4c798f5b21c7724a4f10 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Thu, 21 Feb 2019 16:04:26 +0000 Subject: [PATCH] Make changes for set last network position change --- src/openrct2/actions/TrackRemoveAction.hpp | 27 +++++----------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/openrct2/actions/TrackRemoveAction.hpp b/src/openrct2/actions/TrackRemoveAction.hpp index 98c461dc64..b051995eac 100644 --- a/src/openrct2/actions/TrackRemoveAction.hpp +++ b/src/openrct2/actions/TrackRemoveAction.hpp @@ -59,8 +59,6 @@ public: res->Position.z = _origin.z; res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION; - int16_t trackpieceZ = _origin.z; - // Stations require some massaging of the track type for comparing auto comparableTrackType = _trackType; switch (_trackType) @@ -145,6 +143,9 @@ public: startLoc.x -= trackLoc.x; startLoc.y -= trackLoc.y; startLoc.z -= trackBlock->z; + res->Position.x = startLoc.x; + res->Position.y = startLoc.y; + res->Position.z = startLoc.z; money32 cost = 0; @@ -160,8 +161,6 @@ public: map_invalidate_tile_full(mapLoc.x, mapLoc.y); - trackpieceZ = mapLoc.z; - found = false; tileElement = map_get_first_element_at(mapLoc.x / 32, mapLoc.y / 32); do @@ -249,12 +248,6 @@ public: else price *= -10; - LocationXYZ16 coord; - coord.x = startLoc.x + 16; - coord.y = startLoc.y + 16; - coord.z = trackpieceZ; - network_set_player_last_action_coord(network_get_player_index(game_command_playerid), coord); - res->Cost = price; return res; } @@ -267,8 +260,6 @@ public: res->Position.z = _origin.z; res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION; - int16_t trackpieceZ = _origin.z; - // Stations require some massaging of the track type for comparing auto comparableTrackType = _trackType; switch (_trackType) @@ -348,7 +339,9 @@ public: startLoc.x -= trackLoc.x; startLoc.y -= trackLoc.y; startLoc.z -= trackBlock->z; - + res->Position.x = startLoc.x; + res->Position.y = startLoc.y; + res->Position.z = startLoc.z; money32 cost = 0; trackBlock = get_track_def_from_ride(ride, trackType); @@ -363,8 +356,6 @@ public: map_invalidate_tile_full(mapLoc.x, mapLoc.y); - trackpieceZ = mapLoc.z; - found = false; tileElement = map_get_first_element_at(mapLoc.x / 32, mapLoc.y / 32); do @@ -515,12 +506,6 @@ public: else price *= -10; - LocationXYZ16 coord; - coord.x = startLoc.x + 16; - coord.y = startLoc.y + 16; - coord.z = trackpieceZ; - network_set_player_last_action_coord(network_get_player_index(game_command_playerid), coord); - res->Cost = price; return res; }