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

This commit is contained in:
ζeh Matt authored and Michał Janiszewski committed 2018-12-05 07:39:57 +01:00
1 parent c845924956
commit 2da01caa1e
1 file changed
+5 -2
+5 -2
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);
}
}
}