From 2fdc53594bf66620686ab13daa26ae7e7a202248 Mon Sep 17 00:00:00 2001 From: mateuszb Date: Fri, 29 Jan 2010 16:35:05 +0000 Subject: [PATCH] * fix for #123 (I hope) --- hch/CObjectHandler.h | 2 +- lib/NetPacks.h | 3 ++- lib/NetPacksLib.cpp | 2 ++ server/CGameHandler.cpp | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hch/CObjectHandler.h b/hch/CObjectHandler.h index 8d3dcb96b..810081bf9 100644 --- a/hch/CObjectHandler.h +++ b/hch/CObjectHandler.h @@ -306,7 +306,7 @@ public: static int3 convertPosition(int3 src, bool toh3m); //toh3m=true: manifest->h3m; toh3m=false: h3m->manifest double getHeroStrength() const; int getTotalStrength() const; - ui8 getSpellSchoolLevel(const CSpell * spell) const; //returns level on which given spell would be cast by this hero + ui8 getSpellSchoolLevel(const CSpell * spell) const; //returns level on which given spell would be cast by this hero (0 - none, 1 - basic etc) bool canCastThisSpell(const CSpell * spell) const; //determines if this hero can cast given spell; takes into account existing spell in spellbook, existing spellbook and artifact bonuses std::pair calculateNecromancy (const BattleResult &battleResult) const; void showNecromancyDialog (std::pair raisedStack) const; diff --git a/lib/NetPacks.h b/lib/NetPacks.h index afb1c239c..03c878058 100644 --- a/lib/NetPacks.h +++ b/lib/NetPacks.h @@ -1000,9 +1000,10 @@ struct StacksHealedOrResurrected : public CPackForClient //3013 { ui32 stackID; ui32 healedHP; + ui8 lowLevelResurrection; //in case this stack is resurrected by this heal, it will be marked as SUMMONED template void serialize(Handler &h, const int version) { - h & stackID & healedHP; + h & stackID & healedHP & lowLevelResurrection; } }; diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index 3e50f133a..9bf7a14a7 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -1045,6 +1045,8 @@ DLL_EXPORT void StacksHealedOrResurrected::applyGs( CGameState *gs ) if(!changedStack->alive()) { changedStack->state.insert(ALIVE); + if(healedStacks[g].lowLevelResurrection) + changedStack->features.push_back( makeFeature(StackFeature::SUMMONED, StackFeature::WHOLE_BATTLE, 0, 0, StackFeature::BONUS_FROM_HERO) ); } int missingHPfirst = changedStack->MaxHealth() - changedStack->firstHPleft; int res = std::min( healedStacks[g].healedHP / changedStack->MaxHealth() , changedStack->baseAmount - changedStack->amount ); diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 19223280f..7af8aa726 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -3184,6 +3184,7 @@ bool CGameHandler::makeCustomAction( BattleAction &ba ) StacksHealedOrResurrected::HealInfo hi; hi.stackID = (*it)->ID; hi.healedHP = calculateHealedHP(h, s, *it); + hi.lowLevelResurrection = h->getSpellSchoolLevel(s) <= 1; shr.healedStacks.push_back(hi); } if(!shr.healedStacks.empty())