1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Fix #8338: GAs using player id instead of index to log money spent. (#8361)

This commit is contained in:
ζeh Matt
2018-12-05 07:39:57 +01:00
committed by Michał Janiszewski
parent c845924956
commit 2da01caa1e

View File

@@ -253,10 +253,13 @@ namespace GameActions
{
NetworkPlayerId_t playerId = action->GetPlayer();
network_set_player_last_action(network_get_player_index(playerId.id), action->GetType());
int32_t playerIndex = network_get_player_index(playerId.id);
Guard::Assert(playerIndex != -1);
network_set_player_last_action(playerIndex, action->GetType());
if (result->Cost != 0)
{
network_add_player_money_spent(playerId.id, result->Cost);
network_add_player_money_spent(playerIndex, result->Cost);
}
}
}