mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Cache the units near to the camera instead of the player.
Works even when no player exists or is somehow viewing the action remotely.
This commit is contained in:
parent
8683667d24
commit
e7ec905892
@ -1,12 +1,14 @@
|
|||||||
// by commy2
|
// by commy2
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
if !(hasInterface) exitWith {};
|
||||||
|
|
||||||
GVAR(nearUnits) = [];
|
GVAR(nearUnits) = [];
|
||||||
|
|
||||||
// @todo. Maybe move to common?
|
// @todo. Maybe move to common?
|
||||||
[{
|
[{
|
||||||
private "_nearUnits";
|
private "_nearUnits";
|
||||||
_nearUnits = nearestObjects [ACE_player, ["CAManBase"], 50];
|
_nearUnits = nearestObjects [positionCameraToWorld [0,0,0], ["CAManBase"], 50];
|
||||||
|
|
||||||
if (count _nearUnits > 10) then {
|
if (count _nearUnits > 10) then {
|
||||||
_nearUnits resize 10;
|
_nearUnits resize 10;
|
||||||
|
Loading…
Reference in New Issue
Block a user