mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-04 16:17:26 +01:00
Core/Vmaps: Fix inconsistency of hitInstance and hitModel to cause wrong area ids (#28632)
Closes #19761
Closes #28326
Co-authored-by: Gosha <284210+Lordron@users.noreply.github.com>
(cherry picked from commit 6ce6665992)
This commit is contained in:
@@ -116,7 +116,9 @@ namespace VMAP
|
||||
Vector3 pModel = iInvRot * (p - iPos) * iInvScale;
|
||||
Vector3 zDirModel = iInvRot * Vector3(0.f, 0.f, -1.f);
|
||||
float zDist;
|
||||
if (iModel->GetLocationInfo(pModel, zDirModel, zDist, info))
|
||||
|
||||
GroupLocationInfo groupInfo;
|
||||
if (iModel->GetLocationInfo(pModel, zDirModel, zDist, groupInfo))
|
||||
{
|
||||
Vector3 modelGround = pModel + zDist * zDirModel;
|
||||
// Transform back to world space. Note that:
|
||||
@@ -125,6 +127,8 @@ namespace VMAP
|
||||
float world_Z = ((modelGround * iInvRot) * iScale + iPos).z;
|
||||
if (info.ground_Z < world_Z) // hm...could it be handled automatically with zDist at intersection?
|
||||
{
|
||||
info.rootId = groupInfo.rootId;
|
||||
info.hitModel = groupInfo.hitModel;
|
||||
info.ground_Z = world_Z;
|
||||
info.hitInstance = this;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user