Explorar o código

BattleInfo: update bonus tree when unit is moved

This is a semi-dirty hack to force uncaching a bonuses with
UnitOnHexLimiter
Konstantin %!s(int64=2) %!d(string=hai) anos
pai
achega
847437bbfa
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      lib/battle/BattleInfo.cpp

+ 3 - 0
lib/battle/BattleInfo.cpp

@@ -740,6 +740,9 @@ void BattleInfo::moveUnit(uint32_t id, BattleHex destination)
 		return;
 	}
 	sta->position = destination;
+	//Bonuses can be limited by unit placement, so, change tree version 
+	//to force updating a bonus. TODO: update version only when such bonuses are present
+	CBonusSystemNode::treeHasChanged();
 }
 
 void BattleInfo::setUnitState(uint32_t id, const JsonNode & data, int64_t healthDelta)