MCPcopy Create free account
hub / github.com/EasyRPG/Player / UpdateMovement

Method UpdateMovement

src/game_character.cpp:155–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void 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
176void Game_Character::UpdateAnimation() {
177 const auto speed = Utils::Clamp(GetMoveSpeed(), 1, 6);

Callers 1

UpdateMethod · 0.95

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected