Move system initialization in systems.c, properly delete all entities when unloading map

This commit is contained in:
2023-12-29 17:18:06 +01:00
parent 5190c86316
commit cc66f15131
8 changed files with 84 additions and 82 deletions

View File

@@ -55,7 +55,7 @@ ecs_entity_t placeBuilding(BzTileMap *map, BuildingType type, BzTile tileX, BzTi
BZ_ASSERT(buildingTile != -1);
// Create entity
ecs_entity_t e = ecs_new_id(ECS);
ecs_entity_t e = entityCreate(ECS);
ecs_set(ECS, e, TilePosition, { .x = tileX, .y = tileY });
ecs_set(ECS, e, TileSize, { .sizeX = sizeX, .sizeY = sizeY });