Simplify addon checking code

This commit is contained in:
SilentSpike
2015-06-29 14:15:46 +01:00
parent e4f89a96b7
commit 873936dc31

View File

@ -85,17 +85,16 @@ if (isMultiplayer) then {
}; };
}; };
{ _addons = _addons - GVAR(ServerAddons);
if !(_x in GVAR(ServerAddons)) then { if !(_addons isEqualTo []) then {
_errorMsg = format ["Client/Server Addon Mismatch. Client has extra addon: %1.",_x]; _errorMsg = format ["Client/Server Addon Mismatch. Client has extra addons: %1.",_addons];
diag_log text format ["[ACE] ERROR: %1", _errorMsg]; diag_log text format ["[ACE] ERROR: %1", _errorMsg];
if (hasInterface) then {diag_log str "1"; if (hasInterface) then {diag_log str "1";
["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage);
};
}; };
} forEach _addons; };
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}, 1, [_version,_addons]] call CBA_fnc_addPerFrameHandler; }, 1, [_version,_addons]] call CBA_fnc_addPerFrameHandler;