1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-15 13:33:36 +02:00

Fixed a bug in phoenix code. Fixed a couple warnings.

This commit is contained in:
Frank Zago 2011-07-09 22:42:39 +00:00
parent 5269e845fd
commit 9c3a10b2c7
3 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@
*
*/
class Bonus;
struct Bonus;
class CCreature;
class CStackInstance;
class CStack;

View File

@ -2504,7 +2504,7 @@ void CStack::prepareAttacked(BattleStackAttacked &bsa) const
resurrectedCount += ((base->count % resurrectedCount) * resurrectFactor / 100.0f) > ran()%100 ? 1 : 0; //last stack has proportional chance to rebirth
else //only one unit
resurrectedCount += (base->count * resurrectFactor / 100.0f) > ran()%100 ? 1 : 0;
if (hasBonusOfType(Bonus::REBIRTH, 1));
if (hasBonusOfType(Bonus::REBIRTH, 1))
amax (resurrectedCount, 1); //resurrect at least one Sacred Phoenix
if (resurrectedCount)
{

View File

@ -100,7 +100,7 @@ struct DLL_EXPORT BattleInfo : public CBonusSystemNode
ui32 calculateSpellDmg(const CSpell * sp, const CGHeroInstance * caster, const CStack * affectedCreature, int spellSchoolLevel, int usedSpellPower) const; //calculates damage inflicted by spell
ui32 calculateHealedHP(const CGHeroInstance * caster, const CSpell * spell, const CStack * stack) const;
ui32 calculateHealedHP(int healedHealth, const CSpell * spell, const CStack * stack) const; //for Archangel
ui32 BattleInfo::calculateHealedHP(const CSpell * spell, int usedSpellPower, int spellSchoolLevel, const CStack * stack) const; //unused
ui32 calculateHealedHP(const CSpell * spell, int usedSpellPower, int spellSchoolLevel, const CStack * stack) const; //unused
bool resurrects(TSpell spellid) const; //TODO: move it to spellHandler?
si8 hasDistancePenalty(const CStack * stackID, THex destHex) const; //determines if given stack has distance penalty shooting given pos
si8 sameSideOfWall(int pos1, int pos2) const; //determines if given positions are on the same side of wall