Make PeepPickupAction *actually* take a CoordsXYZ

This commit is contained in:
Gymnasiast 2020-03-07 21:34:04 +01:00
parent 5dc4b3e136
commit 7759b54c2f
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
3 changed files with 4 additions and 4 deletions

View File

@ -1283,7 +1283,7 @@ void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex,
return;
PeepPickupAction pickupAction{
PeepPickupType::Place, w->number, { destCoords, tileElement->base_height }, network_get_current_player_id()
PeepPickupType::Place, w->number, { destCoords, tileElement->GetBaseZ() }, network_get_current_player_id()
};
pickupAction.SetCallback([](const GameAction* ga, const GameActionResult* result) {
if (result->Error != GA_ERROR::OK)

View File

@ -1198,7 +1198,7 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex,
return;
PeepPickupAction pickupAction{
PeepPickupType::Place, w->number, { destCoords, tileElement->base_height }, network_get_current_player_id()
PeepPickupType::Place, w->number, { destCoords, tileElement->GetBaseZ() }, network_get_current_player_id()
};
pickupAction.SetCallback([](const GameAction* ga, const GameActionResult* result) {
if (result->Error != GA_ERROR::OK)

View File

@ -104,7 +104,7 @@ public:
return MakeResult(GA_ERROR::UNKNOWN, STR_ERR_CANT_PLACE_PERSON_HERE);
}
if (!peep->Place({ _loc.x / 32, _loc.y / 32, _loc.z }, false))
if (!peep->Place(TileCoordsXYZ(_loc), false))
{
return MakeResult(GA_ERROR::UNKNOWN, STR_ERR_CANT_PLACE_PERSON_HERE, gGameCommandErrorText);
}
@ -174,7 +174,7 @@ public:
break;
case PeepPickupType::Place:
res->Position = _loc;
if (!peep->Place({ _loc.x / 32, _loc.y / 32, _loc.z }, true))
if (!peep->Place(TileCoordsXYZ(_loc), true))
{
return MakeResult(GA_ERROR::UNKNOWN, STR_ERR_CANT_PLACE_PERSON_HERE, gGameCommandErrorText);
}