Attempting to fix module value not being read

This commit is contained in:
SAM 2015-05-09 12:36:11 +02:00
parent f64f76e92f
commit a9d6fbd841
4 changed files with 7 additions and 5 deletions

View File

@ -9,7 +9,7 @@ class ACE_Settings {
};
class GVAR(limit) {
typeName = "SCALAR";
value = 10000; // Value, NOT index.
value = 10000; // Value, NOT index. 10000 is the maximum in A3
displayName = "View Distance Limit";
description = "Limit for client's view distance set here and can overridden by module";
};

View File

@ -10,10 +10,10 @@ class CfgVehicles {
//icon = ""; // needs an icon
class Arguments {
class moduleViewDistanceLimit {
displayName = "View Distance setting limit";
displayName = "View Distance Limit";
description = "Sets the limit for how high clients can raise their view distance (< 10000)";
typeName = "SCALAR";
defaultValue = 5000;
defaultValue = 6000;
};
};
};

View File

@ -24,6 +24,8 @@ _new_view_distance = [GVAR(viewDistance)] call FUNC(returnValue);
_view_distance_limit = GVAR(limit); // Grab the limit
diag_log format ["[ACE]: DEBUG View Distance change requested: %1 Limit is: %2 Under Limit: %3",_new_view_distance,_view_distance_limit,_new_view_distance<_view_distance_limit]; // ONLY FOR DEBUG, REMOVE LATER ON
if (_new_view_distance <= _view_distance_limit) then {
_text = composeText ["View distance successfully changed to: ",str(_new_view_distance)];
[_text,1] call EFUNC(common,displayTextStructured);

View File

@ -25,6 +25,6 @@ if (!_activated) exitWith {
diag_log text "[ACE]: View Distance Limit Module is placed but NOT active.";
};
diag_log text "[ACE]: View Distance Limit Module Initialized.";
[_logic, QGVAR(limit),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(limit),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule);
diag_log format ["[ACE]: View Distance Limit Module Initialized. Limit set by module: %1",GVAR(limit)];