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;
@@ -89,7 +90,7 @@ while {_isOk} do {
_isOk = false; _isOk = false;
_proceed = false; _proceed = false;
}; };
format[localize "str_epoch_player_163",_nameVehicle,(_counter + 1),_limit] call dayz_rollingMessages; format[localize "str_epoch_player_163",_nameVehicle,(_counter + 1),_limit] call dayz_rollingMessages;
[player,"repair",0,false,20] call dayz_zombieSpeak; [player,"repair",0,false,20] call dayz_zombieSpeak;
@@ -150,7 +151,7 @@ if (_proceed && _success) then {
// Double check that object is not null // Double check that object is not null
if(!isNull(_obj)) then { if(!isNull(_obj)) then {
_ipos = getPosATL _obj; _ipos = getPosATL _obj;
if(!_isWreck && !_isWreckBuilding) then { if(!_isWreck && !_isWreckBuilding) then {
//Server performs deleteVehicle //Server performs deleteVehicle
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,dayz_authKey]; PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,dayz_authKey];
@@ -158,7 +159,7 @@ if (_proceed && _success) then {
} else { } else {
deleteVehicle _obj; deleteVehicle _obj;
}; };
if (_isWreckBuilding) then { if (_isWreckBuilding) then {
PVDZ_send = [player,"RemoveObject",_ipos]; PVDZ_send = [player,"RemoveObject",_ipos];
publicVariableServer "PVDZ_send"; publicVariableServer "PVDZ_send";
@@ -194,10 +195,10 @@ if (_proceed && _success) then {
if ({_objType in _x} count DZE_modularConfig > 0) then { if ({_objType in _x} count DZE_modularConfig > 0) then {
{ {
private ["_class", "_refund"]; private ["_class", "_refund"];
_class = _x select 0; _class = _x select 0;
_refund = _x select 1; _refund = _x select 1;
if (_objType == _class) then { if (_objType == _class) then {
{_selectedRemoveOutput set [count _selectedRemoveOutput,_x];} forEach _refund; {_selectedRemoveOutput set [count _selectedRemoveOutput,_x];} forEach _refund;
}; };
@@ -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];
@@ -265,4 +270,4 @@ if (_proceed && _success) then {
}; };
dayz_actionInProgress = false; dayz_actionInProgress = false;
s_player_deleteBuild = -1; s_player_deleteBuild = -1;

View File

@@ -17,15 +17,18 @@ _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];
//Can you see the current selected weapon holder //Can you see the current selected weapon holder
if (count _objects > 0) then { if (count _objects > 0) then {
//Unable to see the current selected weapon holder within the radius lets create a new one. //Unable to see the current selected weapon holder within the radius lets create a new one.
@@ -42,4 +45,4 @@ switch _type do {
}; };
//Revel the item //Revel the item
player reveal _holder; player reveal _holder;

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,13 +42,21 @@ 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];};
_posPlayer = getPosATL player;
_pos set [2,_posPlayer select 2];
if (_pos select 2 < 0) then {
_pos set [2,0];
};
//place tent (local) //place tent (local)
_bag = createVehicle [_packobj, _pos, [], 0, "CAN_COLLIDE"]; _bag = _packobj createVehicle [0,0,0];
_bag setDir _dir; _bag setDir _dir;
player reveal _bag; _bag setPosATL _pos;
_holder = createVehicle ["WeaponHolder", _pos, [], 0, "CAN_COLLIDE"];
_holder = "WeaponHolder" createVehicle [0,0,0];
_holder setPosATL _pos;
_weapons = getWeaponCargo _obj; _weapons = getWeaponCargo _obj;
_magazines = getMagazineCargo _obj; _magazines = getMagazineCargo _obj;
_backpacks = getBackpackCargo _obj; _backpacks = getBackpackCargo _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");
@@ -31,11 +32,11 @@ if (_objectID == "0" && _objectUID == "0") exitWith {dayz_actionInProgress = fal
if (!_ComboMatch && (_ownerID != dayz_playerUID)) exitWith { dayz_actionInProgress = false; s_player_packvault = -1; format[localize "str_epoch_player_119",_text] call dayz_rollingMessages;}; if (!_ComboMatch && (_ownerID != dayz_playerUID)) exitWith { dayz_actionInProgress = false; s_player_packvault = -1; format[localize "str_epoch_player_119",_text] call dayz_rollingMessages;};
format[localize "str_epoch_player_121",_text] call dayz_rollingMessages; format[localize "str_epoch_player_121",_text] call dayz_rollingMessages;
uiSleep 1; uiSleep 1;
_location1 = getPosATL player; _location1 = getPosATL player;
uiSleep 5; uiSleep 5;
_location2 = getPosATL player; _location2 = getPosATL player;
if(_location1 distance _location2 > 0.1) exitWith { if(_location1 distance _location2 > 0.1) exitWith {
format[localize "str_epoch_player_122",_text] call dayz_rollingMessages; format[localize "str_epoch_player_122",_text] call dayz_rollingMessages;
s_player_packvault = -1; s_player_packvault = -1;
@@ -44,22 +45,22 @@ if(_location1 distance _location2 > 0.1) exitWith {
if (!isNull _obj && alive _obj) then { if (!isNull _obj && alive _obj) then {
[player,"tentpack",0,false] call dayz_zombieSpeak; [player,"tentpack",0,false] call dayz_zombieSpeak;
_finished = ["Medic",1] call fn_loopAction; _finished = ["Medic",1] call fn_loopAction;
if (isNull _obj or !_finished) exitWith {}; if (isNull _obj or !_finished) exitWith {};
["Working",0,[3,2,4,0]] call dayz_NutritionSystem; ["Working",0,[3,2,4,0]] call dayz_NutritionSystem;
(findDisplay 106) closeDisplay 0; // Close gear (findDisplay 106) closeDisplay 0; // Close gear
dze_waiting = nil; dze_waiting = nil;
[_packedClass,objNull] call fn_waitForObject; [_packedClass,objNull] call fn_waitForObject;
PVDZE_handleSafeGear = [player,_obj,2]; PVDZE_handleSafeGear = [player,_obj,2];
publicVariableServer "PVDZE_handleSafeGear"; publicVariableServer "PVDZE_handleSafeGear";
//wait for response from server to verify pack was logged and gear added before proceeding //wait for response from server to verify pack was logged and gear added before proceeding
waitUntil {!isNil "dze_waiting"}; waitUntil {!isNil "dze_waiting"};
format[localize "str_epoch_player_123",_text] call dayz_rollingMessages; format[localize "str_epoch_player_123",_text] call dayz_rollingMessages;
}; };
s_player_packvault = -1; s_player_packvault = -1;