diff options
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/world.cpp b/src/world.cpp index d9789ad..ab3ef92 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -99,9 +99,9 @@ bool world_t::find_path(v2f_t src, v2f_t dst, cmodel_t *cmodel, entity_t *ignore bounds = rectf_t(src, dst).norm(); - for (entity_t *ent : get_entities(bounds)) + for (entity_t *ent : get_entities(bounds, cmodel->cflags)) if (ent != ignore) - finder.eliminate_nodes(ent->cmodel); + finder.eliminate_nodes(ent->cmodel.bounds); if (!finder.find()) return false; @@ -169,7 +169,7 @@ std::list<sector_t*> world_t::get_sectors(rectf_t rect) return list; } -std::list<entity_t*> world_t::get_entities(rectf_t rect) +std::list<entity_t*> world_t::get_entities(rectf_t rect, cflags_t cflags) { static size_t cookie = 0; std::list<entity_t*> list; @@ -181,10 +181,13 @@ std::list<entity_t*> world_t::get_entities(rectf_t rect) if (ent->cookie == cookie) continue; - if (!(rect && ent->cmodel.bounds)) + ent->cookie = cookie; + + if (!(ent->cmodel.cflags & cflags)) continue; - ent->cookie = cookie; + if (!(rect && ent->cmodel.bounds)) + continue; list.push_back(ent); } |