From 5925230971875ba3e6e591f0655cf84b739b50fc Mon Sep 17 00:00:00 2001 From: nathan Date: Sat, 25 Oct 2025 18:10:58 -0600 Subject: New entity system is working (: --- src/world.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/world.c') diff --git a/src/world.c b/src/world.c index dd76cf8..5ffec66 100644 --- a/src/world.c +++ b/src/world.c @@ -1,6 +1,7 @@ #include "world.h" #include "game.h" #include "entity.h" +#include "entitiesInclude.h" size_t buildWorldBVHLeafs(BVHNode leafs[WORLD_ENTITY_MAX], const World* world) { @@ -873,6 +874,12 @@ void freeWorld(World world) UnloadModel(world.heightmap); UnloadModel(world.samanthasSpotFloor); freeWorldBVH(world.bvh); + + // Close the entities. + for (int index = 0; index < WORLD_ENTITY_MAX; ++index) + { + closeEntity(&world.entities[index]); + } } Vector2 worldPositionToPixel(const World* world, float x, float y) @@ -963,7 +970,7 @@ void castRayBVH(const World* world, BVHNode node, Ray ray, bool allowAll, world->entities[node.entities[index]].position, ray.position); - // Don't include places. + // Don't include things that can't be selected. if (!allowAll && !entityCanBeSelected(world->entities[node.entities[index]].id)) { -- cgit v1.2.3