diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf index 6c24d02d..946fa8a8 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf @@ -15,6 +15,7 @@ //[[[cog import generate_private_arrays ]]] private ["_Simulated","_DamageAllowed","_ExceptedBaseObjects","_IndestructibleBaseObjects","_UseIndestructible","_VAL","_ammoClass","_ammoObj","_anims","_animsData","_arr","_arrCount","_baseObj","_buildingJammerRange","_cfgBaseBuilding","_cfgEpochClient","_class","_color","_damage","_location","_marker","_maxTTL","_owner","_response","_serverSettingsConfig","_storageSlot","_textureSlot","_ttl","_vehHiveKey","_worldspace"]; //[[[end]]] +EPOCH_BaseCams = []; _maxTTL = parseNumber EPOCH_expiresBuilding; _serverSettingsConfig = configFile >> "CfgEpochServer"; _baseDynamicSimulationSystem = [_serverSettingsConfig, "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry; @@ -163,6 +164,12 @@ for "_i" from 0 to _this do { _baseObj setVariable ["BUILD_OWNER", _owner, true]; }; + // add BaseCam to public array + if (_class isequalto "BaseCam_EPOCH") then { + EPOCH_BaseCams pushBackUnique _baseObj; + // Set PubVar later after all Cams are loaded in + }; + if (_textureSlot != 0) then { // get texture path from index _color = getArray (_cfgBaseBuilding >> _class >> "availableTextures"); @@ -188,5 +195,6 @@ for "_i" from 0 to _this do { EPOCH_BuildingSlots set [_i,0]; }; }; +publicvariable "EPOCH_BaseCams"; missionNamespace setVariable ["EPOCH_BuildingSlotCount", {_x == 0} count EPOCH_BuildingSlots, true]; true diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf index e2233996..9190a9ba 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_saveBuilding.sqf @@ -85,8 +85,21 @@ if (isText _staticClassConfig) then { if (_objSlot != -1) then { _newVehicle = [_vehicle, false] call EPOCH_server_simulSwap; - - _newVehicle setVariable["BUILD_OWNER", _playerUID, true]; + + // add BaseCam to public array + if (_newVehicle iskindof "BaseCam_EPOCH") then { + _playerGroup = _player getVariable["GROUP", ""]; + _Owner = _playerUID; + if (_playerGroup != "") then { + _Owner = _playerGroup; + }; + _newVehicle setVariable["BUILD_OWNER", _Owner, true]; + EPOCH_BaseCams pushBackUnique _newVehicle; + publicvariable "EPOCH_BaseCams"; + } + else { + _newVehicle setVariable["BUILD_OWNER", _playerUID, true]; + }; _newVehicle call EPOCH_saveBuilding; };