mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Remove max mana info leak + tiny refactor
This commit is contained in:
parent
f621ef4ce8
commit
f9b5ca3374
@ -649,14 +649,14 @@ CHeroInfoWindow::CHeroInfoWindow(const InfoAboutHero &hero, Point *position) : C
|
||||
moveTo(*position);
|
||||
background->colorize(hero.owner); //maybe add this functionality to base class?
|
||||
|
||||
attack = hero.details->primskills[0];
|
||||
defense = hero.details->primskills[1];
|
||||
power = hero.details->primskills[2];
|
||||
knowledge = hero.details->primskills[3];
|
||||
morale = hero.details->morale;
|
||||
luck = hero.details->luck;
|
||||
currentSpellPoints = hero.details->mana;
|
||||
maxSpellPoints = hero.details->manaLimit;
|
||||
int attack = hero.details->primskills[0];
|
||||
int defense = hero.details->primskills[1];
|
||||
int power = hero.details->primskills[2];
|
||||
int knowledge = hero.details->primskills[3];
|
||||
int morale = hero.details->morale;
|
||||
int luck = hero.details->luck;
|
||||
int currentSpellPoints = hero.details->mana;
|
||||
int maxSpellPoints = hero.details->manaLimit;
|
||||
|
||||
new CAnimImage("PortraitsLarge", hero.portrait, 0, 10, 6);
|
||||
|
||||
|
@ -74,16 +74,6 @@ class CHeroInfoWindow : public CWindowObject
|
||||
{
|
||||
public:
|
||||
CHeroInfoWindow(const InfoAboutHero &hero, Point *position);
|
||||
|
||||
private:
|
||||
int attack;
|
||||
int defense;
|
||||
int power;
|
||||
int knowledge;
|
||||
int morale;
|
||||
int luck;
|
||||
int currentSpellPoints;
|
||||
int maxSpellPoints;
|
||||
};
|
||||
|
||||
/// Class which manages the battle options window
|
||||
|
@ -292,6 +292,9 @@ bool CGameInfoCallback::getHeroInfo(const CGObjectInstance * hero, InfoAboutHero
|
||||
|
||||
dest.initFromHero(h, accessFlag);
|
||||
|
||||
if (accessFlag && !gs->curB)
|
||||
dest.details->manaLimit = -1; //we do not want to leak max mana info outside battle so set to meaningless value
|
||||
|
||||
//DISGUISED bonus implementation
|
||||
|
||||
if(getPlayerRelations(getLocalPlayer(), hero->tempOwner) == PlayerRelations::ENEMIES)
|
||||
|
Loading…
Reference in New Issue
Block a user