Thread: New API Usage
View Single Post
08-07-14, 10:19 AM   #8
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Originally Posted by Cybeloras View Post
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 View Post
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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)