Fix opening supply crate over water

See #1558
This commit is contained in:
ebaydayz
2016-02-18 19:38:23 -05:00
parent 7a1058cb6d
commit 65c2a7e6b4
3 changed files with 7 additions and 2 deletions

View File

@@ -229,7 +229,10 @@ if (_canDo) then {
_bag addWeaponCargoGlobal [_x,1];
} else {
systemChat format[(localize "str_epoch_player_314"),_x];
_object = createVehicle ["WeaponHolder",position player,[],0,"CAN_COLLIDE"];
_location = player modeltoworld [0,0.3,0];
if ((_location select 2) < 0) then {_location set [2,0];};
_object = createVehicle ["WeaponHolder",_location,[],0,"CAN_COLLIDE"];
if (surfaceIsWater _location) then {_object setPosASL (getPosASL player);} else {_object setPosATL _location;};
_object setVariable ["permaLoot",true];
_object addWeaponCargoGlobal [_x,1];
};

View File

@@ -54,7 +54,7 @@ if(_type == "backpack") then {
_b0x1337 addBackpackCargoGlobal [_create,_qty];
};
if (surfaceIsWater _location) then {
_b0x1337 setPosASL _location;
_b0x1337 setPosASL (getPosASL player);
} else {
_b0x1337 setPosATL _location;
};