mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
More fixes to not place obstacles on wall parts
This commit is contained in:
parent
cffc4b2ab5
commit
7618e294c2
@ -70,7 +70,8 @@ namespace SiegeStuffThatShouldBeMovedToHandlers // <=== TODO
|
||||
std::make_pair(45, EWallPart::INDESTRUCTIBLE_PART),
|
||||
std::make_pair(62, EWallPart::INDESTRUCTIBLE_PART),
|
||||
std::make_pair(112, EWallPart::INDESTRUCTIBLE_PART),
|
||||
std::make_pair(147, EWallPart::INDESTRUCTIBLE_PART)
|
||||
std::make_pair(147, EWallPart::INDESTRUCTIBLE_PART),
|
||||
std::make_pair(165, EWallPart::INDESTRUCTIBLE_PART)
|
||||
};
|
||||
|
||||
static EWallPart::EWallPart hexToWallPart(BattleHex hex)
|
||||
|
@ -430,15 +430,15 @@ bool ObstacleMechanics::isHexAviable(const CBattleInfoCallback * cb, const Battl
|
||||
{
|
||||
EWallPart::EWallPart part = cb->battleHexToWallPart(hex);
|
||||
|
||||
if(part != EWallPart::INVALID)
|
||||
{
|
||||
if(static_cast<int>(part) < 0)
|
||||
return false;//indestuctible part, cant be checked by battleGetWallState
|
||||
|
||||
if(cb->battleGetWallState(part) != EWallState::DESTROYED && cb->battleGetWallState(part) != EWallState::NONE)
|
||||
if(part == EWallPart::INVALID)
|
||||
return true;//no fortification here
|
||||
else if(static_cast<int>(part) < 0)
|
||||
return false;//indestuctible part (cant be checked by battleGetWallState)
|
||||
else if(part == EWallPart::BOTTOM_TOWER || part == EWallPart::UPPER_TOWER)
|
||||
return false;//destructible, but should not be available
|
||||
else if(cb->battleGetWallState(part) != EWallState::DESTROYED && cb->battleGetWallState(part) != EWallState::NONE)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user