mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Fix private arrays
Fix issue with wild zeds not spawning loot (idk if they it didnt work before, but _loottypecfg was nil so it probably didnt)
This commit is contained in:
@@ -4,7 +4,7 @@ scriptName "Functions\misc\fn_damageActions.sqf";
|
||||
- Function
|
||||
- [] call fnc_usec_damageActions;
|
||||
************************************************************/
|
||||
private ["_action","_weaponName","_turret","_weapons","_assignedRole","_driver","_action1","_action2","_x","_vehicle","_unit","_vehType","_type","_typeVeh","_isDisallowRefuel","_vehClose","_hasVehicle","_unconscious","_lowBlood","_injured","_inPain","_legsBroke","_armsBroke","_charID","_friendlies","_playerMagazines","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_hasJerry","_hasBarrel","_hasJerryE","_hasBarrelE","_hasPainkillers","_unconscious_crew","_patients","_crew","_menClose","_hasPatient","_inVehicle","_isClose"];
|
||||
private ["_action","_weaponName","_turret","_weapons","_assignedRole","_driver","_action1","_action2","_vehicle","_unit","_vehType","_type","_typeVeh","_isDisallowRefuel","_vehClose","_hasVehicle","_unconscious","_lowBlood","_injured","_inPain","_legsBroke","_armsBroke","_charID","_friendlies","_playerMagazines","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_hasJerry","_hasBarrel","_hasJerryE","_hasBarrelE","_hasPainkillers","_unconscious_crew","_patients","_crew","_menClose","_hasPatient","_inVehicle","_isClose"];
|
||||
|
||||
disableSerialization;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private ["_item","_itemTypes","_qty","_tQty","_uniq"];
|
||||
private ["_iPos","_tQty","_qty","_index","_weights","_cntWeights","_canType","_item","_itemTypes","_max","_magQty","_mags","_iItem","_iClass","_radius","_uniq","_iPosZ"];
|
||||
|
||||
_iItem = _this select 0;
|
||||
_iClass = _this select 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private ["_position","_doLoiter","_unitTypes","_loot","_array","_agent","_type","_radius","_method","_myDest","_newDest","_lootType","_player","_isAlive","_rnd","_id"];
|
||||
private ["_unitTypes","_lootType","_lootTypeCfg","_loot_count","_index","_weights","_loot","_array","_player","_doLoiter","_agent","_type","_radius","_method","_position","_isAlive","_myDest","_newDest","_rnd","_id"];
|
||||
_player = _this select 0;
|
||||
|
||||
_unitTypes = [];
|
||||
@@ -51,36 +51,34 @@ _agent setVariable ["newDest",_newDest];
|
||||
_rnd = random 1;
|
||||
if (_rnd > 0.3) then {
|
||||
if (DZE_MissionLootTable) then {
|
||||
_lootType = missionConfigFile >> "CfgVehicles" >> _type >> "zombieLoot";
|
||||
_lootType = getText (missionConfigFile >> "CfgVehicles" >> _type >> "zombieLoot");
|
||||
} else {
|
||||
_lootType = configFile >> "CfgVehicles" >> _type >> "zombieLoot";
|
||||
_lootType = getText (configFile >> "CfgVehicles" >> _type >> "zombieLoot");
|
||||
};
|
||||
|
||||
if (isText _lootType) then {
|
||||
if (DZE_MissionLootTable) then {
|
||||
_lootTypeCfg = getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType));
|
||||
} else {
|
||||
_lootTypeCfg = getArray (configFile >> "cfgLoot" >> getText(_lootType));
|
||||
};
|
||||
_array = [];
|
||||
{
|
||||
_array set [count _array, _x select 0]
|
||||
} foreach _lootTypeCfg;
|
||||
if (count _array > 0) then {
|
||||
_index = dayz_CLBase find getText(_lootType);
|
||||
_weights = dayz_CLChances select _index;
|
||||
_loot = _array select (_weights select (floor(random (count _weights))));
|
||||
if(!isNil "_array") then {
|
||||
if (DZE_MissionLootTable) then {
|
||||
_loot_count = getNumber(missionConfigFile >> "CfgMagazines" >> _loot >> "count");
|
||||
} else {
|
||||
_loot_count = getNumber(configFile >> "CfgMagazines" >> _loot >> "count");
|
||||
};
|
||||
if(_loot_count>1) then {
|
||||
_agent addMagazine [_loot, ceil(random _loot_count)];
|
||||
} else {
|
||||
_agent addMagazine _loot;
|
||||
};
|
||||
if (DZE_MissionLootTable) then {
|
||||
_lootTypeCfg = getArray (missionConfigFile >> "CfgLoot" >> _lootType);
|
||||
} else {
|
||||
_lootTypeCfg = getArray (configFile >> "CfgLoot" >> _lootType);
|
||||
};
|
||||
_array = [];
|
||||
{
|
||||
_array set [count _array, _x select 0]
|
||||
} foreach _lootTypeCfg;
|
||||
if (count _array > 0) then {
|
||||
_index = dayz_CLBase find _lootType;
|
||||
_weights = dayz_CLChances select _index;
|
||||
_loot = _array select (_weights select (floor(random (count _weights))));
|
||||
if(!isNil "_array") then {
|
||||
if (DZE_MissionLootTable) then {
|
||||
_loot_count = getNumber(missionConfigFile >> "CfgMagazines" >> _loot >> "count");
|
||||
} else {
|
||||
_loot_count = getNumber(configFile >> "CfgMagazines" >> _loot >> "count");
|
||||
};
|
||||
if(_loot_count>1) then {
|
||||
_agent addMagazine [_loot, ceil(random _loot_count)];
|
||||
} else {
|
||||
_agent addMagazine _loot;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user