1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

vcmi: massive refactoring v1

This commit is contained in:
Konstantin
2023-04-05 03:26:29 +03:00
parent ee489f18d2
commit 11b237a23c
129 changed files with 803 additions and 762 deletions

View File

@ -88,7 +88,7 @@ ui32 CStack::level() const
if(base)
return base->getLevel(); //creature or commander
else
return std::max(1, static_cast<int>(getCreature()->level)); //war machine, clone etc
return std::max(1, static_cast<int>(getCreature()->getLevel())); //war machine, clone etc
}
si32 CStack::magicResistance() const
@ -342,7 +342,7 @@ bool CStack::unitHasAmmoCart(const battle::Unit * unit) const
{
for(const CStack * st : battle->stacks)
{
if(battle->battleMatchOwner(st, unit, true) && st->getCreature()->idNumber == CreatureID::AMMO_CART)
if(battle->battleMatchOwner(st, unit, true) && st->getCreature()->getId() == CreatureID::AMMO_CART)
{
return st->alive();
}