Skip to content

Commit e8dde3a

Browse files
committed
chore: remove redundant camera check
1 parent 8ab980f commit e8dde3a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/game/systems/player-movement-system.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@ namespace gameplay {
2424
public:
2525
void update(our::World* world, float deltaTime, our::Application* app) {
2626
PlayerMovementComponent* movement = nullptr;
27-
our::CameraComponent* camera = nullptr;
2827
for (auto entity : world->getEntities()) {
2928
movement = entity->getComponent<PlayerMovementComponent>();
30-
camera = entity->getComponent<our::CameraComponent>();
31-
if (movement && camera) break;
29+
if (movement) break;
3230
}
3331

34-
if (!(movement && camera)) return;
32+
if (!movement) return;
3533

36-
our::Entity* playerEntity = camera->getOwner();
34+
our::Entity* playerEntity = movement->getOwner();
3735
glm::vec3& playerPosition = playerEntity->localTransform.position;
3836

3937
our::Keyboard& keyboard = app->getKeyboard();

0 commit comments

Comments
 (0)