mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
randomizeMagazineAmmoCount option
This commit is contained in:
parent
8f837050af
commit
bff45ee5a4
@ -16,7 +16,8 @@
|
|||||||
[Changed] Change all publicVariableServer calls to use remoteExec calls for better performance.
|
[Changed] Change all publicVariableServer calls to use remoteExec calls for better performance.
|
||||||
[Fixed] Custom epoch swing animations for Hatchet and sledge now work correctly.
|
[Fixed] Custom epoch swing animations for Hatchet and sledge now work correctly.
|
||||||
**Server**
|
**Server**
|
||||||
[Changed] Driver or passengers of a driverless can now control vehicle locks.
|
[Added] Setting to control random magazine ammo counts in loot spawner. CfgEpochClient -> randomizeMagazineAmmoCount (default: true)
|
||||||
|
[Changed] Driver or passengers of a driverless can now control vehicle locks. Also only the owner can control locks from outside of a occupied vehicle.
|
||||||
[Changed] Commented out Halloween masks from loot tables.
|
[Changed] Commented out Halloween masks from loot tables.
|
||||||
[Updated] New Battleye remoteExec.txt for added remoteExec calls.
|
[Updated] New Battleye remoteExec.txt for added remoteExec calls.
|
||||||
[Info] Removed old .bikey and added new one for 0370.
|
[Info] Removed old .bikey and added new one for 0370.
|
||||||
|
Binary file not shown.
@ -2,6 +2,8 @@ private["_randomItemArray", "_quan", "_randomLootClass", "_type", "_randomItem",
|
|||||||
_object = _this select 0;
|
_object = _this select 0;
|
||||||
_type = _this select 1;
|
_type = _this select 1;
|
||||||
|
|
||||||
|
_randomizeMagazineAmmoCount = ["CfgEpochClient", "randomizeMagazineAmmoCount", true] call EPOCH_fnc_returnConfigEntryV2;
|
||||||
|
|
||||||
if !(isNull _object) then{
|
if !(isNull _object) then{
|
||||||
|
|
||||||
_lootTable = [_type, "CfgMainTable", "tables"] call EPOCH_weightedArray;
|
_lootTable = [_type, "CfgMainTable", "tables"] call EPOCH_weightedArray;
|
||||||
@ -62,10 +64,14 @@ if !(isNull _object) then{
|
|||||||
_loop = false;
|
_loop = false;
|
||||||
};
|
};
|
||||||
case "magazine": {
|
case "magazine": {
|
||||||
//_object addMagazineCargoGlobal [_randomItem, _quan];
|
if (_randomizeMagazineAmmoCount) then {
|
||||||
_magazineSize = getNumber (configFile >> "CfgMagazines" >> _randomItem >> "count");
|
// spawn a single Magazine with a random ammo count
|
||||||
_object addMagazineAmmoCargo[_randomItem, _quan, ceil(random(_magazineSize))];
|
_magazineSize = getNumber (configFile >> "CfgMagazines" >> _randomItem >> "count");
|
||||||
|
_object addMagazineAmmoCargo[_randomItem, _quan, ceil(random(_magazineSize))];
|
||||||
|
} else {
|
||||||
|
// spawn a single full Magazine
|
||||||
|
_object addMagazineCargoGlobal [_randomItem, _quan];
|
||||||
|
};
|
||||||
_loop = false;
|
_loop = false;
|
||||||
};
|
};
|
||||||
case "backpack": {
|
case "backpack": {
|
||||||
@ -77,9 +83,14 @@ if !(isNull _object) then{
|
|||||||
_mags = getArray (configFile >> "CfgWeapons" >> _randomItem >> "magazines");
|
_mags = getArray (configFile >> "CfgWeapons" >> _randomItem >> "magazines");
|
||||||
|
|
||||||
if !(_mags isEqualTo []) then {
|
if !(_mags isEqualTo []) then {
|
||||||
// add only one free magazine with random ammo count
|
if (_randomizeMagazineAmmoCount) then {
|
||||||
_magazineSize = getNumber (configFile >> "CfgMagazines" >> (_mags select 0) >> "count");
|
// spawn a single Magazine with a random ammo count
|
||||||
_object addMagazineAmmoCargo[_mags select 0, 1, ceil(random(_magazineSize))];
|
_magazineSize = getNumber (configFile >> "CfgMagazines" >> (_mags select 0) >> "count");
|
||||||
|
_object addMagazineAmmoCargo[_mags select 0, 1, ceil(random(_magazineSize))];
|
||||||
|
} else {
|
||||||
|
// spawn a single full Magazine with weapon
|
||||||
|
_object addMagazineCargoGlobal [_mags select 0, 1];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
_loop = false;
|
_loop = false;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user