mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Update object revealing
This replaces 'player reveal object' with a function that acutal reveals the objects to the player. This fixes that objects were not usable after building.
This commit is contained in:
@@ -15,7 +15,9 @@ _holder = objNull;
|
||||
//Check if a holder is close by the player.
|
||||
_nearByPile= nearestObjects [_pos, ["WeaponHolder","WeaponHolderBase"],PILE_SEARCH_RADIUS];
|
||||
|
||||
if (count _nearByPile == 0) then {
|
||||
if (count _nearByPile == 0) then {
|
||||
["WeaponHolder",objNull] call fn_waitForObject;
|
||||
|
||||
//No weapon holders found in the radius, spawn a new one
|
||||
_holder = "WeaponHolder" createVehicle [0,0,0];
|
||||
_holder setPosATL _pos;
|
||||
@@ -30,7 +32,9 @@ if (count _nearByPile == 0) then {
|
||||
_objects = lineIntersectsWith [(_holder modeltoWorld PILE_OFFSET), _pos, player, _holder, true];
|
||||
|
||||
//Can you see the current selected weapon holder
|
||||
if (count _objects > 0) then {
|
||||
if (count _objects > 0) then {
|
||||
["WeaponHolder",objNull] call fn_waitForObject;
|
||||
|
||||
//Unable to see the current selected weapon holder within the radius lets create a new one.
|
||||
_holder = createVehicle ["WeaponHolder", _pos, [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
@@ -42,7 +46,4 @@ switch _type do {
|
||||
case 1: {_holder addMagazineCargoGlobal [_item,_amount];};
|
||||
case 2: {_holder addWeaponCargoGlobal [_item,_amount];};
|
||||
case 3: {_holder addBackpackCargoGlobal [_item,_amount];};
|
||||
};
|
||||
|
||||
//Revel the item
|
||||
player reveal _holder;
|
||||
};
|
||||
@@ -68,6 +68,8 @@ if ((_ownerID == dayz_playerUID) || {_objType in ["IC_DomeTent","IC_Tent"]}) the
|
||||
_bag setDir _dir;
|
||||
_bag setPosATL _pos;
|
||||
|
||||
["WeaponHolder",objNull] call fn_waitForObject;
|
||||
|
||||
local _holder = "WeaponHolder" createVehicle [0,0,0]; // any packed items go here
|
||||
_holder setPosATL _pos;
|
||||
|
||||
@@ -80,8 +82,6 @@ if ((_ownerID == dayz_playerUID) || {_objType in ["IC_DomeTent","IC_Tent"]}) the
|
||||
|
||||
[_weapons, _magazines, _backpacks, _holder] call fn_addCargo; // pile everything onto the ground
|
||||
|
||||
player reveal _holder;
|
||||
|
||||
localize "str_success_tent_pack" call dayz_rollingMessages; // Your tent has been packed
|
||||
} else {
|
||||
localize "str_fail_tent_pack" call dayz_rollingMessages; // You cannot pack this tent, it is not yours
|
||||
|
||||
Reference in New Issue
Block a user