Files
Clarksons_Logi_Framework/Addons/logistics/functions/init/fnc_initEngineeringBay.sqf
T

44 lines
1.2 KiB
Plaintext

#include "..\..\script_component.hpp"
/*
* Author: Clarky
* Description:
* Initialises an Engineering Bay. Intended to be called as a function by internal processes, or exposed as a module in Eden and Zeus
*
* Arguments:
* 0: Linked HQ <OBJECT>
* 1: Engineering Bay <OBJECT>
*
* Usage:
* [_hq, this] call CLRK_fnc_initEngineeringBay
*
*/
params [["_hq", "", ["", objNull]], "_engineering"];
if (!isServer) exitWith {};
_engineering setVariable ["isEngineeringBay", true, true];
// Wait to run the initialisaion for mission start -- Prevents base push until HQ object is initialised
if (_hq isNotEqualTo "") then {
[
{
params ["_engineering", "_hq"];
_engineering setVariable ["hq", _hq, true];
private _baseDetails = _hq getVariable "baseDetails";
private _buildings = _baseDetails get "buildings";
_buildings pushBack _engineering;
},
[_engineering, _hq],
2
] call CBA_fnc_waitAndExecute;
};
// Set object to invulnerable -- May be removed once base building is fully implemented.
[_engineering, false] remoteExec ["allowDamage", 0, true];
[_engineering] remoteExecCall [
"CLF_fnc_initEngineeringBayInteractions",
0,
true
];