Revert changes to melee push until the generic push processing is better

This commit is contained in:
Michael Cook (mackal) 2018-03-08 12:57:40 -05:00
parent 736890119b
commit 49089f7537

View File

@ -3622,10 +3622,24 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
a->force = 0.0f; // 2013 change that disabled NPC vs NPC push a->force = 0.0f; // 2013 change that disabled NPC vs NPC push
else else
a->force *= 0.10f; // force against NPCs is divided by 10 I guess? ex bash is 0.3, parsed 0.03 against an NPC a->force *= 0.10f; // force against NPCs is divided by 10 I guess? ex bash is 0.3, parsed 0.03 against an NPC
if (ForcedMovement == 0 && a->force != 0.0f && position_update_melee_push_timer.Check()) { }
m_Delta.x += a->force * g_Math.FastSin(a->hit_heading); // update NPC stuff
m_Delta.y += a->force * g_Math.FastCos(a->hit_heading); if (a->force != 0.0f) {
ForcedMovement = 3; auto new_pos = glm::vec3(
m_Position.x + (a->force * g_Math.FastSin(a->hit_heading) + m_Delta.x),
m_Position.y + (a->force * g_Math.FastCos(a->hit_heading) + m_Delta.y), m_Position.z);
if ((!IsNPC() || position_update_melee_push_timer.Check()) && zone->zonemap &&
zone->zonemap->CheckLoS(
glm::vec3(m_Position),
new_pos)) { // If we have LoS on the new loc it should be reachable.
if (IsNPC()) {
// Is this adequate?
Teleport(new_pos);
SendPositionUpdate();
}
} else {
a->force = 0.0f; // we couldn't move there, so lets not
} }
} }
} }