clean up paths
This commit is contained in:
@@ -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] {
|
||||
|
||||
@@ -147,6 +147,7 @@ game_draw :: proc(g: ^Game) {
|
||||
}
|
||||
|
||||
game_shutdown :: proc(g: ^Game) {
|
||||
entity_world_destroy(&g.world.entities)
|
||||
tilemap_destroy(&g.tilemap)
|
||||
}
|
||||
|
||||
|
||||
@@ -207,3 +207,9 @@ path_reconstruct :: proc(
|
||||
return true
|
||||
}
|
||||
|
||||
path_destroy :: proc(path: ^Path) {
|
||||
delete(path.tiles)
|
||||
path.tiles = nil
|
||||
path.count = 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user