mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
Split player_death into scheduled and unscheduled #1833
Death message was sometimes showing incorrectly due to spawn delay. Also the sched_corpses two minute loop was occasionally deleting bodies right away because bodyName setVariable was delayed by the time it took PVDZ_plr_death to send (up to a few seconds). See #1825
This commit is contained in:
@@ -33,7 +33,7 @@ BIS_Effects_startEvent = {
|
||||
} count DZE_SafeZonePosArray;
|
||||
player action ["getOut", (_this select 0)];
|
||||
if (!_cancel && {!((_this select 0) iskindof "car")}) then {
|
||||
[player, "explosion"] spawn player_death;
|
||||
[player, "explosion"] call player_death;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -230,7 +230,7 @@ while {1 == 1} do {
|
||||
};
|
||||
_result = r_player_blood - _bloodloss;
|
||||
if (_result < 0) then {
|
||||
_id = [player,"rad"] spawn player_death;
|
||||
[player,"rad"] call player_death;
|
||||
} else {
|
||||
r_player_blood = _result;
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ sched_medical_slow = { // 10 seconds
|
||||
sched_medical_init = { [ []spawn{} ] };
|
||||
sched_medical = { // 1 second
|
||||
HIDE_FSM_VARS
|
||||
private ["_method","_unconHdlr"];
|
||||
private "_unconHdlr";
|
||||
_unconHdlr = _this select 0;
|
||||
|
||||
if (r_player_blood == 12000) then {
|
||||
@@ -27,14 +27,8 @@ sched_medical = { // 1 second
|
||||
|
||||
//r_player_unconscious = getVariable ["NORRN_unconscious", true];
|
||||
|
||||
_method = switch (true) do {
|
||||
case (dayz_lastDamageSource != "none" && diag_tickTime - dayz_lastDamageTime < 30): {dayz_lastDamageSource}; //Major event takes priority for cause of death
|
||||
case (dayz_lastMedicalSource != "none" && diag_tickTime - dayz_lastMedicalTime < 10): {dayz_lastMedicalSource}; //Starve, Dehyd, Sick
|
||||
default {"bled"}; //No other damage sources in last 30 seconds
|
||||
};
|
||||
|
||||
if (r_player_blood <= 0) then {
|
||||
[dayz_sourceBleeding, _method] spawn player_death;
|
||||
[dayz_sourceBleeding,"find"] call player_death;
|
||||
};
|
||||
|
||||
if (!canStand player) then { // be consistant with player_updateGui.sqf
|
||||
|
||||
Reference in New Issue
Block a user