From 228ac99eb15d21ae200cf977d0bde1d3bac6ac18 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Mon, 17 Oct 2016 16:11:54 -0400 Subject: [PATCH] Set body studied status globally so confirmed kill is only added once https://github.com/DayZMod/DayZ/commit/7402b240df8dadd0e11f95885721cd0e7de87599 ensures _source will always be a player, so it's no longer necessary to check that. Vanilla commit: https://github.com/DayZMod/DayZ/commit/a8c9eaebe0fed9d88c30d9e8a16bce8272df1624 --- SQF/dayz_code/actions/study_body.sqf | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/SQF/dayz_code/actions/study_body.sqf b/SQF/dayz_code/actions/study_body.sqf index 12f40997d..a664c047c 100644 --- a/SQF/dayz_code/actions/study_body.sqf +++ b/SQF/dayz_code/actions/study_body.sqf @@ -1,10 +1,10 @@ -private["_body","_name","_method","_methodStr","_message","_killingBlow","_BodyStudied"]; +private["_body","_name","_method","_methodStr","_message","_killingBlow"]; _body = _this select 3; _name = _body getVariable["bodyName","unknown"]; _method = _body getVariable["deathType","unknown"]; _methodStr = localize format ["str_death_%1",_method]; -_killingBlow = _body getVariable ["KillingBlow",[objNull,0]]; +_killingBlow = _body getVariable ["KillingBlow",[objNull,false]]; /* Setup by player_death @@ -13,17 +13,14 @@ _killingBlow = _body getVariable ["KillingBlow",[objNull,0]]; _Punished = _killingBlow select 1; //False = HumanKill, True = BanditKill */ -//Has the body already been Studied? -_BodyStudied = _body getVariable ["BodyStudied",objNull]; - // "His/Her name was %1, it appears he/she died from %2" _message = if (_body isKindOf "SurvivorW2_DZ") then {"str_player_studybody_female"} else {"str_player_studybody"}; format[localize _message,_name,_methodStr] call dayz_rollingMessages; //Body hasnt already been Studied lets set the confimed Kills system. -if (isNull _BodyStudied) then { - if (!(isNull (_killingBlow select 0)) AND {(isPlayer (_killingBlow select 0))}) then { +if !(_body getVariable ["BodyStudied",false]) then { + if (!isNull (_killingBlow select 0)) then { if (!(_killingBlow select 1)) then { _ConfirmedHumanKills = (_killingBlow select 0) getVariable ["ConfirmedHumanKills",0]; (_killingBlow select 0) setVariable ["ConfirmedHumanKills",(_ConfirmedHumanKills + 1),true]; @@ -33,6 +30,6 @@ if (isNull _BodyStudied) then { }; //Set the body as Studied for all. - _body setVariable ["BodyStudied",_body]; + _body setVariable ["BodyStudied",true,true]; }; }; \ No newline at end of file