diff options
Diffstat (limited to 'src/systems/orienting.cpp')
| -rw-r--r-- | src/systems/orienting.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
| diff --git a/src/systems/orienting.cpp b/src/systems/orienting.cpp index 187bebc..2df8f87 100644 --- a/src/systems/orienting.cpp +++ b/src/systems/orienting.cpp | |||
| @@ -93,24 +93,18 @@ void OrientingSystem::moveRight(id_type entity) | |||
| 93 | 93 | ||
| 94 | void OrientingSystem::stopWalking(id_type entity) | 94 | void OrientingSystem::stopWalking(id_type entity) |
| 95 | { | 95 | { |
| 96 | auto& ponderable = game_.getEntityManager(). | ||
| 97 | getComponent<PonderableComponent>(entity); | ||
| 98 | |||
| 99 | auto& orientable = game_.getEntityManager(). | 96 | auto& orientable = game_.getEntityManager(). |
| 100 | getComponent<OrientableComponent>(entity); | 97 | getComponent<OrientableComponent>(entity); |
| 101 | 98 | ||
| 102 | orientable.setWalkState(OrientableComponent::WalkState::still); | 99 | orientable.setWalkState(OrientableComponent::WalkState::still); |
| 103 | 100 | ||
| 104 | if (ponderable.isGrounded()) | 101 | auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>(); |
| 105 | { | ||
| 106 | auto& animating = game_.getSystemManager().getSystem<AnimatingSystem>(); | ||
| 107 | 102 | ||
| 108 | if (orientable.isFacingRight()) | 103 | if (orientable.isFacingRight()) |
| 109 | { | 104 | { |
| 110 | animating.startAnimation(entity, "stillRight"); | 105 | animating.startAnimation(entity, "stillRight"); |
| 111 | } else { | 106 | } else { |
| 112 | animating.startAnimation(entity, "stillLeft"); | 107 | animating.startAnimation(entity, "stillLeft"); |
| 113 | } | ||
| 114 | } | 108 | } |
| 115 | } | 109 | } |
| 116 | 110 | ||
