From 50ba58f5aebd1a6b60ba7931cf1f8811f20dd19a Mon Sep 17 00:00:00 2001 From: ebayShopper Date: Sat, 25 Mar 2017 20:05:36 -0400 Subject: [PATCH] Fix death message showing RunOver when it shouldn't --- CHANGE LOG 1.0.6.2.txt | 1 + SQF/dayz_code/compile/fn_damageHandler.sqf | 12 +++++------- SQF/dayz_code/compile/vehicle_getOut.sqf | 1 - SQF/dayz_code/init/variables.sqf | 3 +-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CHANGE LOG 1.0.6.2.txt b/CHANGE LOG 1.0.6.2.txt index 42f4a5154..2cb4b8963 100644 --- a/CHANGE LOG 1.0.6.2.txt +++ b/CHANGE LOG 1.0.6.2.txt @@ -15,6 +15,7 @@ [FIXED] Swimming in air or ground after relog, clothes change and respawn on certain maps. #1913 @Cherdenko [FIXED] Arma cheats enterable on map display and create marker text box. #1915 @BigEgg17 [FIXED] It is no longer possible to duplicate melee weapons by double clicking to drop and right clicking at the same time. @F507DMT +[FIXED] Death messages sometimes showing RunOver when they should not due to dayz_hitBy variable not resetting after being runover. @oiad [NOTE] Fixes below are included in the mission file and server pbo as part of server package 1.0.6.1A (March 10th 2017) [FIXED] Fixed food and drink going down 10x faster from melee and other "working" actions. diff --git a/SQF/dayz_code/compile/fn_damageHandler.sqf b/SQF/dayz_code/compile/fn_damageHandler.sqf index 886793cbc..f0c7c4d62 100644 --- a/SQF/dayz_code/compile/fn_damageHandler.sqf +++ b/SQF/dayz_code/compile/fn_damageHandler.sqf @@ -25,21 +25,19 @@ _isLocal = local _source; _falling = (((_hit == "legs") AND {(_source==_unit)}) AND {((_ammo=="") AND {(Dayz_freefall select 1 > 3)})}); //Simple hack to help with a few issues from direct damage to physic based damage. ***until 2.0*** - if (isNull dayz_getout) then { + if (diag_tickTime - dayz_getoutTime > 2 && (vehicle player == player)) then { _vehicleArray = nearestObjects [(getPosATL (vehicle _unit)),["Car","Air","Motorcycle","Ship","Tank"],3]; {if (typeOf _x == "ParachuteWest") then {_vehicleArray = _vehicleArray - [_x];};} count _vehicleArray; { - if ((speed _x > 10) or (speed _x < -8)) exitwith { dayz_HitBy = _x; }; + if ((speed _x > 10) or (speed _x < -8)) exitWith { dayz_hitByTime = diag_tickTime; }; } count _vehicleArray; }; //Lets see if the player has been struck by a moving vehicle. - if (!isNull dayz_HitBy && vehicle player == player) then { _ammo = "RunOver"; }; - if ((_hit == "Legs") AND {(_ammo == "RunOver")}) then { dayz_HitBy = objNull; }; + if (diag_tickTime - dayz_hitByTime < 2) then { _ammo = "RunOver"; }; - //If a vehicle is moveing faster then 15 lets register some kind of direct damage rather then relying on indirect/physics damage. - if (!isNull dayz_getout && diag_tickTime - dayz_getoutTime < 5) then { _ammo = "Dragged"; }; - if ((_hit == "Legs") AND {(_ammo == "Dragged")}) then { dayz_getout = objNull; }; + //If a vehicle is moving faster then 15 lets register some kind of direct damage rather then relying on indirect/physics damage. + if (diag_tickTime - dayz_getoutTime < 2) then { _ammo = "Dragged"; }; _end = false; diff --git a/SQF/dayz_code/compile/vehicle_getOut.sqf b/SQF/dayz_code/compile/vehicle_getOut.sqf index 78eeb7280..82fd0c48e 100644 --- a/SQF/dayz_code/compile/vehicle_getOut.sqf +++ b/SQF/dayz_code/compile/vehicle_getOut.sqf @@ -49,7 +49,6 @@ if (_unit == player) then { //Lets make sure we can process some dmg from ejecting from the vehicle even traveling at lower speeds. if (((speed _vehicle) > 15) or ((speed _vehicle) < -10)) then { - dayz_getout = _vehicle; dayz_getoutTime = diag_tickTime; }; }; diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 9736ae21c..690b87e5d 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -659,9 +659,8 @@ if (!isDedicated) then { dayz_dodge = false; Dayz_constructionContext = []; Dayz_freefall = [ time, 0, 0.1 ]; - dayz_getout = objNull; dayz_getoutTime = 0; - dayz_HitBy = objNull; + dayz_hitByTime = 0; skipGearSound = false; TimeOutDisplayed = false; voice_actions = ["voiceOverNet","PushToTalk","PushToTalkAll","PushToTalkCommand","PushToTalkDirect","PushToTalkGroup","PushToTalkSide","PushToTalkVehicle"];