summaryrefslogtreecommitdiff
path: root/src/world.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/world.cpp')
-rw-r--r--src/world.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/world.cpp b/src/world.cpp
index 9085b16..71098c6 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -131,6 +131,10 @@ std::list<entity_t*> world_t::get_entities(sf::FloatRect rect)
for (entity_t *ent : sector->ents) {
if (ent->cookie == cookie)
continue;
+
+ if (!rect.intersects(ent->bounds))
+ continue;
+
ent->cookie = cookie;
list.push_back(ent);