2015-02-03 05:52:07 +00:00
/*
2015-03-24 04:18:00 +00:00
* Author: esteldunedain
2015-02-03 05:52:07 +00:00
*
* Reads a setting value from a module, set it and force it. Logs if the setting is missing from the module.
* Must be called on the server, effect is global.
*
* Arguments:
2015-09-18 23:50:17 +00:00
* 0: Module <OBJECT>
* 1: ACE_Parameter name <STRING>
* 2: Module parameter name <STRING>
2015-02-03 05:52:07 +00:00
*
* Return Value:
* None
2015-09-18 23:50:17 +00:00
*
* Public: No
2015-02-03 05:52:07 +00:00
*/
#include "script_component.hpp"
if !(isServer) exitWith {};
2015-09-18 23:50:17 +00:00
params ["_logic", "_settingName", "_moduleVariable"];
2015-02-03 05:52:07 +00:00
// Check if the parameter is defined in the module
if (isNil {_logic getVariable _moduleVariable}) exitWith {
2015-08-26 15:51:56 +00:00
ACE_LOGWARNING_2("Warning in %1 module: %2 setting is missing. Probably an obsolete version of the module is used in the mission.",typeOf _logic,_moduleVariable);
2015-02-03 05:52:07 +00:00
};
// Set the setting globally and force it
[_settingName, _logic getVariable _moduleVariable, true, true] call FUNC(setSetting);