1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +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

@@ -191,7 +191,7 @@ void CGameHandler::levelUpCommander (const CCommanderInstance * c, int skill)
{
SetCommanderProperty scp;
auto hero = dynamic_cast<const CGHeroInstance *>(c->armyObj);
auto hero = dynamic_cast<const CGHeroInstance *>(c->getArmy());
if (hero)
scp.heroid = hero->id;
else
@@ -281,7 +281,7 @@ void CGameHandler::levelUpCommander(const CCommanderInstance * c)
}
CommanderLevelUp clu;
auto hero = dynamic_cast<const CGHeroInstance *>(c->armyObj);
auto hero = dynamic_cast<const CGHeroInstance *>(c->getArmy());
if(hero)
{
clu.heroId = hero->id;
@@ -4287,7 +4287,7 @@ void CGameHandler::createWanderingMonster(const int3 & visitablePosition, Creatu
cre->character = 2;
cre->gainedArtifact = ArtifactID::NONE;
cre->identifier = -1;
cre->addToSlot(SlotID(0), std::make_unique<CStackInstance>(creature, -1)); //add placeholder stack
cre->addToSlot(SlotID(0), std::make_unique<CStackInstance>(gs->callback, creature, -1)); //add placeholder stack
newObject(createdObject, PlayerColor::NEUTRAL);
}