test out of bounds checks

added _isOnFoot var to init that refreshes with event1 every second and
is reused in any events
This commit is contained in:
vbawol 2017-08-24 10:22:13 -05:00
parent db18932055
commit 23b1710d7c
3 changed files with 15 additions and 2 deletions

View File

@ -131,7 +131,8 @@ if (_forceBloodRise) then {
};
// check if player On Foot
if (isNull objectParent player) then {
_isOnFoot = isNull objectParent player;
if (_isOnFoot) then {
_val = log(abs(speed player));
_staminaThreshold = [0.7,0.3] select EPOCH_playerIsSwimming;
if (_val > _staminaThreshold) then {

View File

@ -1,5 +1,16 @@
_position = getPosATL player;
// check if player is out of map bounds.
_worldSize = worldSize/2;
_outOfBounds = !(player inArea [[_worldSize,_worldSize,0], _worldSize, _worldSize, 0, true ]);
if (_outOfBounds) then {
["You are out of the play area!", 5] call Epoch_message;
} else {
// do in bounds radiation checks here.
};
EPOCH_nearestLocations = nearestLocations[player, ["NameCityCapital", "NameCity", "Airport"], 300];
EPOCH_playerIsSwimming = false;
@ -12,7 +23,7 @@ if !(surfaceIsWater _position) then {
};
} else {
// spawn shark if player is deep water and not in vehicle
if (vehicle player == player) then{
if !(_isOnFoot) then{
_offsetZ = ((_position vectorDiff getPosASL player) select 2);
EPOCH_playerIsSwimming = (_offsetZ > 1.7);
if (_offsetZ > 50) then {

View File

@ -18,6 +18,7 @@ if (isNil "EPOCH_display_setup_complete") then {
_prevEquippedItem = [];
_damagePlayer = damage player;
_isOnFoot = isNull objectParent player;
_panic = false;
_prevEnergy = EPOCH_playerEnergy;