Fixed: max litter scalar array, have internal values.

This commit is contained in:
jaynus 2015-04-19 09:04:42 -07:00
parent 20740679cc
commit aad8d6b785
2 changed files with 8 additions and 3 deletions

View File

@ -79,7 +79,11 @@ class ACE_Settings {
displayName = "$STR_ACE_Medical_litterSimulationDetail";
description = "$STR_ACE_Medical_litterSimulationDetail_Desc";
typeName = "SCALAR";
value = 500;
value = 3;
values[] = {"Off", "Low", "Medium", "High", "Ultra"};
_values[] = { 0, 50, 100, 1000, 5000 };
isClientSettable = 1;
};
class GVAR(litterCleanUpDelay) {

View File

@ -4,7 +4,7 @@
if(!hasInterface) exitWith { false };
PARAMS_3(_litterClass,_position,_direction);
private["_litterObject"];
private["_litterObject", "_maxLitterCount"];
if (isNil QGVAR(allCreatedLitter)) then {
GVAR(allCreatedLitter) = [];
@ -14,7 +14,8 @@ if (isNil QGVAR(allCreatedLitter)) then {
_litterObject = _litterClass createVehicleLocal _position;
_litterObject setDir _direction;
if((count GVAR(allCreatedLitter)) > GVAR(litterSimulationDetail) ) then {
_maxLitterCount = getArray (configFile >> "ACE_Settings" >> QGVAR(litterSimulationDetail) >> "_values") select GVAR(litterSimulationDetail);
if((count GVAR(allCreatedLitter)) > _maxLitterCount ) then {
// gank the first litter object, and spawn ours.
private["_oldLitter"];
_oldLitter = GVAR(allCreatedLitter) deleteAt 0;