Smarter
Member
- Joined
- Jan 15, 2010
- Messages
- 763
- Reaction score
- 9
I am attempting to write a method for determining a WoWPoint's ZoneID. By iterating the WoWDB I have the bounds of each Map, using this data I need a method of checking if a WoWPoint is within those bounds? :-\
Trying this out .... Scary Results.
Trying this out .... Scary Results.
Code:
if (location.X <= map.AX && location.X >= map.BX && location.Y <= map.AY && location.Y >= map.BY)
{
Logging.Write(string.Format("Your Location is in Zone: [{0}] {1}", map.Id, map.WorldMapName));
}
Code:
Maps Generated: 211
Attempting to find ZoneID from Location: <-1303.223, 6580.17, 147.7242>
Your Location is in Zone: [1] Kalimdor
Your Location is in Zone: [0] Azeroth
Your Location is in Zone: [530] Expansion01
Your Location is in Zone: [530] Zangarmarsh
Your Location is in Zone: [530] Nagrand
Your Location is in Zone: [530] TerokkarForest
Your Location is in Zone: [668] HallsofReflection
Last edited: