mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-04-17 09:53:21 +03:00
Consolidate weapon/magazine/backpack adding to function
This moves a lot of duplicated code from a server side only function (server_addCargo) to a client/server function called fn_addCargo.
This commit is contained in:
@@ -66,7 +66,7 @@ switch (_status) do {
|
||||
if (DZE_permanentPlot) then {_holder setVariable ["ownerPUID",_ownerID,true];};
|
||||
deleteVehicle _obj;
|
||||
|
||||
[_weapons,_magazines,_backpacks,_holder] call server_addCargo;
|
||||
[_weapons,_magazines,_backpacks,_holder] call fn_addCargo;
|
||||
};
|
||||
case 1: { //Locking
|
||||
_lockedClass = getText (configFile >> "CfgVehicles" >> _type >> "lockedClass");
|
||||
@@ -110,7 +110,7 @@ switch (_status) do {
|
||||
_holder setDir _dir;
|
||||
_holder setPosATL _pos;
|
||||
_holder addMagazineCargoGlobal [getText(configFile >> "CfgVehicles" >> _packedClass >> "seedItem"),1];
|
||||
[_weapons,_magazines,_backpacks,_holder] call server_addCargo;
|
||||
[_weapons,_magazines,_backpacks,_holder] call fn_addCargo;
|
||||
|
||||
// Delete safe from database
|
||||
[_objectID,_objectUID] call server_deleteObjDirect;
|
||||
|
||||
@@ -69,12 +69,12 @@ if (_outcome != "PASS") then {
|
||||
#endif
|
||||
|
||||
// add items from previous vehicle here
|
||||
_weapons = getWeaponCargo _object;
|
||||
_magazines = getMagazineCargo _object;
|
||||
_backpacks = getBackpackCargo _object;
|
||||
_weapons = getWeaponCargo _object;
|
||||
_magazines = getMagazineCargo _object;
|
||||
_backpacks = getBackpackCargo _object;
|
||||
|
||||
clearWeaponCargoGlobal _object;
|
||||
clearMagazineCargoGlobal _object;
|
||||
clearWeaponCargoGlobal _object;
|
||||
clearMagazineCargoGlobal _object;
|
||||
clearBackpackCargoGlobal _object;
|
||||
|
||||
deleteVehicle _object;
|
||||
@@ -85,7 +85,7 @@ if (_outcome != "PASS") then {
|
||||
|
||||
// switch var to new vehicle at this point.
|
||||
_object = _newobject;
|
||||
|
||||
|
||||
_object setVariable ["ObjectID", _oid, true];
|
||||
_object setVariable ["lastUpdate",diag_tickTime];
|
||||
_object setVariable ["CharacterID", _characterID, true];
|
||||
@@ -94,8 +94,8 @@ if (_outcome != "PASS") then {
|
||||
_object setDir _dir;
|
||||
_object setPosATL _location;
|
||||
_object setVectorUp surfaceNormal _location;
|
||||
|
||||
[_weapons,_magazines,_backpacks,_object] call server_addCargo;
|
||||
|
||||
[_weapons,_magazines,_backpacks,_object] call fn_addCargo;
|
||||
|
||||
_object call fnc_veh_ResetEH;
|
||||
// for non JIP users this should make sure everyone has eventhandlers for vehicles.
|
||||
@@ -106,4 +106,4 @@ if (_outcome != "PASS") then {
|
||||
(owner _activatingPlayer) publicVariableClient "dze_waiting";
|
||||
|
||||
diag_log format["PUBLISH: %1(%2) upgraded %3 with UID %4 @%5",(_activatingPlayer call fa_plr2str),_playerUID,_class,_uid,(_location call fa_coor2str)];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -36,7 +36,6 @@ server_sendToClient = compile preprocessFileLineNumbers "\z\addons\dayz_server\e
|
||||
server_verifySender = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_verifySender.sqf";
|
||||
|
||||
// EPOCH ADDITIONS
|
||||
server_addCargo = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_addCargo.sqf";
|
||||
server_swapObject = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_swapObject.sqf"; //Used to downgrade and upgrade Epoch buildables
|
||||
server_publishVeh = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle.sqf"; //Used to spawn random vehicles by server
|
||||
server_publishVeh2 = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle2.sqf"; //Used to purchase vehicles at traders
|
||||
|
||||
Reference in New Issue
Block a user