diff --git a/Sources/epoch_code/compile/both/EPOCH_compiler.sqf b/Sources/epoch_code/compile/both/EPOCH_compiler.sqf index a11d7028..65e4c079 100644 --- a/Sources/epoch_code/compile/both/EPOCH_compiler.sqf +++ b/Sources/epoch_code/compile/both/EPOCH_compiler.sqf @@ -42,8 +42,6 @@ _header = ""; _header = _header + format["_player%1Key = 'EPOCH_%2';",_x, round(diag_tickTime + random 99999)]; } forEach _customVarNames; -diag_log format["DEBUG: _header: %1",_header]; - _version = getNumber(_config >> "version"); if (_version >= 1) then { { @@ -77,7 +75,6 @@ if (_version >= 1) then { _code = ""; if (getNumber(_x >> "customHeader") == 1) then { _code = _header + (preprocessFileLineNumbers _fnc_path); - diag_log _code; } else { _code = (preprocessFileLineNumbers _fnc_path); }; diff --git a/Sources/epoch_code/compile/setup/masterLoop/init.sqf b/Sources/epoch_code/compile/setup/masterLoop/init.sqf index a34c5b8d..421d2910 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/init.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/init.sqf @@ -25,12 +25,13 @@ _customVarLimits = _customVarsInit apply {_x param [2,[]]}; // init limits and keys { - _varLimits = _customVarLimits select _forEachIndex; + _varLimits = _customVarLimits select _forEachIndex; _varDefault = _defaultVarValues select _foreachindex; - call compile format['if (isNil "_player%1Key") then {_player%1Key = "EPOCH_player%1"}; - _varLimits params [["_player%1Max",100],["_player%1Min",0]]; - _player%1 = missionNamespace getVariable ["_player%1Key", _varDefault]; - ',_x]; + _varName = format["EPOCH_player%1",_x]; + _varNameTmp = call compile format["_player%1Key",_x]; + if !(isNil "_varNameTmp") then {_varName = _varNameTmp}; + _varLimits params [[format["_player%1Max",_x],100],[format["_player%1Min",_x],0]]; + call compile format['_player%1 = missionNamespace getVariable [_varName, _varDefault];',_x]; } forEach _customVarNames; EPOCH_playerEnergyMax = _playerEnergyMax;