Fix #4852: Clicking on the hook icon for a person does not return it to the original location (#4854)

This commit is contained in:
Yaroslav Tretyakov 2016-12-07 14:28:55 -07:00 committed by Michael Steenbeek
parent 1dd2751f4a
commit 51fcfe3379
2 changed files with 12 additions and 3 deletions

View File

@ -55,7 +55,7 @@ extern "C" {
// This define specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "19"
#define NETWORK_STREAM_VERSION "20"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
#ifdef __cplusplus

View File

@ -19,6 +19,7 @@
#include "../cheats.h"
#include "../config.h"
#include "../game.h"
#include "../input.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../management/finance.h"
@ -2006,9 +2007,17 @@ bool peep_pickup_command(unsigned int peepnum, int x, int y, int z, int action,
if (!peep_can_be_picked_up(peep)) {
return false;
}
if (network_get_pickup_peep(game_command_playerid)) {
rct_peep* existing = network_get_pickup_peep(game_command_playerid);
if (existing) {
// already picking up a peep
return false;
bool result = peep_pickup_command(existing->sprite_index, network_get_pickup_peep_old_x(game_command_playerid), 0, 0, 1, apply);
if (existing == peep) {
return result;
}
if (game_command_playerid == network_get_current_player_id()) {
// prevent tool_cancel()
gInputFlags &= ~INPUT_FLAG_TOOL_ACTIVE;
}
}
if (apply) {
network_set_pickup_peep(game_command_playerid, peep);