Ver código fonte

Fix manaGain animation always showing

AlexVinS 11 anos atrás
pai
commit
6893509f65
4 arquivos alterados com 11 adições e 3 exclusões
  1. 1 1
      client/battle/CBattleInterface.cpp
  2. 8 0
      lib/CSpellHandler.cpp
  3. 1 1
      lib/CSpellHandler.h
  4. 1 1
      lib/NetPacks.h

+ 1 - 1
client/battle/CBattleInterface.cpp

@@ -1466,7 +1466,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc )
 	}
 	waitForAnims();
 	//mana absorption
-	if (sc->manaGained)
+	if(sc->manaGained > 0)
 	{
 		Point leftHero = Point(15, 30) + pos;
 		Point rightHero = Point(755, 30) + pos;

+ 8 - 0
lib/CSpellHandler.cpp

@@ -69,6 +69,14 @@ namespace SpellConfig
 	};	
 }
 
+BattleSpellCastParameters::BattleSpellCastParameters(const BattleInfo* cb)
+	: spellLvl(0), destination(BattleHex::INVALID), casterSide(0),casterColor(PlayerColor::CANNOT_DETERMINE),caster(nullptr), secHero(nullptr),
+	usedSpellPower(0),mode(ECastingMode::HERO_CASTING), casterStack(nullptr), selectedStack(nullptr), cb(cb)
+{
+	
+}
+
+
 ///CSpell::LevelInfo
 CSpell::LevelInfo::LevelInfo()
 	:description(""),cost(0),power(0),AIValue(0),smartTarget(true), clearTarget(false), clearAffected(false), range("0")

+ 1 - 1
lib/CSpellHandler.h

@@ -59,7 +59,7 @@ public:
 struct DLL_LINKAGE BattleSpellCastParameters
 {
 public:
-	BattleSpellCastParameters(const BattleInfo * cb): cb(cb){};
+	BattleSpellCastParameters(const BattleInfo * cb);
 	int spellLvl;
 	BattleHex destination;
 	ui8 casterSide;

+ 1 - 1
lib/NetPacks.h

@@ -1456,7 +1456,7 @@ struct BattleSpellCast : public CPackForClient//3009
 	bool castedByHero; //if true - spell has been casted by hero, otherwise by a creature
 	template <typename Handler> void serialize(Handler &h, const int version)
 	{
-		h & dmgToDisplay & side & id & skill & tile & resisted & affectedCres & attackerType & castedByHero;
+		h & dmgToDisplay & side & id & skill & manaGained & tile & resisted & affectedCres & attackerType & castedByHero;
 	}
 };