Core/Movement: reimplement follow movement (#124)

This commit is contained in:
Ovah authored and GitHub committed 2020-06-26 21:22:21 +02:00
1 parent 120a4cc983
commit b09d6e2330
40 files changed
+605 -416

No files matched your search

+3 -5
View File
@@ -760,8 +760,8 @@ public:
return false;
}
// Follow player - Using pet's default dist and angle
creature->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, creature->GetFollowAngle());
// Follow player
creature->FollowTarget(player);
handler->PSendSysMessage(LANG_CREATURE_FOLLOW_YOU_NOW, creature->GetName().c_str());
return true;
@@ -1351,8 +1351,7 @@ public:
return false;
}
FollowMovementGenerator const* mgen = static_cast<FollowMovementGenerator const*>((creature->GetMotionMaster()->top()));
FollowMovementGenerator* mgen = static_cast<FollowMovementGenerator*>((creature->GetMotionMaster()->top()));
if (mgen->GetTarget() != player)
{
handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName().c_str());
@@ -1362,7 +1361,6 @@ public:
// reset movement
creature->GetMotionMaster()->MovementExpired(true);
handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU_NOW, creature->GetName().c_str());
return true;
}