diff options
| author | nathan <nathansmith@disroot.org> | 2025-10-26 00:10:58 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-10-26 00:10:58 +0000 |
| commit | 5925230971875ba3e6e591f0655cf84b739b50fc (patch) | |
| tree | a08383647602ec9afc4cce49da4f25242e9e236b /src/world.c | |
| parent | 361c596fa09e9bac1d256ee21da63e352d796fa3 (diff) | |
| download | FindThings-5925230971875ba3e6e591f0655cf84b739b50fc.tar.gz FindThings-5925230971875ba3e6e591f0655cf84b739b50fc.tar.bz2 FindThings-5925230971875ba3e6e591f0655cf84b739b50fc.zip | |
New entity system is working (:
Diffstat (limited to 'src/world.c')
| -rw-r--r-- | src/world.c | 9 |
1 files changed, 8 insertions, 1 deletions
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)) { |
