Bunch of bug fixes, guard behavior works again

This commit is contained in:
KimLS
2018-10-13 23:53:16 -07:00
parent 18ec09a79e
commit d0685556e8
14 changed files with 120 additions and 129 deletions
+5 -19
View File
@@ -1434,16 +1434,14 @@ void Mob::SendHPUpdate(bool skip_self /*= false*/, bool force_update_all /*= fal
}
void Mob::StopMoving() {
FixZ();
SetCurrentSpeed(0);
StopNavigation();
if (moved)
moved = false;
}
void Mob::StopMoving(float new_heading) {
SetHeading(new_heading);
FixZ();
SetCurrentSpeed(0);
StopNavigation();
RotateTo(new_heading);
if (moved)
moved = false;
}
@@ -2706,10 +2704,10 @@ void Mob::FaceTarget(Mob* mob_to_face /*= 0*/) {
float new_heading = CalculateHeadingToTarget(faced_mob->GetX(), faced_mob->GetY());
if(current_heading != new_heading) {
if (IsEngaged() || IsRunning()) {
mMovementManager->RotateTo(this, new_heading);
RotateToRunning(new_heading);
}
else {
mMovementManager->RotateTo(this, new_heading, MovementWalking);
RotateToWalking(new_heading);
}
}
@@ -5765,18 +5763,6 @@ void Mob::SendRemovePlayerState(PlayerState old_state)
safe_delete(app);
}
void Mob::SetCurrentSpeed(int in){
if (current_speed != in)
{
current_speed = in;
if (in == 0) {
SetRunAnimSpeed(0);
SetMoving(false);
SendPosition();
}
}
}
int32 Mob::GetMeleeMitigation() {
int32 mitigation = 0;
mitigation += spellbonuses.MeleeMitigationEffect;