1 parent 8ab980f commit e8dde3aCopy full SHA for e8dde3a
1 file changed
src/game/systems/player-movement-system.hpp
@@ -24,16 +24,14 @@ namespace gameplay {
24
public:
25
void update(our::World* world, float deltaTime, our::Application* app) {
26
PlayerMovementComponent* movement = nullptr;
27
- our::CameraComponent* camera = nullptr;
28
for (auto entity : world->getEntities()) {
29
movement = entity->getComponent<PlayerMovementComponent>();
30
- camera = entity->getComponent<our::CameraComponent>();
31
- if (movement && camera) break;
+ if (movement) break;
32
}
33
34
- if (!(movement && camera)) return;
+ if (!movement) return;
35
36
- our::Entity* playerEntity = camera->getOwner();
+ our::Entity* playerEntity = movement->getOwner();
37
glm::vec3& playerPosition = playerEntity->localTransform.position;
38
39
our::Keyboard& keyboard = app->getKeyboard();
0 commit comments