aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
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))
{