Skip to content

Commit

Permalink
Optimize door finding in findBuildings (#357)
Browse files Browse the repository at this point in the history
* Optimize door finding

Find doors faster by searching for the doors in the viewGeometry and using select to run the selection filtering in-engine

* Change filtering

Instead of a select iteration, use an if statement

* Move pushBack into if-statement

Minor optimization
  • Loading branch information
rekterakathom authored Feb 18, 2024
1 parent 8d573ae commit b93108f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/main/functions/fnc_findBuildings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ private _housePos = [];
_housePos append (_house buildingPos -1);
if (_findDoors) then {
{
if ("door" in toLower (_x)) then {
if ("door" in _x) then {
_housePos pushBack (_house modelToWorld (_house selectionPosition _x));
};
} forEach (selectionNames _house);
} forEach (_house selectionNames "viewgeometry");
};
} forEach _houses;

Expand Down

0 comments on commit b93108f

Please sign in to comment.