test: ms_time

This commit is contained in:
Yunfan Li
2023-08-02 03:46:15 +08:00
parent b35b8ad997
commit fca4d17c97
26 changed files with 91 additions and 82 deletions

View File

@@ -674,9 +674,11 @@ bool MovementAction::MoveTo(Unit* target, float distance)
float dx = cos(angle) * needToGo + bx;
float dy = sin(angle) * needToGo + by;
float dz = std::max(bz, tz); // calc accurate z position to avoid stuck
float dz; // = std::max(bz, tz); // calc accurate z position to avoid stuck
if (distanceToTarget > CONTACT_DISTANCE) {
dz = std::max(dz, bz + (tz - bz) * (needToGo / distanceToTarget));
dz = bz + (tz - bz) * (needToGo / distanceToTarget);
} else {
dz = tz;
}
return MoveTo(target->GetMapId(), dx, dy, dz);
}