forked from rosebudai/OpenRCT2-Web
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:
1 parent
e2b187c24a
commit
33298d2bde
2 files changed
+6
-3
No files matched your search
@@ -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