mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
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:
parent
db18932055
commit
23b1710d7c
@ -131,7 +131,8 @@ if (_forceBloodRise) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// check if player On Foot
|
// check if player On Foot
|
||||||
if (isNull objectParent player) then {
|
_isOnFoot = isNull objectParent player;
|
||||||
|
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 EPOCH_playerIsSwimming;
|
||||||
if (_val > _staminaThreshold) then {
|
if (_val > _staminaThreshold) then {
|
||||||
|
@ -1,5 +1,16 @@
|
|||||||
_position = getPosATL player;
|
_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_nearestLocations = nearestLocations[player, ["NameCityCapital", "NameCity", "Airport"], 300];
|
||||||
|
|
||||||
EPOCH_playerIsSwimming = false;
|
EPOCH_playerIsSwimming = false;
|
||||||
@ -12,7 +23,7 @@ if !(surfaceIsWater _position) then {
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// spawn shark if player is deep water and not in vehicle
|
// 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);
|
_offsetZ = ((_position vectorDiff getPosASL player) select 2);
|
||||||
EPOCH_playerIsSwimming = (_offsetZ > 1.7);
|
EPOCH_playerIsSwimming = (_offsetZ > 1.7);
|
||||||
if (_offsetZ > 50) then {
|
if (_offsetZ > 50) then {
|
||||||
|
@ -18,6 +18,7 @@ if (isNil "EPOCH_display_setup_complete") then {
|
|||||||
|
|
||||||
_prevEquippedItem = [];
|
_prevEquippedItem = [];
|
||||||
_damagePlayer = damage player;
|
_damagePlayer = damage player;
|
||||||
|
_isOnFoot = isNull objectParent player;
|
||||||
_panic = false;
|
_panic = false;
|
||||||
_prevEnergy = EPOCH_playerEnergy;
|
_prevEnergy = EPOCH_playerEnergy;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user