aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
authornathan <nathansmith@disroot.org>2025-10-26 00:10:58 +0000
committernathan <nathansmith@disroot.org>2025-10-26 00:10:58 +0000
commit5925230971875ba3e6e591f0655cf84b739b50fc (patch)
treea08383647602ec9afc4cce49da4f25242e9e236b /src/world.c
parent361c596fa09e9bac1d256ee21da63e352d796fa3 (diff)
downloadFindThings-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.c9
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))
{