Skip to content

Commit

Permalink
Cleaning up more bugs with entity.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed Feb 11, 2024
1 parent bce476b commit d9d8475
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion seika/ecs/entity.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ void ska_ecs_entity_finalize() {
SE_ASSERT(entityIdQueue);
se_queue_destroy(entityIdQueue);
entityIdQueue = NULL;
entityIdCounter = 0;
activeEntityCount = 0;
}

SkaEntity ska_ecs_entity_create() {
SE_ASSERT(entityIdQueue);
if (se_queue_is_empty(entityIdQueue)) {
SE_ASSERT_FMT(entityIdCounter + 1 < SKA_MAX_ENTITIES, "Reached maxed entities ids to create, considering increasing SKA_MAX_ENTITIES!");
SE_ASSERT_FMT(entityIdCounter < SKA_MAX_ENTITIES, "Reached maxed entities ids to create, considering increasing SKA_MAX_ENTITIES!");
se_queue_enqueue(entityIdQueue, entityIdCounter++);
}
activeEntityCount++;
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "seika",
"version": "0.0.34",
"version": "0.0.35",
"dependencies": [
{
"name": "sdl2",
Expand Down

0 comments on commit d9d8475

Please sign in to comment.