diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf index 515d9b5d..e1afb736 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf @@ -227,9 +227,7 @@ if !(EPOCH_ActiveTraderMission isequalto []) then { [format ["%1",_diag], 5] call Epoch_message; }; if(count _taskReward > 0) then { - _retTaskWH = objNull; - _retTaskWH = createVehicle ["GroundWeaponHolder",getPosATL player,[],0,"CAN_COLLIDE"]; - [player,Epoch_personalToken,_taskReward,[],_retTaskWH,false] remoteExec ["EPOCH_Server_createObject",2]; + [player,Epoch_personalToken,_taskReward,[],objNull,false] remoteExec ["EPOCH_Server_createObject",2]; }; if !(str(_taskCompleteCall) == "{}") then { call _taskCompleteCall; diff --git a/Sources/epoch_code/compile/setup/masterLoop/init.sqf b/Sources/epoch_code/compile/setup/masterLoop/init.sqf index c2439278..744bc874 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/init.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/init.sqf @@ -151,9 +151,7 @@ _EPOCH_BuildTraderMisson = { _triggerintervall = getNumber ( _inGameTasksconfig >> _taskName >> "triggerintervall"); _taskItems = getArray ( _inGameTasksconfig >> _taskName >> "items"); if !(_taskItems isequalto []) then { - _wh = objNull; - _wh = createVehicle ["GroundWeaponHolder",getPosATL player,[],0,"CAN_COLLIDE"]; - [player,Epoch_personalToken,_taskItems,[],_wh,false] remoteExec ["EPOCH_Server_createObject",2]; + [player,Epoch_personalToken,_taskItems,[],objNull,false] remoteExec ["EPOCH_Server_createObject",2]; }; _taskMarkerType = getnumber (_inGameTasksconfig >> _taskName >> 'markerType'); diff --git a/Sources/epoch_config/Configs/CfgMissions/CfgmissionDelivery.hpp b/Sources/epoch_config/Configs/CfgMissions/CfgmissionDelivery.hpp index fb14713a..5921faa4 100644 --- a/Sources/epoch_config/Configs/CfgMissions/CfgmissionDelivery.hpp +++ b/Sources/epoch_config/Configs/CfgMissions/CfgmissionDelivery.hpp @@ -120,7 +120,7 @@ class finishDelivery { faileddialogues[] = {}; completeCondition = "diag_ticktime - EPOCH_task_startTime > 16 && axeRndBadNews > 5"; completedialogues[] = {"Take your reward, you have earnt it","Here is your reward, you are a great courier.","Any time you need work, come and see me, great job."}; - completedCALL = "_wh = createVehicle[""groundWeaponHolder"",getPosATL player,[],0,""CAN_COLLIDE""];[_wh,""Pelican_EPOCH""] remoteExec [""EPOCH_serverLootObject"",2];"; + completedCALL = "[objnull,""Pelican_EPOCH"",true,getposatl player] remoteExec [""EPOCH_serverLootObject"",2];"; reward[] = {}; cleanUp = 1; nextTask[] = {}; diff --git a/Sources/epoch_config/Configs/CfgMissions/CfgmissionFish.hpp b/Sources/epoch_config/Configs/CfgMissions/CfgmissionFish.hpp index 64fec35d..bdefffe4 100644 --- a/Sources/epoch_config/Configs/CfgMissions/CfgmissionFish.hpp +++ b/Sources/epoch_config/Configs/CfgMissions/CfgmissionFish.hpp @@ -132,7 +132,7 @@ class FinishFishMission { faileddialogues[] = {}; completeCondition = "true"; completedialogues[] = {"Take your reward, you have earnt it","Here is your reward, you are a great fisher man.","Any time you need work, come and see me, great job."}; - completedCALL = "_WH = createVehicle[""groundWeaponHolder"",getPosATL player,[],0,""CAN_COLLIDE""];[_WH,""Mission_Fishing_Payout""] remoteExec [""EPOCH_serverLootObject"",2];"; + completedCALL = "[objnull,""Mission_Fishing_Payout"",true,getposatl player] remoteExec [""EPOCH_serverLootObject"",2];"; reward[] = {}; cleanUp = 1; nextTask[] = {}; diff --git a/Sources/epoch_config/Configs/CfgMissions/CfgmissionMonster.hpp b/Sources/epoch_config/Configs/CfgMissions/CfgmissionMonster.hpp index ab04f816..d9e6d132 100644 --- a/Sources/epoch_config/Configs/CfgMissions/CfgmissionMonster.hpp +++ b/Sources/epoch_config/Configs/CfgMissions/CfgmissionMonster.hpp @@ -127,7 +127,7 @@ class finishMonsterEscort { faileddialogues[] = {}; completeCondition = "true"; completedialogues[] = {"Take your reward, you have earnt it","Here is your reward, you are a great courier.","Any time you need work, come and see me, great job."}; - completedCALL = "_WH = createVehicle[""groundWeaponHolder"",getPosATL player,[],0,""CAN_COLLIDE""];[_WH,""Mission_Monster_Payout""] remoteExec [""EPOCH_serverLootObject"",2];"; + completedCALL = "[objnull,""Mission_Monster_Payout"",true,getposatl player] remoteExec [""EPOCH_serverLootObject"",2];"; reward[] = {}; cleanUp = 1; nextTask[] = {}; diff --git a/Sources/epoch_server/compile/epoch_server/EPOCH_serverLootObject.sqf b/Sources/epoch_server/compile/epoch_server/EPOCH_serverLootObject.sqf index f9dfdf44..5bd4e3cb 100644 --- a/Sources/epoch_server/compile/epoch_server/EPOCH_serverLootObject.sqf +++ b/Sources/epoch_server/compile/epoch_server/EPOCH_serverLootObject.sqf @@ -13,7 +13,7 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_server/EPOCH_serverLootObject.sqf */ private["_randomItemArray", "_quan", "_randomLootClass", "_randomItem", "_lootPaid", "_mags", "_lootItemWeightedArray", "_lootItemArray", "_weightedItemArray", "_exit", "_maxPayout", "_lootTable", "_lootTableArray", "_weightedArray"]; -params ["_object","_type",["_forceSpawn",false]]; +params ["_object","_type",["_forceSpawn",false],["_pos",[]]]; _debug = true; _pricingConfig = 'CfgPricing' call EPOCH_returnConfig; @@ -23,6 +23,9 @@ if !(EPOCH_forcedLootSpawnTable isEqualTo "") then { _lootTableClass = EPOCH_forcedLootSpawnTable; }; _randomizeMagazineAmmoCount = ["CfgEpochClient", "randomizeMagazineAmmoCount", true] call EPOCH_fnc_returnConfigEntryV2; +if (isnull _object && !(_pos isequalto [])) then { + _object = createVehicle ["groundWeaponHolder",_pos,[],0,"CAN_COLLIDE"]; +}; if !(isNull _object) then{ _lootTable = [_type, "CfgMainTable", "tables"] call EPOCH_weightedArray; _lootTable params ["_lootTableArray","_weightedArray"];