client/addons/medical/functions/fnc_moveInventory.sqf
Jacob Schmidt 613f05d52a Refactor: Database and Client Updates
This commit introduces several changes related to database interactions and client-side functionality:

*   **Database Response Handling:** Implements a mechanism to handle responses from server requests, specifically for database operations. This includes setting up a callback system to process results based on request IDs.
*   **Store Functionality:** Corrects a typo in the `fnc_buyItem.sqf` script, changing `EFUNC(armory,addArmoryItem)` to `EFUNC(arsenal,addArmoryItem)`.
*   **Inventory Management:** Improves the `fnc_moveInventory.sqf` script by correcting a conditional statement to ensure proper handling of inventory items.
*   **Configuration Updates:** Updates the mod configuration (`CfgMods.hpp`) to use the correct path for the mod picture.
*   **Client Initialization:** Adds a client registration call to the server during client post-initialization (`XEH_postInit_client.sqf`).
*   **Workflow Update:** Updates the build workflow to use the latest Ubuntu runner.
*   **Database Preparation:** Removes unnecessary preparations from `XEH_postInit.sqf` and `XEH_PREP.hpp`.
2025-03-28 09:46:24 -05:00

65 lines
1.9 KiB
Plaintext

#include "..\script_component.hpp"
params ["_unit", "_bodyBag"];
private _items = [];
private _weapons = [];
private _backpack = backpack _unit;
private _nearHolders = _bodyBag nearObjects ["WeaponHolderSimulated", 3];
_items pushBack (headgear _unit);
_items pushBack (uniform _unit);
_items append (uniformItems _unit);
_items pushBack (vest _unit);
_items append (vestItems _unit);
_items append (backpackItems _unit);
_weapons pushBack (primaryWeapon _unit);
_items append (primaryWeaponItems _unit);
_items append (primaryWeaponMagazine _unit);
_weapons pushBack (secondaryWeapon _unit);
_items append (secondaryWeaponItems _unit);
_items append (secondaryWeaponMagazine _unit);
_weapons pushBack (handgunWeapon _unit);
_items append (handgunItems _unit);
_items append (handgunMagazine _unit);
_weapons append (_unit getVariable [QGVAR(droppedWeapons), []]);
_items append (_unit getVariable [QGVAR(droppedItems), []]);
_items append (assignedItems _unit);
_items pushBack (_unit call CFUNC(binocularMagazine));
if !((goggles _unit ) in (_unit getVariable [QGVAR(droppedItems), []])) then {
_items pushBack (goggles _unit);
};
_items = _items select {_x != ""};
_weapons = _weapons select {_x != ""};
{ _bodyBag addItemCargoGlobal [_x, 1] } forEach _items;
{
private _weaponNonPresent = [_x] call CFUNC(getNonPresetClass);
if (_weaponNonPresent == "") then {
_weaponNonPresent = _x;
};
_bodyBag addWeaponCargoGlobal [_weaponNonPresent, 1];
} forEach _weapons;
if (_backpack != "") then {
private _backpackNonPresent = [_backpack, "CfgVehicles"] call CFUNC(getNonPresetClass);
if (_backpackNonPresent == "") then {
_backpackNonPresent = _backpack;
};
_bodyBag addBackpackCargoGlobal [_backpackNonPresent, 1];
};
{
private _holderWeapons = ((getWeaponCargo _x) select 0) select { _x in _weapons };
if (_holderWeapons isNotEqualTo []) then {
deleteVehicle _x;
};
} forEach _nearHolders;