Merge branch 'master' into auras

This commit is contained in:
Michael Cook (mackal)
2017-07-16 12:39:06 -04:00
4 changed files with 32 additions and 8 deletions
+3 -1
View File
@@ -1001,7 +1001,7 @@ void Mob::AI_Process() {
if (this->GetTarget()) {
/* If we are engaged, moving and following client, let's look for best Z more often */
float target_distance = DistanceNoZ(this->GetPosition(), this->GetTarget()->GetPosition());
if (target_distance >= 50) {
if (target_distance >= 25) {
this->FixZ();
}
else if (!this->CheckLosFN(this->GetTarget())) {
@@ -1573,6 +1573,8 @@ void NPC::AI_DoMovement() {
SetHeading(m_CurrentWayPoint.w);
}
this->FixZ();
SendPosition();
//kick off event_waypoint arrive
+2 -1
View File
@@ -849,6 +849,7 @@ void Mob::FixZ() {
{
/* Any more than 5 in the offset makes NPC's hop/snap to ceiling in small corridors */
float new_z = this->FindGroundZ(m_Position.x, m_Position.y, 5);
new_z += (this->GetSize() / 1.55);
auto duration = timer.elapsed();
@@ -864,7 +865,7 @@ void Mob::FixZ() {
duration
);
if ((new_z > -2000) && std::abs(m_Position.z - new_z) < 35) {
if ((new_z > -2000) && new_z != -999999) {
if (RuleB(Map, MobZVisualDebug))
this->SendAppearanceEffect(78, 0, 0, 0, 0);