mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
vcmi: specialize native terrain entity
Specialize native terrain entity for all object that have native terrain. Allow creatures to take global bonuses into account when checking for native terrain.
This commit is contained in:
@ -78,7 +78,7 @@ void CStack::localInit(BattleInfo * battleInfo)
|
||||
attachTo(*army);
|
||||
attachTo(const_cast<CCreature&>(*type));
|
||||
}
|
||||
nativeTerrain = type->getNativeTerrain(); //save nativeTerrain in the variable on the battle start to avoid dead lock
|
||||
nativeTerrain = getNativeTerrain(); //save nativeTerrain in the variable on the battle start to avoid dead lock
|
||||
CUnitState::localInit(this); //it causes execution of the CStack::isOnNativeTerrain where nativeTerrain will be considered
|
||||
position = initialPosition;
|
||||
}
|
||||
@ -338,6 +338,11 @@ int32_t CStack::unitBaseAmount() const
|
||||
return baseAmount;
|
||||
}
|
||||
|
||||
const IBonusBearer* CStack::getBonusBearer() const
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
bool CStack::unitHasAmmoCart(const battle::Unit * unit) const
|
||||
{
|
||||
for(const CStack * st : battle->stacks)
|
||||
|
Reference in New Issue
Block a user