Add bloodStains only to scheduler if enabled

This commit is contained in:
A Man
2020-05-13 01:25:45 +02:00
parent 64375383f1
commit c5a6f0d03d
2 changed files with 13 additions and 9 deletions

View File

@@ -5,11 +5,11 @@ sched_bloodStains_init = {
};
sched_bloodStains = {
private ["_end","_lastpos","_stain", "_plpos"];
private ["_end","_lastpos","_stain", "_plpos","_bloodpool"];
_bloodpool = _this;
_plpos = visiblePosition player; //ATL
if (r_player_injured and {(dayz_bleedingeffect % 2 == 1)}) then {
if (r_player_injured) then {
// add a fresh blood stain
if (((vehicle player == player) and (!dayz_isSwimming)) AND {((_plpos select 2 < 0.3) AND {((getTerrainHeightASL _plpos) > 1.5)})}) then {
_end = count _bloodpool -1;
@@ -27,7 +27,7 @@ sched_bloodStains = {
};
};
}
else {
else {
// remove the oldest blood stain
if (count _bloodpool > 0) then {
_stain = _bloodpool select 0;
@@ -37,4 +37,4 @@ sched_bloodStains = {
};
_bloodpool
};
};