diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf index 7c78b309..1d2e8f9a 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_swapBuilding.sqf @@ -1,6 +1,6 @@ // _newObj = [_class,_object] call EPOCH_swapBuilding; //[[[cog import generate_private_arrays ]]] -private ["_newObj","_objectPos","_playersNear"]; +private ["_newObj","_objectPos"]; //[[[end]]] params [["_class",""],["_object",objNull],["_method",0]]; _newObj = objNull; @@ -9,43 +9,6 @@ if (!isNull _object && !(_class isEqualTo "")) then { _newObj = createVehicle [_class, ASLtoAGL _objectPos, [], 0, "CAN_COLLIDE"]; if (!isNull _newObj) then { _object hideObjectGlobal true; - - _serverSettingsConfig = configFile >> "CfgEpochServer"; - _UseIndestructible = [_serverSettingsConfig, "UseIndestructible", false] call EPOCH_fnc_returnConfigEntry; - _IndestructibleBaseObjects = [_serverSettingsConfig, "IndestructibleBaseObjects", []] call EPOCH_fnc_returnConfigEntry; - _ExceptedBaseObjects = [_serverSettingsConfig, "ExceptedBaseObjects", []] call EPOCH_fnc_returnConfigEntry; - _UseDeSimulateObjects = [_serverSettingsConfig, "UseDeSimulateObjects", true] call EPOCH_fnc_returnConfigEntry; - _DeSimulateObjects = [_serverSettingsConfig, "DeSimulateObjects", []] call EPOCH_fnc_returnConfigEntry; - _ExceptedDeSymObjects = [_serverSettingsConfig, "ExceptedDeSymObjects", []] call EPOCH_fnc_returnConfigEntry; - _Simulated = true; - if (_UseIndestructible) then { - if ({_class iskindof _x} count _ExceptedBaseObjects == 0) then { - { - if (_class iskindof _x) exitwith { - _newObj allowdamage false; - }; - } foreach _IndestructibleBaseObjects; - }; - }; - if (_UseDeSimulateObjects) then { - if ({_class iskindof _x} count _ExceptedDeSymObjects == 0) then { - { - if (_class iskindof _x) exitwith { - _newObj enablesimulationglobal false; - _Simulated = false; - }; - } foreach _DeSimulateObjects; - }; - }; - if (_Simulated) then { // Only needed, if simulation is not disabled - // new Dynamicsimulation - if([configFile >> "CfgEpochServer", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry)then - { - _newObj enableDynamicSimulation true; - _newObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server - }; - }; - switch (_method) do { case 0: { _newObj setposATL (getPosATL _object); @@ -65,10 +28,25 @@ if (!isNull _object && !(_class isEqualTo "")) then { }; deleteVehicle _object; - // force nearby players to reveal new object faster - _playersNear = _newObj nearEntities[["Epoch_Male_F", "Epoch_Female_F"], 300]; - [_newObj, {player reveal _this}] remoteExec ["call", _playersNear]; - + _serverSettingsConfig = configFile >> "CfgEpochServer"; + _UseIndestructible = [_serverSettingsConfig, "UseIndestructible", false] call EPOCH_fnc_returnConfigEntry; + _IndestructibleBaseObjects = [_serverSettingsConfig, "IndestructibleBaseObjects", []] call EPOCH_fnc_returnConfigEntry; + _ExceptedBaseObjects = [_serverSettingsConfig, "ExceptedBaseObjects", []] call EPOCH_fnc_returnConfigEntry; + if (_UseIndestructible) then { + if ({_class iskindof _x} count _ExceptedBaseObjects == 0) then { + { + if (_class iskindof _x) exitwith { + _newObj allowdamage false; + }; + } foreach _IndestructibleBaseObjects; + }; + }; + // new Dynamicsimulation + if([configFile >> "CfgEpochServer", "baseDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry)then + { + _newObj enableDynamicSimulation true; + _newObj triggerDynamicSimulation false; // this object doesnt need to turn anything on in the server + }; }; }; _newObj