diff options
author | megamage <none@none> | 2009-05-11 13:27:10 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-05-11 13:27:10 -0500 |
commit | 8fc07d443acb86ca436caa05b435c86ea6e9071d (patch) | |
tree | c5c96ea63a946bb43d01396be7c3a40073d6def2 /src/game/WaypointManager.h | |
parent | 91558b8b29f2f81a4a121a3941cf9aaa7243fe96 (diff) |
*Change waypoint data structure. Use creature db guid as path id. If a creature uses waypoint movement as default movement type, the path id should be DBGUID*10. For paths of script use, the path id should be DBGUID*10+1 ~ DBGUID*10+9.
*Two sql queries are included. Converter is used to convert the existing path id to new path id. "...creature_add..." is used to change table structure. You can first run the converter, then run the other one. Or run the other one directly and get the new data from the db team. Because it may take hours to run the converter.
*If you have custom data, you may need to run the converter. We suggest you use console to run it It is extremely slow to run the query. If you have multiple paths for a creature in your db, you need to do more work to convert it. However, if you know how to use multiple paths, you should already have more db knowledge than I do and you should know how to convert it.
*There may be a faster query to convert the db. If you know, please tell us. I am no sql expert.
*Backup your db first!
*Thanks to X-Savior and subhuman_bob.
--HG--
branch : trunk
Diffstat (limited to 'src/game/WaypointManager.h')
-rw-r--r-- | src/game/WaypointManager.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/game/WaypointManager.h b/src/game/WaypointManager.h index 85f8b765d45..a8f2d5746e9 100644 --- a/src/game/WaypointManager.h +++ b/src/game/WaypointManager.h @@ -34,7 +34,9 @@ struct WaypointData }; typedef std::vector<WaypointData*> WaypointPath; -extern UNORDERED_MAP<uint32, WaypointPath*> waypoint_map; +typedef UNORDERED_MAP<uint32, WaypointPath*> WaypointPathMap; + +extern WaypointPathMap WaypointPathHolder; class WaypointStore { @@ -48,9 +50,10 @@ class WaypointStore WaypointPath* GetPath(uint32 id) { - if(waypoint_map.find(id) != waypoint_map.end()) - return waypoint_map[id]; - else return 0; + WaypointPathMap::iterator itr = WaypointPathHolder.find(id); + if(itr != WaypointPathHolder.end()) + return itr->second; + return NULL; } inline uint32 GetRecordsCount() { return records; } |