Fix floating loot after remove, pack or output from fn_dropItem

This commit is contained in:
A Man
2019-10-23 12:46:08 +02:00
parent a09bb81a7a
commit 1268f55f32
5 changed files with 59 additions and 39 deletions

View File

@@ -20,9 +20,10 @@
[FIXED] Crafting wooden arrows from wood piles and razors was not possible. (d4b46e4) @AirwavesMan [FIXED] Crafting wooden arrows from wood piles and razors was not possible. (d4b46e4) @AirwavesMan
[FIXED] Top snap point for half cinder wall was incorrect. (8f10a36) @ndavalos, @AirwavesMan [FIXED] Top snap point for half cinder wall was incorrect. (8f10a36) @ndavalos, @AirwavesMan
[FIXED] The RPK-74 magazine could not be used with all AK-74 versions. (82485ea) @AirwavesMan [FIXED] The RPK-74 magazine could not be used with all AK-74 versions. (82485ea) @AirwavesMan
[FIXED] Multiple Vehicle Upgrades were not possbile. (ac884f2), (a430f79), (c24504a) @F507DMT [FIXED] Multiple Vehicle Upgrades were not possibile. (ac884f2), (a430f79), (c24504a) @F507DMT
[FIXED] Fix an inventory dupe if on water. (a052ba7), (baf92eb) @F507DMT [FIXED] Fix an inventory dupe if on water. (a052ba7), (baf92eb) @F507DMT
[FIXED] The pickaxe and the broken pickaxe spawned in the ground on loot spawn. @AirwavesMan [FIXED] The pickaxe and the broken pickaxe spawned in the ground on loot spawn. (a09bb81a) @AirwavesMan
[FIXED] Fix floating loot from remove, pack and fn_dropItem. @AirwavesMan
[UPDATED] Spawning of Zombies and Loot in Safe Zones can now be toggled, disabled by default, see configVariables.sqf/DZE_SafeZoneZombieLoot (6248add, 141b25e) @oiad @_Lance_ [UPDATED] Spawning of Zombies and Loot in Safe Zones can now be toggled, disabled by default, see configVariables.sqf/DZE_SafeZoneZombieLoot (6248add, 141b25e) @oiad @_Lance_
[UPDATED] Added notification when status icons are disabled. (e04f0fc) @ebayShopper [UPDATED] Added notification when status icons are disabled. (e04f0fc) @ebayShopper

View File

