Cam publish and Group Var

This commit is contained in:
He-Man 2018-05-03 19:36:11 +02:00
parent 8dfc1646d3
commit c4dcc22174
2 changed files with 23 additions and 2 deletions

View File

@ -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

View File

@ -86,7 +86,20 @@ if (isText _staticClassConfig) then {
if (_objSlot != -1) then {
_newVehicle = [_vehicle, false] call EPOCH_server_simulSwap;
// 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;
};