Good afternoon everyone!
I have this bug fixed in my distro 8.6 and am trying to solve at TFS 1.2.
Follow code in TFS 1.2:
tile.cpp
Follow code in otx 8.6:
tile.cpp
ps: It seems to me, a new variable was added, hasRecentBattle.
monster.h
monster.cpp
Does anyone have any idea how to solve?
Thank you in advance!
I have this bug fixed in my distro 8.6 and am trying to solve at TFS 1.2.
Follow code in TFS 1.2:
tile.cpp
Code:
if (field && !field->isBlocking()) {
CombatType_t combatType = field->getCombatType();
//There is 3 options for a monster to enter a magic field
//1) Monster is immune
if (!monster->isImmune(combatType)) {
//1) Monster is "strong" enough to handle the damage
//2) Monster is already afflicated by this type of condition
if (hasBitSet(FLAG_IGNOREFIELDDAMAGE, flags)) {
if (!(monster->canPushItems() || monster->hasCondition(Combat::DamageToConditionType(combatType)))) {
return RETURNVALUE_NOTPOSSIBLE;
}
} else {
return RETURNVALUE_NOTPOSSIBLE;
}
}
}
Follow code in otx 8.6:
tile.cpp
Code:
CombatType_t combatType = field->getCombatType();
//There is 3 options for a monster to enter a magic field
//1) Monster is immune
if(monster->isImmune(combatType))
return RET_NOERROR;
//1) Monster is "strong" enough to handle the damage
//2) Monster is already afflicated by this type of condition
if(!hasBitSet(FLAG_IGNOREFIELDDAMAGE, flags))
return RET_NOTPOSSIBLE;
return !monster->hasCondition(Combat::DamageToConditionType(combatType), -1, false) &&
(!monster->canPushItems() || !monster->hasRecentBattle()) ? RET_NOTPOSSIBLE : RET_NOERROR;
monster.h
Code:
bool hasRecentBattle() const {return lastDamage && (uint64_t)OTSYS_TIME() < (lastDamage + 30000);}
monster.cpp
Code:
void Monster::changeHealth(int32_t healthChange)
{
//In case a player with ignore flag set attacks the monster
setIdle(false);
if(!hasRecentBattle())
{
lastDamage = OTSYS_TIME();
updateMapCache();
}
Creature::changeHealth(healthChange);
}
Does anyone have any idea how to solve?
Thank you in advance!