fixes part 2

This commit is contained in:
vbawol 2017-09-26 17:16:13 -05:00
parent c4bf9c65ee
commit e675d29752
2 changed files with 6 additions and 8 deletions

View File

@ -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);
};

View File

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