mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-20 23:11:56 -04:00
Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts: sql/base/characters_database.sql src/server/game/Entities/Player/Player.cpp src/server/game/Handlers/CharacterHandler.cpp
This commit is contained in:
@@ -1708,6 +1708,11 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const
|
||||
float dy = y - GetPositionY();
|
||||
float dz = z - GetPositionZ();
|
||||
float dist = sqrt(dx*dx + dy*dy);
|
||||
//! Check if the distance between the 2 objects is 0, can happen if both objects are on the same position.
|
||||
//! The code below this check wont crash if dist is 0 because 0/0 in float operations is valid, and returns infinite
|
||||
if (G3D::fuzzyEq(dist, 0.0f))
|
||||
return true;
|
||||
|
||||
float sinB = dx / dist;
|
||||
float cosB = dy / dist;
|
||||
dx = dist * (cosA * cosB + sinA * sinB);
|
||||
|
||||
Reference in New Issue
Block a user