From 18fd198d1e9c0bf31acf0715d543ba07579e194f Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Sun, 26 Jun 2016 20:02:14 -0300 Subject: [PATCH 1/3] If the surface is not horizontal create _v2 pointing upward instead of away --- addons/tagging/functions/fnc_tag.sqf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/tagging/functions/fnc_tag.sqf b/addons/tagging/functions/fnc_tag.sqf index d14e65ae7f..6b55730a94 100644 --- a/addons/tagging/functions/fnc_tag.sqf +++ b/addons/tagging/functions/fnc_tag.sqf @@ -72,6 +72,11 @@ if (_surfaceNormal vectorDotProduct (_endPosASL vectorDiff _startPosASL) > 0) t // Check if its a valid surface: big enough, reasonably plane private _v1 = vectorNormalized (_surfaceNormal vectorMultiply -1); private _v2 = vectorNormalized (_v1 vectorCrossProduct (_endPosASL vectorDiff _startPosASL)); +// If the surface is not horizontal (>25º), create vup _v2 pointing upward instead of away +if (_v1 select 2 > -0.42) then { + private _v3Temp = _v1 vectorCrossProduct [0, 0, 1]; + _v2 = _v3Temp vectorCrossProduct _v1; +}; private _v3 = _v2 vectorCrossProduct _v1; TRACE_3("Reference:", _v1, _v2, _v3); From d6d6ed767437d0fab24b3e68662dc84cf8763316 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Sun, 26 Jun 2016 20:17:51 -0300 Subject: [PATCH 2/3] Make it work properly and support ceilings --- addons/tagging/functions/fnc_tag.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/tagging/functions/fnc_tag.sqf b/addons/tagging/functions/fnc_tag.sqf index 6b55730a94..165441f80e 100644 --- a/addons/tagging/functions/fnc_tag.sqf +++ b/addons/tagging/functions/fnc_tag.sqf @@ -72,8 +72,8 @@ if (_surfaceNormal vectorDotProduct (_endPosASL vectorDiff _startPosASL) > 0) t // Check if its a valid surface: big enough, reasonably plane private _v1 = vectorNormalized (_surfaceNormal vectorMultiply -1); private _v2 = vectorNormalized (_v1 vectorCrossProduct (_endPosASL vectorDiff _startPosASL)); -// If the surface is not horizontal (>25º), create vup _v2 pointing upward instead of away -if (_v1 select 2 > -0.42) then { +// If the surface is not horizontal (>20º), create vup _v2 pointing upward instead of away +if (abs (_v1 select 2) < 0.94) then { private _v3Temp = _v1 vectorCrossProduct [0, 0, 1]; _v2 = _v3Temp vectorCrossProduct _v1; }; From 10a19b59e7602c7b3b78c34cc24abfc1c2e7ebab Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 26 Jun 2016 22:18:53 -0500 Subject: [PATCH 3/3] Swich EFUNC(common,waitAndExecute) to CBA --- .../medical/functions/fnc_showBloodEffect.sqf | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/medical/functions/fnc_showBloodEffect.sqf b/addons/medical/functions/fnc_showBloodEffect.sqf index 3e1e8931b3..7659064aaa 100644 --- a/addons/medical/functions/fnc_showBloodEffect.sqf +++ b/addons/medical/functions/fnc_showBloodEffect.sqf @@ -72,7 +72,7 @@ if (_bloodRemaining < 25) exitWith { [{ (_this select 0) ctrlSetFade 1; (_this select 0) ctrlCommit 0.8; - }, _fxBloodControls, 0.7] call EFUNC(common,waitAndExecute); + }, _fxBloodControls, 0.7] call CBA_fnc_waitAndExecute; }; if (_bloodRemaining < 40) exitWith { @@ -85,11 +85,11 @@ if (_bloodRemaining < 40) exitWith { (_this select 0) ctrlSetFade 1; (_this select 1) ctrlSetFade 1; (_this select 1) ctrlCommit 1; - }, _fxBloodControls, 0.7] call EFUNC(common,waitAndExecute); + }, _fxBloodControls, 0.7] call CBA_fnc_waitAndExecute; [{ (_this select 0) ctrlCommit 0.8; - }, _fxBloodControls, 1.2] call EFUNC(common,waitAndExecute); + }, _fxBloodControls, 1.2] call CBA_fnc_waitAndExecute; }; if (_bloodRemaining < 55) exitWith { @@ -103,11 +103,11 @@ if (_bloodRemaining < 55) exitWith { (_this select 1) ctrlSetFade 1; (_this select 2) ctrlSetFade 1; (_this select 1) ctrlCommit 1; - }, _fxBloodControls, 0.7] call EFUNC(common,waitAndExecute); + }, _fxBloodControls, 0.7] call CBA_fnc_waitAndExecute; [{ (_this select 0) ctrlCommit 0.8; - }, _fxBloodControls, 1.2] call EFUNC(common,waitAndExecute); + }, _fxBloodControls, 1.2] call CBA_fnc_waitAndExecute; }; if (_bloodRemaining < 70) exitWith { @@ -123,15 +123,15 @@ if (_bloodRemaining < 70) exitWith { (_this select 1) ctrlSetFade 1; (_this select 2) ctrlSetFade 1; (_this select 2) ctrlCommit 1.5; - }, _fxBloodControls, 0.7] call EFUNC(common,waitAndExecute); + }, _fxBloodControls, 0.7] call CBA_fnc_waitAndExecute; [{ (_this select 1) ctrlCommit 1; - }, _fxBloodControls, 1.7] call EFUNC(common,waitAndExecute); + }, _fxBloodControls, 1.7] call CBA_fnc_waitAndExecute; [{ (_this select 0) ctrlCommit 0.8; - }, _fxBloodControls, 2.2] call EFUNC(common,waitAndExecute); + }, _fxBloodControls, 2.2] call CBA_fnc_waitAndExecute; }; //default @@ -147,12 +147,12 @@ _bloodCtrl3 ctrlCommit 0.2; (_this select 1) ctrlSetFade 1; (_this select 2) ctrlSetFade 1; (_this select 2) ctrlCommit 1.5; -}, _fxBloodControls, 0.7] call EFUNC(common,waitAndExecute); +}, _fxBloodControls, 0.7] call CBA_fnc_waitAndExecute; [{ (_this select 1) ctrlCommit 1; -}, _fxBloodControls, 1.7] call EFUNC(common,waitAndExecute); +}, _fxBloodControls, 1.7] call CBA_fnc_waitAndExecute; [{ (_this select 0) ctrlCommit 0.8; -}, _fxBloodControls, 2.2] call EFUNC(common,waitAndExecute); +}, _fxBloodControls, 2.2] call CBA_fnc_waitAndExecute;