This repository was archived by the owner on Mar 25, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Arma 2/Unit Caching/scripts/unitCaching/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,6 +165,8 @@ CLASS_EXTENDS("UCD_obj_cachedAsset","UCD_obj_cachedObject")
165165 if (_varName ! = " " ) then {
166166 _obj setVehicleVarName _varName ;
167167 missionNamespace setVariable [_varName , _obj ];
168+ UCD_setVehicleVarNameRemote = [_obj , _varName ];
169+ publicVariable " UCD_setVehicleVarNameRemote" ;
168170 publicVariable _varName ;
169171 };
170172 if ([" get" , [" spawnPos" , false ]] call _prop ) then {
@@ -296,10 +298,22 @@ UCD_fnc_cacheMonitor = {
296298 _group setVariable [" UCD_monitorScript" , nil ];
297299};
298300
301+ UCD_fnc_setVehicleVarName = {
302+ CHECK_THIS;
303+ private [" _val" , " _veh" , " _varName" ];
304+ _val = if (typeName (_this select 0 ) == " STRING" ) then {_this select 1 } else {_this }; // Differentiate between normal and PVEH call
305+ _veh = _val select 0 ;
306+ _varName = _val select 1 ;
307+ _veh setVehicleVarName _varName ;
308+ // Global variable value is publicVariable'd in prior code to conform with JIPs
309+ };
310+
299311/*
300312 Group: Initialization Code
301313*/
302314
315+ " UCD_setVehicleVarNameRemote" addPublicVariableEventHandler UCD_fnc_setVehicleVarName ;
316+
303317if (isServer) then {
304318 UCD_spawnUnitInit = CACHE_UNIT_SPAWN_FNC;
305319 UCD_distributeAI = CACHE_DISTRIBUTE_AI;
You can’t perform that action at this time.
0 commit comments