diff options
author | MeanMachine@MeanMachine-PC <none@none> | 2008-12-10 06:34:35 +0200 |
---|---|---|
committer | MeanMachine@MeanMachine-PC <none@none> | 2008-12-10 06:34:35 +0200 |
commit | cc0838459a86e45ccdbaa4977e20f4233f1ff1c1 (patch) | |
tree | 04e80e4c678250c4d40e25d4f2e07f1886d06fe9 /src/game/World.cpp | |
parent | b5d1418b0cdd38980ec1fec3af1ddf031c9cb9e5 (diff) |
Featuring a rewritten waypoint movement with more options, optimised code and revamped ingame waypoint control. To convert entries from the old tables manually, please use the PHP script provided at http://www.trinitycore.org/forum/project.php?issueid=830
--HG--
branch : trunk
Diffstat (limited to 'src/game/World.cpp')
-rw-r--r-- | src/game/World.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/game/World.cpp b/src/game/World.cpp index 04b3a1004c9..8cf6147842b 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1271,6 +1271,7 @@ void World::SetInitialWorldSettings() objmgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data) objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data) objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data) + objmgr.LoadWaypointScripts(); sLog.outString( "Loading Scripts text locales..." ); // must be after Load*Scripts calls objmgr.LoadDbScriptStrings(); @@ -1313,7 +1314,6 @@ void World::SetInitialWorldSettings() ///- Initilize static helper structures AIRegistry::Initialize(); - WaypointMovementGenerator<Creature>::Initialize(); Player::InitVisibleBits(); ///- Initialize MapManager @@ -2203,8 +2203,32 @@ void World::ScriptsProcess() break; } - - default: +
+ case SCRIPT_COMMAND_LOAD_PATH:
+ {
+ if(!source)
+ {
+ sLog.outError("SCRIPT_COMMAND_START_MOVE is tried to apply to NON-existing unit.");
+ break;
+ }
+
+ if(!source->isType(TYPEMASK_UNIT))
+ {
+ sLog.outError("SCRIPT_COMMAND_START_MOVE source mover isn't unit (TypeId: %u), skipping.",source->GetTypeId());
+ break;
+ }
+
+ if(!WaypointMgr.GetPath(step.script->datalong))
+ {
+ sLog.outError("SCRIPT_COMMAND_START_MOVE source mover has an invallid path, skipping.", step.script->datalong2);
+ break;
+ }
+
+ dynamic_cast<Unit*>(source)->GetMotionMaster()->MovePath(step.script->datalong, step.script->datalong2);
+ break;
+ } + + default: sLog.outError("Unknown script command %u called.",step.script->command); break; } |