@@ -4,7 +4,7 @@ dayz_actionInProgress = true;
delete object from db with extra waiting by [VB]AWOL delete object from db with extra waiting by [VB]AWOL
parameters: _obj parameters: _obj
*/ */
private ["_obj","_objectID","_objectUID","_finished","_isOk","_proceed","_counter","_limit","_objType","_itemOut","_countOut","_selectedRemoveOutput","_nearestPole","_ownerID","_refundpart","_isWreck","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle","_isModular","_success","_lootGroupIndex","_output"]; private ["_plotcheck","_PlayerNear","_isMine","_obj","_objectID","_objectUID","_finished","_isOk","_proceed","_counter","_limit","_objType","_itemOut","_countOut","_selectedRemoveOutput","_nearestPole","_refundpart","_isWreck","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_isWreckBuilding","_nameVehicle","_isModular","_success","_lootGroupIndex","_output"];
player removeAction s_player_deleteBuild; player removeAction s_player_deleteBuild;
s_player_deleteBuild = 1; s_player_deleteBuild = 1;
@@ -38,7 +38,6 @@ _isRemovable = _objType in DZE_isRemovable;
_isWreckBuilding = _objType in DZE_isWreckBuilding; _isWreckBuilding = _objType in DZE_isWreckBuilding;
_isMine = _objType in ["Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck"]; _isMine = _objType in ["Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck"];
_isModular = _obj isKindOf "ModularItems"; _isModular = _obj isKindOf "ModularItems";
_distance = DZE_PlotPole select 0;
_PlayerNear = {isPlayer _x} count (([_obj] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1; _PlayerNear = {isPlayer _x} count (([_obj] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1;
if (_PlayerNear && (_isMine or _objType == "Land_ammo_supply_wreck")) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;}; if (_PlayerNear && (_isMine or _objType == "Land_ammo_supply_wreck")) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};
@@ -58,6 +57,8 @@ _IsNearPlot = _plotcheck select 1;
_nearestPole = _plotcheck select 2; _nearestPole = _plotcheck select 2;
if(_IsNearPlot >= 1) then { if(_IsNearPlot >= 1) then {
private ["_buildcheck","_isowner","_isfriendly"];
// Since there are plot poles nearby we need to check ownership && friend status // Since there are plot poles nearby we need to check ownership && friend status
_buildcheck = [player, _nearestPole] call FNC_check_access; _buildcheck = [player, _nearestPole] call FNC_check_access;
_isowner = _buildcheck select 0; _isowner = _buildcheck select 0;
@@ -214,14 +215,10 @@ if (_proceed && _success) then {
[localize "str_epoch_player_90",1] call dayz_rollingMessages; [localize "str_epoch_player_90",1] call dayz_rollingMessages;
}; };
if (_ipos select 2 < 0) then {
_ipos set [2,0];
};
_radius = 1;
if (_isMine) then { if (_isMine) then {
if((random 10) <= 4) then { if((random 10) <= 4) then {
private ["_gems","_weights","_gemSelected"];
_gems = []; _gems = [];
_weights = []; _weights = [];
{ {
@@ -235,7 +232,16 @@ if (_proceed && _success) then {
// give refund items // give refund items
if((count _selectedRemoveOutput) > 0 && !_preventRefund) then { if((count _selectedRemoveOutput) > 0 && !_preventRefund) then {
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; private "_posPlayer";
_posPlayer = getPosATL player;
_iPos set [2,_posPlayer select 2];
if (_iPos select 2 < 0) then {
_iPos set [2,0];
};
_item = "WeaponHolder" createVehicle [0,0,0];
{ {
_itemOut = _x select 0; _itemOut = _x select 0;
_countOut = _x select 1; _countOut = _x select 1;
@@ -254,7 +260,6 @@ if (_proceed && _success) then {
} count _selectedRemoveOutput; } count _selectedRemoveOutput;
_item setposATL _iPos; _item setposATL _iPos;
player reveal _item; player reveal _item;
DZE_GearCheckBypass = true; //Bypass gear menu checks since dialog will always open on item DZE_GearCheckBypass = true; //Bypass gear menu checks since dialog will always open on item
player action ["Gear", _item]; player action ["Gear", _item];

View File

@@ -17,12 +17,15 @@ _nearByPile= nearestObjects [_pos, ["WeaponHolder","WeaponHolderBase"],PILE_SEAR
if (count _nearByPile == 0) then { if (count _nearByPile == 0) then {
//No weapon holders found in the radius, spawn a new one //No weapon holders found in the radius, spawn a new one
_holder = createVehicle ["WeaponHolder", _pos, [], 0, "CAN_COLLIDE"]; _holder = "WeaponHolder" createVehicle [0,0,0];
_holder setPosATL _pos;
} else { } else {
//Found a near by weapon holder lets select it. //Found a near by weapon holder lets select it.
_holder = _nearByPile select 0; _holder = _nearByPile select 0;
if (!_manualPos) then { if (!_manualPos) then {
private "_objects";
//check to make sure the player can see the selected weapon holder. //check to make sure the player can see the selected weapon holder.
_objects = lineIntersectsWith [(_holder modeltoWorld PILE_OFFSET), _pos, player, _holder, true]; _objects = lineIntersectsWith [(_holder modeltoWorld PILE_OFFSET), _pos, player, _holder, true];

View File

@@ -4,7 +4,7 @@
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;}; if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true; dayz_actionInProgress = true;
private ["_alreadyPacking","_backpacks","_bag","_campItems","_dir","_holder","_magazines","_obj","_objectID","_objectUID","_ownerID","_packobj","_playerNear","_pos","_weapons","_finished"]; private ["_alreadyPacking","_backpacks","_bag","_campItems","_dir","_holder","_magazines","_obj","_objectID","_objectUID","_ownerID","_packobj","_playerNear","_pos","_weapons","_finished","_posPlayer"];
_obj = _this; _obj = _this;
_ownerID = _obj getVariable["CharacterID","0"]; _ownerID = _obj getVariable["CharacterID","0"];
@@ -42,12 +42,20 @@ if (_ownerID in [dayz_characterID,dayz_playerUID] or typeOf _obj in _campItems)
if (isNull _obj) exitWith {}; if (isNull _obj) exitWith {};
if (!_finished) exitWith {_obj setVariable["packing",0,true];}; if (!_finished) exitWith {_obj setVariable["packing",0,true];};
//place tent (local) _posPlayer = getPosATL player;
_bag = createVehicle [_packobj, _pos, [], 0, "CAN_COLLIDE"]; _pos set [2,_posPlayer select 2];
_bag setDir _dir;
player reveal _bag;
_holder = createVehicle ["WeaponHolder", _pos, [], 0, "CAN_COLLIDE"]; if (_pos select 2 < 0) then {
_pos set [2,0];
};
//place tent (local)
_bag = _packobj createVehicle [0,0,0];
_bag setDir _dir;
_bag setPosATL _pos;
_holder = "WeaponHolder" createVehicle [0,0,0];
_holder setPosATL _pos;
_weapons = getWeaponCargo _obj; _weapons = getWeaponCargo _obj;
_magazines = getMagazineCargo _obj; _magazines = getMagazineCargo _obj;
@@ -59,6 +67,8 @@ if (_ownerID in [dayz_characterID,dayz_playerUID] or typeOf _obj in _campItems)
[_weapons,_magazines,_backpacks,_holder] call fn_addCargo; [_weapons,_magazines,_backpacks,_holder] call fn_addCargo;
player reveal _holder;
localize "str_success_tent_pack" call dayz_rollingMessages; localize "str_success_tent_pack" call dayz_rollingMessages;
} else { } else {
localize "str_fail_tent_pack" call dayz_rollingMessages; localize "str_fail_tent_pack" call dayz_rollingMessages;

View File

@@ -1,10 +1,11 @@
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
/* /*
[_obj] spawn player_packVault; [_obj] spawn player_packVault;
*/ */
private ["_obj","_ownerID","_objectID","_objectUID","_location1","_location2","_packedClass","_text","_playerNear","_finished"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;}; private ["_obj","_ownerID","_objectID","_objectUID","_location1","_location2","_packedClass","_text","_playerNear","_finished","_ComboMatch"];
dayz_actionInProgress = true;
_obj = _this; _obj = _this;
_packedClass = getText (configFile >> "CfgVehicles" >> (typeOf _obj) >> "packedClass"); _packedClass = getText (configFile >> "CfgVehicles" >> (typeOf _obj) >> "packedClass");