Change publishVeh2 and 3 to call instead of spawn

Following 95b3174 it is now possible to use call to avoid suspension mid
execution as described in:

https://epochmod.com/forum/topic/43805-epoch-shed_safetyvehiclesqf-issue/?tab=comments#comment-292696
This commit is contained in:
ebayShopper
2017-11-11 15:59:23 -05:00
parent 67f89ceb53
commit 9574aca91e
4 changed files with 14 additions and 34 deletions

View File

@@ -94,8 +94,8 @@ if (isServer) then {
// EPOCH ADDITIONS
"PVDZE_maintainArea" addPublicVariableEventHandler {(_this select 1) spawn server_maintainArea};
"PVDZE_obj_Swap" addPublicVariableEventHandler {(_this select 1) spawn server_swapObject}; //Used to downgrade and upgrade Epoch buildables
"PVDZE_veh_Publish2" addPublicVariableEventHandler {(_this select 1) spawn server_publishVeh2}; //Used to purchase vehicles at traders
"PVDZE_veh_Upgrade" addPublicVariableEventHandler {(_this select 1) spawn server_publishVeh3}; //Used for car upgrades
"PVDZE_veh_Publish2" addPublicVariableEventHandler {(_this select 1) call server_publishVeh2}; //Used to purchase vehicles at traders
"PVDZE_veh_Upgrade" addPublicVariableEventHandler {(_this select 1) call server_publishVeh3}; //Used for car upgrades
"PVDZE_obj_Trade" addPublicVariableEventHandler {(_this select 1) spawn server_tradeObj};
if (!DZE_ConfigTrader) then {
"PVDZE_plr_TradeMenu" addPublicVariableEventHandler {(_this select 1) spawn server_traders};

View File

@@ -84,10 +84,14 @@ if (_outcome != "PASS") then {
if(DZE_TRADER_SPAWNMODE) then {
_object attachTo [_object_para, [0,0,-1.6]];
uiSleep 1;
WaitUntil{(([_object] call FNC_GetPos) select 2) < 0.1};
detach _object;
deleteVehicle _object_para;
[_object,_object_para] spawn {
_object = _this select 0;
_object_para = _this select 1;
uiSleep 1;
waitUntil {([_object] call fnc_getPos) select 2 < 0.1};
detach _object;
deleteVehicle _object_para;
};
};
_object call fnc_veh_ResetEH;

View File

@@ -1,4 +1,4 @@
private ["_activatingPlayer","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey","_result","_outcome","_oid","_countr","_objectID","_objectUID","_newobject","_weapons","_magazines","_backpacks","_objWpnTypes","_objWpnQty","_clientKey","_exitReason","_playerUID"];
private ["_activatingPlayer","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey","_result","_outcome","_oid","_objectID","_objectUID","_newobject","_weapons","_magazines","_backpacks","_clientKey","_exitReason","_playerUID"];
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
if (count _this < 7) exitWith {
@@ -93,33 +93,8 @@ if (_outcome != "PASS") then {
_object setVariable ["lastUpdate",diag_tickTime];
_object setVariable ["CharacterID", _characterID, true];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
//Add weapons
_objWpnTypes = _weapons select 0;
_objWpnQty = _weapons select 1;
_countr = 0;
{
_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} count _objWpnTypes;
//Add Magazines
_objWpnTypes = _magazines select 0;
_objWpnQty = _magazines select 1;
_countr = 0;
{
_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} count _objWpnTypes;
//Add Backpacks
_objWpnTypes = _backpacks select 0;
_objWpnQty = _backpacks select 1;
_countr = 0;
{
_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} count _objWpnTypes;
[_weapons,_magazines,_backpacks,_object] call server_addCargo;
_object setDir _dir;
_object setPosATL _location;