Fix humanity hit for units in vehicles

The only change is a removal of this check and the corresponding
tabs/spacing:

if (_object == player) then {

That returns false if the player is in a vehicle. It is not needed since
PVCDZ_plr_Humanity EH only fires on the intended player now (sent with
PVC instead of PV).
This commit is contained in:
ebaydayz
2016-10-01 13:43:30 -04:00
parent 0a17804e36
commit 8ea21a2c81

View File

@@ -3,10 +3,9 @@ _object = _this select 0;
_change = _this select 1; _change = _this select 1;
_wait = if (count _this > 2) then { _this select 2 } else { 0 }; _wait = if (count _this > 2) then { _this select 2 } else { 0 };
if (_object == player) then { _humanity = (player getVariable["humanity",0]) + _change;
_humanity = (player getVariable["humanity",0]) + _change; player setVariable["humanity",_humanity,true];
player setVariable["humanity",_humanity,true]; if (_change < 0) then { //non-bandit player can be "punished" in next "_wait" seconds w/o loosing humanity
if (_change < 0) then { //non-bandit player can be "punished" in next "_wait" seconds w/o loosing humanity
if ((_humanity > -2000) and (_wait > 0)) then { if ((_humanity > -2000) and (_wait > 0)) then {
// player setVariable ["freeTarget",true,true]; // player setVariable ["freeTarget",true,true];
player setVariable ["FTcounter",((player getVariable ["FTcounter",0]) + _wait)]; player setVariable ["FTcounter",((player getVariable ["FTcounter",0]) + _wait)];
@@ -22,54 +21,53 @@ if (_object == player) then {
}; };
}; };
}; };
}; };
/* Humanity morphing disabled on Epoch to avoid loss of purchased clothing /* Humanity morphing disabled on Epoch to avoid loss of purchased clothing
//add humanity cap both ways //add humanity cap both ways
//if (_humanity < 500000) then { player setVariable["humanity",-500000,true]; }; //Hive adds/removes diffrence //if (_humanity < 500000) then { player setVariable["humanity",-500000,true]; }; //Hive adds/removes diffrence
//if (_humanity > 500000) then { player setVariable["humanity",500000,true]; }; //Hive adds/removes diffrence //if (_humanity > 500000) then { player setVariable["humanity",500000,true]; }; //Hive adds/removes diffrence
_model = typeOf player; _model = typeOf player;
//if model will not be changed by humanity //if model will not be changed by humanity
if !(_model in ["Survivor1_DZ","Survivor2_DZ","Survivor3_DZ","SurvivorW2_DZ","SurvivorW3_DZ","Bandit1_DZ","BanditW1_DZ"]) exitWith {}; if !(_model in ["Survivor1_DZ","Survivor2_DZ","Survivor3_DZ","SurvivorW2_DZ","SurvivorW3_DZ","Bandit1_DZ","BanditW1_DZ"]) exitWith {};
//Not sure if this will work needs testing //Not sure if this will work needs testing
_isMen = _model == "Survivor1_DZ" || _model == "Survivor2_DZ"; _isMen = _model == "Survivor1_DZ" || _model == "Survivor2_DZ";
_isMenH = _model == "Survivor3_DZ"; _isMenH = _model == "Survivor3_DZ";
_isMenB = _model == "Bandit1_DZ"; _isMenB = _model == "Bandit1_DZ";
_isWomen = _model == "SurvivorW2_DZ"; _isWomen = _model == "SurvivorW2_DZ";
_isWomenH = _model == "SurvivorW3_DZ"; //TODO _isWomenH = _model == "SurvivorW3_DZ"; //TODO
_isWomenB = _model == "BanditW1_DZ"; _isWomenB = _model == "BanditW1_DZ";
// Bandit // Bandit
if (_humanity <= -2000) then { if (_humanity <= -2000) then {
if (_isMen || _isMenH) then { if (_isMen || _isMenH) then {
[dayz_playerUID,dayz_characterID,"Bandit1_DZ"] spawn player_humanityMorph; [dayz_playerUID,dayz_characterID,"Bandit1_DZ"] spawn player_humanityMorph;
}; };
if (_isWomen || _isWomenH) then { if (_isWomen || _isWomenH) then {
[dayz_playerUID,dayz_characterID,"BanditW1_DZ"] spawn player_humanityMorph; [dayz_playerUID,dayz_characterID,"BanditW1_DZ"] spawn player_humanityMorph;
}; };
}; };
//Survivor //Survivor
if (_humanity > -2000 && _humanity <= 5000) then { if (_humanity > -2000 && _humanity <= 5000) then {
if (_isMenH || _isMenB) then { if (_isMenH || _isMenB) then {
[dayz_playerUID,dayz_characterID,"Survivor2_DZ"] spawn player_humanityMorph; [dayz_playerUID,dayz_characterID,"Survivor2_DZ"] spawn player_humanityMorph;
}; };
if (_isWomenH || _isWomenB) then { if (_isWomenH || _isWomenB) then {
[dayz_playerUID,dayz_characterID,"SurvivorW2_DZ"] spawn player_humanityMorph; [dayz_playerUID,dayz_characterID,"SurvivorW2_DZ"] spawn player_humanityMorph;
}; };
}; };
// Hero // Hero
if (_humanity > 5000) then { if (_humanity > 5000) then {
if (_isMen || _isMenB) then { if (_isMen || _isMenB) then {
[dayz_playerUID,dayz_characterID,"Survivor3_DZ"] spawn player_humanityMorph; [dayz_playerUID,dayz_characterID,"Survivor3_DZ"] spawn player_humanityMorph;
}; };
if (_isWomenB) then { if (_isWomenB) then {
[dayz_playerUID,dayz_characterID,"SurvivorW2_DZ"] spawn player_humanityMorph; [dayz_playerUID,dayz_characterID,"SurvivorW2_DZ"] spawn player_humanityMorph;
}; };
};
*/
}; };
*/