aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level3.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-17 00:00:48 -0600
committermegamage <none@none>2009-01-17 00:00:48 -0600
commitf414ab1686c300787e3dfb0c397227062b8feea6 (patch)
tree2c76fa147dbf95b9192b01c7484d1804c03d2ed5 /src/game/Level3.cpp
parent0a1c601a1cc0e0036ad8fbfce68d87d14fa572d0 (diff)
*Update flee and confuse movement.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Level3.cpp')
-rw-r--r--src/game/Level3.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index c14320fd68c..62dc4ab2bd3 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -5762,9 +5762,12 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/)
PSendSysMessage(LANG_MOVEGENS_LIST,(unit->GetTypeId()==TYPEID_PLAYER ? "Player" : "Creature" ),unit->GetGUIDLow());
MotionMaster* mm = unit->GetMotionMaster();
- for(MotionMaster::const_iterator itr = mm->begin(); itr != mm->end(); ++itr)
+ for(int i = 0; i < MAX_MOTION_SLOT; ++i)
{
- switch((*itr)->GetMovementGeneratorType())
+ MovementGenerator* mg = mm->GetMotionSlot(i);
+ if(!mg)
+ SendSysMessage("Empty");
+ switch(mg->GetMovementGeneratorType())
{
case IDLE_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_IDLE); break;
case RANDOM_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_RANDOM); break;
@@ -5775,7 +5778,7 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/)
{
if(unit->GetTypeId()==TYPEID_PLAYER)
{
- TargetedMovementGenerator<Player> const* mgen = static_cast<TargetedMovementGenerator<Player> const*>(*itr);
+ TargetedMovementGenerator<Player> const* mgen = static_cast<TargetedMovementGenerator<Player> const*>(mg);
Unit* target = mgen->GetTarget();
if(target)
PSendSysMessage(LANG_MOVEGENS_TARGETED_PLAYER,target->GetName(),target->GetGUIDLow());
@@ -5784,7 +5787,7 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/)
}
else
{
- TargetedMovementGenerator<Creature> const* mgen = static_cast<TargetedMovementGenerator<Creature> const*>(*itr);
+ TargetedMovementGenerator<Creature> const* mgen = static_cast<TargetedMovementGenerator<Creature> const*>(mg);
Unit* target = mgen->GetTarget();
if(target)
PSendSysMessage(LANG_MOVEGENS_TARGETED_CREATURE,target->GetName(),target->GetGUIDLow());
@@ -5797,7 +5800,7 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/)
if(unit->GetTypeId()==TYPEID_UNIT)
{
float x,y,z;
- (*itr)->GetDestination(x,y,z);
+ mg->GetDestination(x,y,z);
PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE,x,y,z);
}
else
@@ -5807,14 +5810,14 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/)
case POINT_MOTION_TYPE:
{
float x,y,z;
- (*itr)->GetDestination(x,y,z);
+ mg->GetDestination(x,y,z);
PSendSysMessage(LANG_MOVEGENS_POINT,x,y,z);
break;
}
case FLEEING_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_FEAR); break;
case DISTRACT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_DISTRACT); break;
default:
- PSendSysMessage(LANG_MOVEGENS_UNKNOWN,(*itr)->GetMovementGeneratorType());
+ PSendSysMessage(LANG_MOVEGENS_UNKNOWN,mg->GetMovementGeneratorType());
break;
}
}