mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Fix peep pickup. Mistake made during refactor. (#11978)
PeepPickupAction assumed that all locations that are passed into the function would be valid locations or null locations. This is not the case when picking up as a dummy value is passed into the function. The caller was fixed by passing a null location as expected by PeepPickupAction.
This commit is contained in:
@@ -700,7 +700,9 @@ void window_guest_overview_mouse_up(rct_window* w, rct_widgetindex widgetIndex)
|
||||
return;
|
||||
}
|
||||
w->picked_peep_old_x = peep->x;
|
||||
PeepPickupAction pickupAction{ PeepPickupType::Pickup, w->number, {}, network_get_current_player_id() };
|
||||
CoordsXYZ nullLoc{};
|
||||
nullLoc.setNull();
|
||||
PeepPickupAction pickupAction{ PeepPickupType::Pickup, w->number, nullLoc, network_get_current_player_id() };
|
||||
pickupAction.SetCallback([peepnum = w->number](const GameAction* ga, const GameActionResult* result) {
|
||||
if (result->Error != GA_ERROR::OK)
|
||||
return;
|
||||
|
||||
@@ -460,8 +460,9 @@ void window_staff_overview_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
case WIDX_PICKUP:
|
||||
{
|
||||
w->picked_peep_old_x = peep->x;
|
||||
|
||||
PeepPickupAction pickupAction{ PeepPickupType::Pickup, w->number, {}, network_get_current_player_id() };
|
||||
CoordsXYZ nullLoc{};
|
||||
nullLoc.setNull();
|
||||
PeepPickupAction pickupAction{ PeepPickupType::Pickup, w->number, nullLoc, network_get_current_player_id() };
|
||||
pickupAction.SetCallback([peepnum = w->number](const GameAction* ga, const GameActionResult* result) {
|
||||
if (result->Error != GA_ERROR::OK)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user