Core/Spells: Blink wont be able to trespass solid objects anymore (walls/doors)
Refactored some code Signed-off-by: Subv <s.v.h21@hotmail.com>
This commit is contained in:
1 parent
1fc3470233
commit
ff9830c18d
6 files changed
+90
-11
No files matched your search
@@ -2671,7 +2671,7 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
|
||||
{
|
||||
angle += m_orientation;
|
||||
float destx, desty, destz, ground, floor;
|
||||
|
||||
pos.m_positionZ += 2.0f;
|
||||
destx = pos.m_positionX + dist * cos(angle);
|
||||
desty = pos.m_positionY + dist * sin(angle);
|
||||
ground = GetMap()->GetHeight(GetPhaseMask(), destx, desty, MAX_HEIGHT, true);
|
||||
@@ -2689,6 +2689,17 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
|
||||
dist = sqrt((pos.m_positionX - destx)*(pos.m_positionX - destx) + (pos.m_positionY - desty)*(pos.m_positionY - desty));
|
||||
}
|
||||
|
||||
// check dynamic collision
|
||||
col = GetMap()->getObjectHitPos(GetPhaseMask(), pos.m_positionX, pos.m_positionY, pos.m_positionZ+0.5f, destx, desty, destz+0.5f, destx, desty, destz, -0.5f);
|
||||
|
||||
// Collided with a gameobject
|
||||
if (col)
|
||||
{
|
||||
destx -= CONTACT_DISTANCE * cos(angle);
|
||||
desty -= CONTACT_DISTANCE * sin(angle);
|
||||
dist = sqrt((pos.m_positionX - destx)*(pos.m_positionX - destx) + (pos.m_positionY - desty)*(pos.m_positionY - desty));
|
||||
}
|
||||
|
||||
float step = dist/10.0f;
|
||||
|
||||
for (uint8 j = 0; j < 10; ++j)
|
||||
@@ -2712,7 +2723,7 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
|
||||
|
||||
Trinity::NormalizeMapCoord(pos.m_positionX);
|
||||
Trinity::NormalizeMapCoord(pos.m_positionY);
|
||||
UpdateGroundPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
UpdateAllowedPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
pos.m_orientation = m_orientation;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user