1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

more accurate last player action location

This commit is contained in:
zsilencer
2016-01-24 21:00:31 -07:00
parent 74225ad4bc
commit 32f1aa064d
7 changed files with 244 additions and 17 deletions

View File

@@ -1518,11 +1518,6 @@ void Network::ProcessGameCommandQueue()
if (player) {
player->last_action = gNetworkActions.FindCommand(command);
player->last_action_time = SDL_GetTicks();
rct_xyz16 coord;
coord.x = RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16);
coord.y = RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16);
coord.z = RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16);
player->last_action_coord = coord;
player->AddMoneySpent(cost);
}
}
@@ -1802,11 +1797,6 @@ void Network::Server_Handle_GAMECMD(NetworkConnection& connection, NetworkPacket
connection.player->last_action = gNetworkActions.FindCommand(commandCommand);
connection.player->last_action_time = SDL_GetTicks();
rct_xyz16 coord;
coord.x = RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16);
coord.y = RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16);
coord.z = RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16);
connection.player->last_action_coord = coord;
connection.player->AddMoneySpent(cost);
Server_Send_GAMECMD(args[0], args[1], args[2], args[3], args[4], args[5], args[6], playerid, callback);
}
@@ -2030,7 +2020,9 @@ rct_xyz16 network_get_player_last_action_coord(unsigned int index)
void network_set_player_last_action_coord(unsigned int index, rct_xyz16 coord)
{
gNetwork.player_list[index]->last_action_coord = coord;
if (index >= 0 && index < gNetwork.player_list.size()) {
gNetwork.player_list[index]->last_action_coord = coord;
}
}
unsigned int network_get_player_commands_ran(unsigned int index)