Don't allow giving bloodbag to player with full blood

Reverted be214d3 because this is a more complete solution
This commit is contained in:
ebaydayz
2016-11-11 17:03:50 -05:00
parent fe773bd571
commit e55960b6f9
2 changed files with 10 additions and 8 deletions

View File

@@ -78,9 +78,4 @@ while {r_doLoop} do {
//Rerun the loop
sleep 1;
};
if (((r_player_blood / r_player_bloodTotal) >= 0.35) and (player getVariable["USEC_lowBlood",false])) then {
r_player_lowblood = false;
player setVariable["USEC_lowBlood",false,true];
};
};

View File

@@ -269,8 +269,15 @@ while {1 == 1} do {
//Record low bloow
_lowBlood = player getVariable ["USEC_lowBlood", false];
if ((r_player_blood < r_player_bloodTotal) and !_lowBlood) then {
player setVariable["USEC_lowBlood",true,true];
if (r_player_blood < r_player_bloodTotal) then {
if (!_lowBlood) then {
player setVariable ["USEC_lowBlood",true,true];
};
} else {
if (_lowBlood && !r_player_injured) then {
player setVariable ["USEC_lowBlood",false,true];
r_player_lowblood = false;
};
};
//Broadcast Hunger/Thirst