clean up paths

This commit is contained in:
2026-07-06 01:13:18 -07:00
parent 59825b5025
commit a3f760e1f1
3 changed files with 12 additions and 0 deletions
+5
View File
@@ -27,6 +27,11 @@ entity_world_init :: proc() -> Entity_World {
return Entity_World{}
}
entity_world_destroy :: proc(ew: ^Entity_World) {
for i in 0 ..< MAX_ENTITIES {
path_destroy(&ew.path[i])
}
}
entity_spawn_colonist :: proc(ew: ^Entity_World, pos: Tile_Coord) -> Entity {
for i in 0 ..< MAX_ENTITIES {
if !ew.active[i] {
+1
View File
@@ -147,6 +147,7 @@ game_draw :: proc(g: ^Game) {
}
game_shutdown :: proc(g: ^Game) {
entity_world_destroy(&g.world.entities)
tilemap_destroy(&g.tilemap)
}
+6
View File
@@ -207,3 +207,9 @@ path_reconstruct :: proc(
return true
}
path_destroy :: proc(path: ^Path) {
delete(path.tiles)
path.tiles = nil
path.count = 0
}