Skip to content

Commit 4fb42bf

Browse files
committed
Fixed: Removing placeables not giving back virtual items
1 parent 091f3cd commit 4fb42bf

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Client Side/Framework/Functions/Placeables/fn_placeObject.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if (([] call ULP_fnc_placedObjects) >= _maxPlaceables) exitWith {
4545
private _object = createVehicle [_className, [0, 0, 0]];
4646
_object attachTo [player, _attachPoint];
4747
_object setDir _rot;
48-
_object setVariable ["object_owner", [getPlayerUID player, profileName], true];
48+
_object setVariable ["object_owner", [getPlayerUID player, profileName, _item], true];
4949

5050
ULP_PlaceableObject = _object;
5151

Client Side/Framework/Functions/Placeables/fn_removeObject.sqf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@ _this params [
1515

1616
if !([_object] call ULP_fnc_isPlaceable) exitWith { false };
1717

18+
private _item = (_object getVariable "object_owner") param [2, "", [""]];
19+
20+
if !([_item, 1] call ULP_fnc_handleItem) then {
21+
["You were unable to carry the item so it was destroyed"] call ULP_fnc_hint;
22+
};
23+
1824
deleteVehicle _object;
1925
true

0 commit comments

Comments
 (0)