Some tweaks so its harder to get npcs intentionally stuck

This commit is contained in:
KimLS
2018-05-20 17:24:00 -07:00
parent 80c7643396
commit f46e4f9aa4
2 changed files with 11 additions and 4 deletions
+8 -1
View File
@@ -931,7 +931,9 @@ bool Mob::CombatRange(Mob* other)
if (size_mod > 10000)
size_mod = size_mod / 7;
float _DistNoRoot = DistanceSquared(m_Position, other->GetPosition());
float _DistNoRoot = DistanceSquaredNoZ(m_Position, other->GetPosition());
float _zDist = m_Position.z - other->GetZ();
_zDist *= _zDist;
if (GetSpecialAbility(NPC_CHASE_DISTANCE)){
@@ -960,6 +962,11 @@ bool Mob::CombatRange(Mob* other)
if (_DistNoRoot <= size_mod)
{
//A hack to kill an exploit till we get something better.
if (flymode == 0 && _zDist > 500 && !CheckLastLosState()) {
return false;
}
return true;
}
return false;