From b509aac0cda66fb9351e054a22b0d8879637b878 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 23 Nov 2021 22:45:57 -0500 Subject: [PATCH] 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) --- Source/Game/Entities/Object/WorldObject.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index f746a743d..7880404de 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -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) {