1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Removed pointer to army from StackInstance

This commit is contained in:
Ivan Savenko
2025-03-18 23:30:06 +00:00
parent 16a06179cf
commit 63d00b080e
80 changed files with 260 additions and 280 deletions

View File

@ -17,6 +17,7 @@
#include "texts/CGeneralTextHandler.h"
#include "battle/BattleInfo.h"
#include "GameLibrary.h"
#include "spells/CSpellHandler.h"
#include "networkPacks/PacksForClientBattle.h"
@ -151,7 +152,7 @@ CStack::~CStack()
const CGHeroInstance * CStack::getMyHero() const
{
if(base)
return dynamic_cast<const CGHeroInstance *>(base->armyObj);
return dynamic_cast<const CGHeroInstance *>(base->getArmy());
else //we are attached directly?
for(const CBonusSystemNode * n : getParentNodes())
if(n->getNodeType() == HERO)
@ -171,8 +172,8 @@ std::string CStack::nodeName() const
oss << "[UNDEFINED TYPE]";
oss << " from slot " << slot;
if(base && base->armyObj)
oss << " of armyobj=" << base->armyObj->id.getNum();
if(base && base->getArmy())
oss << " of armyobj=" << base->getArmy()->id.getNum();
return oss.str();
}