Prevent client update while on boat if boat turning (#1343)

Co-authored-by: Noudess <noudess@gmail.com>
This commit is contained in:
Paul Coene
2021-05-10 02:15:38 -04:00
committed by GitHub
parent 0758250ad1
commit b335568bf9
4 changed files with 8 additions and 0 deletions
+4
View File
@@ -63,6 +63,7 @@ public:
if (!m_started) {
m_started = true;
mob->turning = true;
mob->SetMoving(true);
if (dist > 15.0f && rotate_to_speed > 0.0 && rotate_to_speed <= 25.0) { //send basic rotation
@@ -84,6 +85,7 @@ public:
mob->SetHeading(to);
mob->SetMoving(false);
mob_movement_manager->SendCommandToClients(mob, 0.0, 0.0, 0.0, 0.0, 0, ClientRangeCloseMedium);
mob->turning = false;
return true;
}
@@ -1370,7 +1372,9 @@ void MobMovementManager::UpdatePathBoat(Mob *who, float x, float y, float z, Mob
{
auto eiter = _impl->Entries.find(who);
auto &ent = (*eiter);
float to = who->CalculateHeadingToTarget(x, y);
PushRotateTo(ent.second, who, to, mode);
PushSwimTo(ent.second, x, y, z, mode);
PushStopMoving(ent.second);
}