mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
Add the Fast trig functions that work with EQ headings
This should match pretty close to the clients LUTs Also fixed a bug with push
This commit is contained in:
+5
-3
@@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "worldserver.h"
|
||||
#include "zone.h"
|
||||
#include "lua_parser.h"
|
||||
#include "fastmath.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
@@ -43,6 +44,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
extern QueryServ* QServ;
|
||||
extern WorldServer worldserver;
|
||||
extern FastMath g_Math;
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#define snprintf _snprintf
|
||||
@@ -3624,9 +3626,9 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
|
||||
// update NPC stuff
|
||||
if (a->force != 0.0f) {
|
||||
auto new_pos = glm::vec3(
|
||||
m_Position.x + (a->force * std::cos(a->hit_heading) + m_Delta.x),
|
||||
m_Position.y + (a->force * std::sin(a->hit_heading) + m_Delta.y), m_Position.z);
|
||||
if ((IsNPC() && position_update_melee_push_timer.Check()) && zone->zonemap &&
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user