make use of underwater command

This commit is contained in:
vbawol
2017-10-13 16:15:03 -05:00
parent ffa4ad32fd
commit aaf7b215c9
6 changed files with 4 additions and 10 deletions

View File

@ -28,7 +28,7 @@
private ["_ins","_target"]; private ["_ins","_target"];
//[[[end]]] //[[[end]]]
params [["_distance",10], ["_lod1", "VIEW"], ["_lod2","FIRE"], ["_sort",true]]; params [["_distance",10], ["_lod1", "VIEW"], ["_lod2","FIRE"], ["_sort",true]];
if (EPOCH_playerIsSwimming) then { if (underwater player) then {
_ins = lineIntersectsSurfaces [AGLToASL positionCameraToWorld [0,0,0],AGLToASL positionCameraToWorld [0,0,_distance],player,objNull,_sort,1,_lod1,_lod2]; _ins = lineIntersectsSurfaces [AGLToASL positionCameraToWorld [0,0,0],AGLToASL positionCameraToWorld [0,0,_distance],player,objNull,_sort,1,_lod1,_lod2];
if (_ins isEqualTo []) exitWith { objNull }; if (_ins isEqualTo []) exitWith { objNull };
(_ins select 0 param [3,objNull]) (_ins select 0 param [3,objNull])

View File

@ -135,7 +135,7 @@ if (_forceBloodRise) then {
_isOnFoot = isNull objectParent player; _isOnFoot = isNull objectParent player;
if (_isOnFoot) then { if (_isOnFoot) then {
_val = log(abs(speed player)); _val = log(abs(speed player));
_staminaThreshold = [0.7,0.3] select EPOCH_playerIsSwimming; _staminaThreshold = [0.7,0.3] select (underwater player);
if (_val > _staminaThreshold) then { if (_val > _staminaThreshold) then {
_forceStaminaDrop = true; _forceStaminaDrop = true;
}; };
@ -370,7 +370,7 @@ if(_markerName in allMapMarkers)then{
['DeathMarker'] call EPOCH_fnc_deleteLocalMarkerSet; ['DeathMarker'] call EPOCH_fnc_deleteLocalMarkerSet;
}; };
}else{ }else{
{ {
(_x select 0) setMarkerPosLocal (position player); (_x select 0) setMarkerPosLocal (position player);
if(count(_x) >= 8)then{(_x select 0) setMarkerTextLocal (call compile (_x select 7))}; if(count(_x) >= 8)then{(_x select 0) setMarkerTextLocal (call compile (_x select 7))};
}forEach _markerArray; }forEach _markerArray;

View File

@ -106,7 +106,7 @@ _increaseWet = 0;
_wetsuit = (getText(configfile >> "cfgweapons" >> uniform player >> "itemInfo" >> "uniformType") == "Neopren"); _wetsuit = (getText(configfile >> "cfgweapons" >> uniform player >> "itemInfo" >> "uniformType") == "Neopren");
if (_isOnFoot) then { if (_isOnFoot) then {
if (EPOCH_playerIsSwimming) then { if (underwater player) then {
// do nothing if player is wearing a wetsuit // do nothing if player is wearing a wetsuit
if (!_wetsuit) then { if (!_wetsuit) then {
if (_waterTemp <= 50) then { if (_waterTemp <= 50) then {

View File

@ -24,9 +24,6 @@ if (_outOfBounds) then {
}; };
}; };
EPOCH_playerIsSwimming = false;
if !(surfaceIsWater _position) then { if !(surfaceIsWater _position) then {
if (_nearestLocations isEqualTo []) then{ if (_nearestLocations isEqualTo []) then{
if (count(player nearEntities["Animal_Base_F", 800]) < 2) then { if (count(player nearEntities["Animal_Base_F", 800]) < 2) then {
@ -37,7 +34,6 @@ if !(surfaceIsWater _position) then {
// spawn shark if player is deep water and not in vehicle // spawn shark if player is deep water and not in vehicle
if !(_isOnFoot) then{ if !(_isOnFoot) then{
_offsetZ = ((_position vectorDiff getPosASL player) select 2); _offsetZ = ((_position vectorDiff getPosASL player) select 2);
EPOCH_playerIsSwimming = (_offsetZ > 1.7);
if (_offsetZ > 50) then { if (_offsetZ > 50) then {
["GreatWhite_F", player, true] call EPOCH_unitSpawn; ["GreatWhite_F", player, true] call EPOCH_unitSpawn;
}; };

View File

@ -124,7 +124,6 @@ _hudConfigs = ["CfgEpochClient", "hudConfigs", []] call EPOCH_fnc_returnConfigEn
_radioactiveLocations = ["CfgEpochClient", "radioactiveLocations", ["NameCityCapital", "NameCity", "Airport"]] call EPOCH_fnc_returnConfigEntryV2; _radioactiveLocations = ["CfgEpochClient", "radioactiveLocations", ["NameCityCapital", "NameCity", "Airport"]] call EPOCH_fnc_returnConfigEntryV2;
_chargeRate = 0; _chargeRate = 0;
EPOCH_playerIsSwimming = false;
_antagonistChanceDefaults = [ _antagonistChanceDefaults = [
"Epoch_Cloak_F",0.07, "Epoch_Cloak_F",0.07,

View File

@ -25,7 +25,6 @@ EPOCH_group_level_img = ["x\addons\a3_epoch_code\data\owner.paa", "x\addons\a3_e
if (isNil 'EPOCH_diag_fps') then { if (isNil 'EPOCH_diag_fps') then {
EPOCH_diag_fps = 0; EPOCH_diag_fps = 0;
}; };
EPOCH_playerIsSwimming = false;
EPOCH_lastTrash = diag_tickTime; EPOCH_lastTrash = diag_tickTime;
EPOCH_tradeDone = false; EPOCH_tradeDone = false;
EPOCH_bankBalance = 0; EPOCH_bankBalance = 0;