From 4e35d15b141e48d2cae756fa8cbeface7ba1311b Mon Sep 17 00:00:00 2001 From: Skaronator Date: Sat, 1 Mar 2014 19:01:51 +0100 Subject: [PATCH] Fix #1150 --- SQF/dayz_server/modules/crash_spawner.sqf | 20 +++++++++----------- SQF/dayz_server/modules/hello_world.sqf | 3 --- SQF/dayz_server/modules/supply_drop.sqf | 18 +++++++++--------- 3 files changed, 18 insertions(+), 23 deletions(-) delete mode 100644 SQF/dayz_server/modules/hello_world.sqf diff --git a/SQF/dayz_server/modules/crash_spawner.sqf b/SQF/dayz_server/modules/crash_spawner.sqf index d68288d39..44941f626 100644 --- a/SQF/dayz_server/modules/crash_spawner.sqf +++ b/SQF/dayz_server/modules/crash_spawner.sqf @@ -74,24 +74,22 @@ if (_spawnRoll <= _spawnChance) then { _crash setvariable ["fadeFire",_fadeFire,true]; }; - _config = configFile >> "CfgBuildingLoot" >> _lootTable; - if (DZE_MissionLootTable) then { - _config = missionConfigFile >> "CfgBuildingLoot" >> _lootTable;; + if (DZE_MissionLootTable) then { + _itemTypes = [] + getArray (missionConfigFile >> "CfgBuildingLoot" >> _lootTable >> "lootType"); + } else { + _itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType"); }; - _itemTypes = [] + getArray (_config >> "itemType"); - _index = dayz_CBLBase find toLower(_lootTable); - _weights = dayz_CBLChances select _index; + _CBLBase = dayz_CBLBase find _lootTable; + _weights = dayz_CBLChances select _CBLBase; _cntWeights = count _weights; for "_x" from 1 to _num do { //create loot - _index = floor(random _cntWeights); - _index = _weights select _index; - _itemType = _itemTypes select _index; + _index1 = floor(random _cntWeights); + _index2 = _weights select _index1; + _itemType = _itemTypes select _index2; [_itemType select 0, _itemType select 1, _position, 5] call spawn_loot; - //diag_log(format["CRASHSPAWNER: Loot spawn at '%1' with loot table '%2'", _crashName, _lootTable]); }; - // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items. _nearby = _position nearObjects ["ReammoBox", sizeOf(_crashModel)]; { diff --git a/SQF/dayz_server/modules/hello_world.sqf b/SQF/dayz_server/modules/hello_world.sqf deleted file mode 100644 index 2c6bc3293..000000000 --- a/SQF/dayz_server/modules/hello_world.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// Sample Hello World - -[nil,nil,"per",rTITLETEXT,"Welcome to DayzEpoch","PLAIN DOWN"] call RE; diff --git a/SQF/dayz_server/modules/supply_drop.sqf b/SQF/dayz_server/modules/supply_drop.sqf index 4c692a2c3..3951a24f6 100644 --- a/SQF/dayz_server/modules/supply_drop.sqf +++ b/SQF/dayz_server/modules/supply_drop.sqf @@ -40,20 +40,20 @@ if (_spawnRoll <= _spawnChance) then { _num = (round(random _randomizedLoot)) + _guaranteedLoot; - _config = configFile >> "CfgBuildingLoot" >> _lootTable; - if (DZE_MissionLootTable) then { - _config = missionConfigFile >> "CfgBuildingLoot" >> _lootTable;; + if (DZE_MissionLootTable) then { + _itemTypes = [] + getArray (missionConfigFile >> "CfgBuildingLoot" >> _lootTable >> "lootType"); + } else { + _itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType"); }; - _itemTypes = [] + getArray (_config >> "itemType"); - _index = dayz_CBLBase find toLower(_lootTable); - _weights = dayz_CBLChances select _index; + _CBLBase = dayz_CBLBase find _lootTable; + _weights = dayz_CBLChances select _CBLBase; _cntWeights = count _weights; for "_x" from 1 to _num do { //create loot - _index = floor(random _cntWeights); - _index = _weights select _index; - _itemType = _itemTypes select _index; + _index1 = floor(random _cntWeights); + _index2 = _weights select _index1; + _itemType = _itemTypes select _index2; [_itemType select 0, _itemType select 1, _position, 5] call spawn_loot; };