diff options
Diffstat (limited to 'src/character_system.cpp')
-rw-r--r-- | src/character_system.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/character_system.cpp b/src/character_system.cpp index 781b50d..aad8c1b 100644 --- a/src/character_system.cpp +++ b/src/character_system.cpp | |||
@@ -248,6 +248,18 @@ void CharacterSystem::stopRunningSound(Sprite& sprite) { | |||
248 | } | 248 | } |
249 | } | 249 | } |
250 | 250 | ||
251 | void CharacterSystem::halt(int spriteId) { | ||
252 | // Because special stuff happens when we stop running, we have to handle the | ||
253 | // running case here. | ||
254 | Sprite& sprite = game_.getSprite(spriteId); | ||
255 | if (sprite.characterState == CharacterState::Running) { | ||
256 | stopRunning(spriteId); | ||
257 | } else { | ||
258 | // Other than that, it is simple to go to Still from Walking or Crouching. | ||
259 | setPartyState(spriteId, CharacterState::Still); | ||
260 | } | ||
261 | } | ||
262 | |||
251 | void CharacterSystem::clearSpriteCache() { | 263 | void CharacterSystem::clearSpriteCache() { |
252 | for (Sprite& sprite : game_.getSprites() | game_.spriteView()) { | 264 | for (Sprite& sprite : game_.getSprites() | game_.spriteView()) { |
253 | if (sprite.runningSfxChannel != -1) { | 265 | if (sprite.runningSfxChannel != -1) { |