mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-14 14:44:55 +02:00
fix monsters to not walk on fields when aggresive if they cannot push items
This commit is contained in:
14
src/tile.cpp
14
src/tile.cpp
@@ -521,6 +521,20 @@ ReturnValue Tile::queryAdd(int32_t, const Thing& thing, uint32_t, uint32_t flags
|
||||
}
|
||||
}
|
||||
|
||||
if (monster->hasCondition(CONDITION_AGGRESSIVE) && !monster->canPushItems()) {
|
||||
if (hasFlag(TILESTATE_FIREDAMAGE) && !monster->isImmune(COMBAT_FIREDAMAGE)) {
|
||||
return RETURNVALUE_NOTPOSSIBLE;
|
||||
}
|
||||
|
||||
if (hasFlag(TILESTATE_POISONDAMAGE) && !monster->isImmune(COMBAT_EARTHDAMAGE)) {
|
||||
return RETURNVALUE_NOTPOSSIBLE;
|
||||
}
|
||||
|
||||
if (hasFlag(TILESTATE_ENERGYDAMAGE) && !monster->isImmune(COMBAT_ENERGYDAMAGE)) {
|
||||
return RETURNVALUE_NOTPOSSIBLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!monster->hasCondition(CONDITION_AGGRESSIVE) &&
|
||||
!hasBitSet(FLAG_IGNOREFIELDDAMAGE, flags)) {
|
||||
if (hasFlag(TILESTATE_FIREDAMAGE) && !monster->isImmune(COMBAT_FIREDAMAGE)) {
|
||||
|
Reference in New Issue
Block a user