Skip to content

Commit

Permalink
Fix bug in systems
Browse files Browse the repository at this point in the history
  • Loading branch information
claudemuller committed Nov 19, 2023
1 parent 543d52a commit 5d60694
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/systems/collision_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ int update_collision_system(entity_t *entities)
}

if (!entityB.components.boxcollider) {
return 1;
continue;
}
if (!entityB.components.transform) {
return 1;
continue;
}

component_transform_t *transformB = entityB.components.transform;
Expand Down
6 changes: 3 additions & 3 deletions src/systems/keyboard_control_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ int update_keyboard_control_system(entity_t *entities, const double dt)
for (size_t i = 0; i < entities_len; i++) {
entity_t entity = entities[i];
if (!entity.components.transform) {
return 1;
continue;
}

if (!entity.components.rigidbody) {
return 1;
continue;
}

if (!entity.components.keyboard_control) {
return 1;
continue;
}

vec2_t move_vec = { 0 };
Expand Down
6 changes: 3 additions & 3 deletions src/systems/movement_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ int update_movement_system(entity_t *entities, const double dt)
for (size_t i = 0; i < entities_len; i++) {
entity_t entity = entities[i];
if (!entity.components.transform) {
return 1;
continue;
}

if (!entity.components.rigidbody) {
return 1;
continue;
}

if (!entity.components.sprite) {
return 1;
continue;
}

component_transform_t *transform = entity.components.transform;
Expand Down
4 changes: 2 additions & 2 deletions src/systems/render_collider_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ int update_render_collider_system(SDL_Renderer *renderer, entity_t *entities)
for (size_t i = 0; i < entities_len; i++) {
entity_t entity = entities[i];
if (!entity.components.transform) {
return 1;
continue;
}
if (!entity.components.boxcollider) {
return 1;
continue;
}

component_transform_t *transform = entity.components.transform;
Expand Down
4 changes: 2 additions & 2 deletions src/systems/render_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ int update_render_system(SDL_Renderer *renderer, entity_t *entities)
entity_t entity = entities[i];

if (!entity.components.transform) {
return 1;
continue;
}
if (!entity.components.sprite) {
return 1;
continue;
}

component_transform_t *transform = entity.components.transform;
Expand Down

0 comments on commit 5d60694

Please sign in to comment.