Use playersNumber for player count in sched_animals #1889

This won't count AI units unless they are spawned on side west.
This commit is contained in:
ebaydayz
2017-01-30 13:41:19 -05:00
parent 2ecb614534
commit 752ed00566
2 changed files with 17 additions and 23 deletions

View File

@@ -3,7 +3,7 @@
sched_animals = {
HIDE_FSM_VARS
private ["_min","_count","_global","_obj","_x","_animalssupported","_type","_root","_favouritezones","_angle","_radius","_randrefpoint","_PosList","_Pos","_agent","_pos", "_vehicle", "_speed", "_i"];
private ["_min","_count","_global","_obj","_x","_animalssupported","_type","_root","_favouritezones","_angle","_radius","_randrefpoint","_PosList","_Pos","_agent","_pos", "_vehicle", "_speed"];
_min = diag_fpsmin;
_vehicle = vehicle player;
_count = 0;
@@ -43,31 +43,25 @@ sched_animals = {
if (_speed distance [0,0,0] > 12) exitWith {objNull};
if ((_vehicle != player) AND {((count crew _vehicle > 1) AND {(driver _vehicle != player)})}) exitWith {objNull};
//diag_log [ dayz_maxGlobalAnimals / (1 max count playableUnits), ceil(1.2*(dayz_maxGlobalAnimals - _global) / (1 max count playableUnits)) min (dayz_maxAnimals - _count), _global,dayz_maxAnimals, _count, dayz_maxGlobalAnimals, _global ];
for "_x" from 0 max (2 min (ceil(1.5*(dayz_maxGlobalAnimals - _global) / (1 max count playableUnits)) min (dayz_maxAnimals - _count))) to 1 step -1 do {
_animalssupported = ["hen","hen","hen","Cow","Sheep","WildBoar","WildBoar","WildBoar","Goat","Rabbit","Rabbit"];
//diag_log [ dayz_maxGlobalAnimals / (1 max (playersNumber west)), ceil(1.2*(dayz_maxGlobalAnimals - _global) / (1 max (playersNumber west))) min (dayz_maxAnimals - _count), _global,dayz_maxAnimals, _count, dayz_maxGlobalAnimals, _global ];
for "_x" from 0 max (2 min (ceil(1.5*(dayz_maxGlobalAnimals - _global) / (1 max (playersNumber west))) min (dayz_maxAnimals - _count))) to 1 step -1 do {
_animalssupported = ["Hen","Hen","Hen","Cow","Sheep","WildBoar","WildBoar","WildBoar","Goat","Rabbit","Rabbit"];
if (dayz_tameDogs) then {_animalssupported set [count _animalssupported,"Dog"];};
_type = _animalssupported select floor random count _animalssupported;
if (_type == "Cow") then {
_animalssupported = ["Cow01","Cow02","Cow03","Cow04","Cow01_EP1"];
_type = _animalssupported select floor random count _animalssupported;
};
if (_type == "Goat") then {
_animalssupported = ["Goat","Goat01_EP1","Goat02_EP1"];
_type = _animalssupported select floor random count _animalssupported;
};
if (_type == "Sheep") then {
_animalssupported = ["Sheep","Sheep01_EP1","Sheep02_EP1"];
_type = _animalssupported select floor random count _animalssupported;
};
if (_type == "hen") then {
_animalssupported = ["hen","Cock"];
_type = _animalssupported select floor random count _animalssupported;
};
if (_type == "Dog") then {
_animalssupported = ["Fin","Pastor"];
_animalssupported = switch _type do {
case "Hen": {["Hen","Cock"]};
case "Cow": {["Cow01","Cow02","Cow03","Cow04","Cow01_EP1"]};
case "Goat": {["Goat","Goat01_EP1","Goat02_EP1"]};
case "Sheep": {["Sheep","Sheep01_EP1","Sheep02_EP1"]};
case "Dog": {["Fin","Pastor"]};
default {_animalssupported};
};
if (count _animalssupported < 6) then {
_type = _animalssupported select floor random count _animalssupported;
};
_root = configFile >> "CfgVehicles" >> _type;
_favouritezones = getText ( _root >> "favouritezones");
_angle = (random 120) - 60;