mirror of https://github.com/OpenRCT2/OpenRCT2.git
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:
parent
e2b187c24a
commit
33298d2bde
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue