Selaa lähdekoodia

Fix RemoveBonus::applyGs
* use CBonusSystemNode::removeBonus instead of direct modification of _cashe_

AlexVinS 10 vuotta sitten
vanhempi
sitoutus
a2901cb8f0
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      lib/NetPacksLib.cpp

+ 2 - 2
lib/NetPacksLib.cpp

@@ -328,7 +328,7 @@ DLL_LINKAGE void RemoveBonus::applyGs( CGameState *gs )
 	else
 		node = gs->getPlayer(PlayerColor(whoID));
 
-	BonusList &bonuses = node->getBonusList();
+	BonusList &bonuses = node->getExportedBonusList();
 
 	for (int i = 0; i < bonuses.size(); i++)
 	{
@@ -336,7 +336,7 @@ DLL_LINKAGE void RemoveBonus::applyGs( CGameState *gs )
 		if(b->source == source && b->sid == id)
 		{
 			bonus = *b; //backup bonus (to show to interfaces later)
-			bonuses.erase(i);
+			node->removeBonus(b);			
 			break;
 		}
 	}