mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +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:
@@ -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)];
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user