Originally Posted by Cybeloras
Unfortunately, UnitDistanceSquared only works on group members (party and raid) ... UnitPosition has the same restrictions.
|
Same restrictions as
GetPlayerMapPosition() and real coordinates could've already been calculated with
GetCurrentMapZone(). The only difference is we have access to the Z coordinate now.
Originally Posted by TOM_RUS
z value returned by UnitPosition is bugged sometimes. I made a few steps around in horde garrison and value changed from 7000 to 13000.
There's what's going on internally: http://paste2.org/8jBAmI65
Code:
y = (float)(signed int)sub_48AA75(pos2.Y * 10.0) * 0.1;
_z = 7 * ((signed int)ffloor(pos2.X) ^ ((signed int)ffloor(y) + 3));
pos2.Z = (float)(_z & 0xFFFFF);
|
Looks like the Z coordinate is still being worked on and they're throwing out a garbage value for now.