Index: ps/trunk/binaries/data/mods/public/maps/random/extinct_volcano_triggers.js =================================================================== --- ps/trunk/binaries/data/mods/public/maps/random/extinct_volcano_triggers.js +++ ps/trunk/binaries/data/mods/public/maps/random/extinct_volcano_triggers.js @@ -128,7 +128,7 @@ let cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager); let cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); - for (let ent of [...cmpRangeManager.GetEntitiesByPlayer(0), ...cmpRangeManager.GetNonGaiaEntities()]) + for (let ent of cmpRangeManager.GetGaiaAndNonGaiaEntities()) { let cmpPosition = Engine.QueryInterface(ent, IID_Position); if (!cmpPosition || !cmpPosition.IsInWorld()) Index: ps/trunk/source/simulation2/components/CCmpRangeManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpRangeManager.cpp +++ ps/trunk/source/simulation2/components/CCmpRangeManager.cpp @@ -1053,6 +1053,11 @@ return GetEntitiesByMask(~3); // bit 0 for owner=-1 and bit 1 for gaia } + virtual std::vector GetGaiaAndNonGaiaEntities() const + { + return GetEntitiesByMask(~1); // bit 0 for owner=-1 + } + std::vector GetEntitiesByMask(u32 ownerMask) const { std::vector entities; Index: ps/trunk/source/simulation2/components/ICmpRangeManager.h =================================================================== --- ps/trunk/source/simulation2/components/ICmpRangeManager.h +++ ps/trunk/source/simulation2/components/ICmpRangeManager.h @@ -199,6 +199,11 @@ virtual std::vector GetNonGaiaEntities() const = 0; /** + * Returns a list of all entities owned by a player or gaia. + */ + virtual std::vector GetGaiaAndNonGaiaEntities() const = 0; + + /** * Toggle the rendering of debug info. */ virtual void SetDebugOverlay(bool enabled) = 0; Index: ps/trunk/source/simulation2/components/ICmpRangeManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpRangeManager.cpp +++ ps/trunk/source/simulation2/components/ICmpRangeManager.cpp @@ -47,6 +47,7 @@ DEFINE_INTERFACE_METHOD_CONST_1("GetEntityFlagMask", u8, ICmpRangeManager, GetEntityFlagMask, std::string) DEFINE_INTERFACE_METHOD_CONST_1("GetEntitiesByPlayer", std::vector, ICmpRangeManager, GetEntitiesByPlayer, player_id_t) DEFINE_INTERFACE_METHOD_CONST_0("GetNonGaiaEntities", std::vector, ICmpRangeManager, GetNonGaiaEntities) +DEFINE_INTERFACE_METHOD_CONST_0("GetGaiaAndNonGaiaEntities", std::vector, ICmpRangeManager, GetGaiaAndNonGaiaEntities) DEFINE_INTERFACE_METHOD_1("SetDebugOverlay", void, ICmpRangeManager, SetDebugOverlay, bool) DEFINE_INTERFACE_METHOD_1("ExploreAllTiles", void, ICmpRangeManager, ExploreAllTiles, player_id_t) DEFINE_INTERFACE_METHOD_0("ExploreTerritories", void, ICmpRangeManager, ExploreTerritories)