| 153 | } |
| 154 | |
| 155 | void Game_Character::UpdateMovement(int amount) { |
| 156 | SetRemainingStep(GetRemainingStep() - amount); |
| 157 | if (GetRemainingStep() <= 0) { |
| 158 | SetRemainingStep(0); |
| 159 | SetJumping(false); |
| 160 | |
| 161 | auto& move_route = GetMoveRoute(); |
| 162 | if (IsMoveRouteOverwritten() && GetMoveRouteIndex() >= static_cast<int>(move_route.move_commands.size())) { |
| 163 | SetMoveRouteFinished(true); |
| 164 | SetMoveRouteIndex(0); |
| 165 | if (!move_route.repeat) { |
| 166 | // If the last command of a move route is a move or jump, |
| 167 | // RPG_RT cancels the entire move route immediately. |
| 168 | CancelMoveRoute(); |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | SetStopCount(0); |
| 174 | } |
| 175 | |
| 176 | void Game_Character::UpdateAnimation() { |
| 177 | const auto speed = Utils::Clamp(GetMoveSpeed(), 1, 6); |