Core/Spells: Fixed spells using MovePositionToFirstCollision for selecting target position getting Z coord offset by caster or target collision height (depending on spell target type)

Port From (https://github.com/TrinityCore/TrinityCore/commit/7a413ae5431fb078e14fe91196246bb67d9cbb30)
This commit is contained in:
hondacrx
2021-11-23 22:45:57 -05:00
parent 812b227ad8
commit b509aac0cd
@@ -3252,6 +3252,8 @@ namespace Game.Entities
UpdateAllowedPositionZ(destx, desty, ref destz);
bool col = Global.VMapMgr.GetObjectHitPos(PhasingHandler.GetTerrainMapId(GetPhaseShift(), GetMap(), pos.posX, pos.posY), pos.posX, pos.posY, pos.posZ + halfHeight, destx, desty, destz + halfHeight, out destx, out desty, out destz, -0.5f);
destz -= halfHeight;
// collision occured
if (col)
{
@@ -3264,6 +3266,8 @@ namespace Game.Entities
// check dynamic collision
col = GetMap().GetObjectHitPos(GetPhaseShift(), pos.posX, pos.posY, pos.posZ + halfHeight, destx, desty, destz + halfHeight, out destx, out desty, out destz, -0.5f);
destz -= halfHeight;
// Collided with a gameobject
if (col)
{