From 3f0b6650e00826a6057db1839c5f6aac3622fecd Mon Sep 17 00:00:00 2001
From: Glowbal <thomasskooi@live.nl>
Date: Sun, 1 Feb 2015 11:11:51 +0100
Subject: [PATCH 1/3] Added weapon resting & weapon jam sounds

---
 addons/overheating/CfgSounds.hpp              |  20 ++++++++++++++++++
 addons/overheating/functions/fnc_clearJam.sqf |   8 ++++++-
 .../overheating/sounds}/fixing_pistol.wav     | Bin
 .../overheating/sounds}/fixing_rifle.wav      | Bin
 .../overheating/sounds}/jamming_pistol.wav    | Bin
 .../overheating/sounds}/jamming_rifle.wav     | Bin
 addons/resting/CfgSounds.hpp                  |  14 ++++++++++++
 addons/resting/config.cpp                     |   2 ++
 addons/resting/functions/fnc_restWeapon.sqf   |   4 ++++
 addons/resting/functions/fnc_unRestWeapon.sqf |   2 ++
 .../resting/sounds}/weaponrest_rest.wav       | Bin
 .../resting/sounds}/weaponrest_unrest.wav     | Bin
 12 files changed, 49 insertions(+), 1 deletion(-)
 rename {TO_MERGE/cse/sys_weaponheat/sound => addons/overheating/sounds}/fixing_pistol.wav (100%)
 rename {TO_MERGE/cse/sys_weaponheat/sound => addons/overheating/sounds}/fixing_rifle.wav (100%)
 rename {TO_MERGE/cse/sys_weaponheat/sound => addons/overheating/sounds}/jamming_pistol.wav (100%)
 rename {TO_MERGE/cse/sys_weaponheat/sound => addons/overheating/sounds}/jamming_rifle.wav (100%)
 create mode 100644 addons/resting/CfgSounds.hpp
 rename {TO_MERGE/cse/sys_equipment/weaponresting/sound => addons/resting/sounds}/weaponrest_rest.wav (100%)
 rename {TO_MERGE/cse/sys_equipment/weaponresting/sound => addons/resting/sounds}/weaponrest_unrest.wav (100%)

diff --git a/addons/overheating/CfgSounds.hpp b/addons/overheating/CfgSounds.hpp
index fd3a5596bd..d230561c09 100644
--- a/addons/overheating/CfgSounds.hpp
+++ b/addons/overheating/CfgSounds.hpp
@@ -3,4 +3,24 @@ class CfgSounds {
         sound[] = {QUOTE(PATHTOF(sounds\barrelswap.ogg)),5,1,200};
         titles[] = {};
     };
+	class GVAR(jamming_rifle) {
+		name=QGVAR(jamming_rifle);
+		sound[]={QUOTE(PATHTOF(sounds\jamming_rifle.wav)),1,1};
+		titles[]={};
+	};
+	class GVAR(jamming_pistol) {
+		name=QGVAR(jamming_pistol);
+		sound[]={QUOTE(PATHTOF(sounds\jamming_pistol.wav)),1,1};
+		titles[]={};
+	};
+	class GVAR(fixing_rifle) {
+		name=QGVAR(fixing_rifle);
+		sound[]={QUOTE(PATHTOF(sounds\fixing_rifle.wav)),1,1};
+		titles[]={};
+	};
+	class GVAR(fixing_pistol) {
+		name= QGVAR(fixing_pistol);
+		sound[]={QUOTE(PATHTOF(sounds\fixing_pistol.wav)),1,1};
+		titles[]={};
+	};
 };
diff --git a/addons/overheating/functions/fnc_clearJam.sqf b/addons/overheating/functions/fnc_clearJam.sqf
index 829ab34811..2340c6c890 100644
--- a/addons/overheating/functions/fnc_clearJam.sqf
+++ b/addons/overheating/functions/fnc_clearJam.sqf
@@ -42,6 +42,12 @@ if (_weapon in _jammedWeapons) then {
 
     _unit playActionNow _clearJamAction;
   };
-
+  if (_weapon == primaryWeapon _unit) then {
+    playSound QGVAR(fixing_rifle);
+  } else {
+    if (_weapon == secondaryWeapon _unit) then {
+      playSound QGVAR(fixing_pistol);
+    };
+  };
   [localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured);
 };
diff --git a/TO_MERGE/cse/sys_weaponheat/sound/fixing_pistol.wav b/addons/overheating/sounds/fixing_pistol.wav
similarity index 100%
rename from TO_MERGE/cse/sys_weaponheat/sound/fixing_pistol.wav
rename to addons/overheating/sounds/fixing_pistol.wav
diff --git a/TO_MERGE/cse/sys_weaponheat/sound/fixing_rifle.wav b/addons/overheating/sounds/fixing_rifle.wav
similarity index 100%
rename from TO_MERGE/cse/sys_weaponheat/sound/fixing_rifle.wav
rename to addons/overheating/sounds/fixing_rifle.wav
diff --git a/TO_MERGE/cse/sys_weaponheat/sound/jamming_pistol.wav b/addons/overheating/sounds/jamming_pistol.wav
similarity index 100%
rename from TO_MERGE/cse/sys_weaponheat/sound/jamming_pistol.wav
rename to addons/overheating/sounds/jamming_pistol.wav
diff --git a/TO_MERGE/cse/sys_weaponheat/sound/jamming_rifle.wav b/addons/overheating/sounds/jamming_rifle.wav
similarity index 100%
rename from TO_MERGE/cse/sys_weaponheat/sound/jamming_rifle.wav
rename to addons/overheating/sounds/jamming_rifle.wav
diff --git a/addons/resting/CfgSounds.hpp b/addons/resting/CfgSounds.hpp
new file mode 100644
index 0000000000..b55d4d9ae8
--- /dev/null
+++ b/addons/resting/CfgSounds.hpp
@@ -0,0 +1,14 @@
+class CfgSounds {
+    class GVAR(rest)
+    {
+        name=QGVAR(rest);
+        sound[]={QUOTE(PATHTOF(sounds\weaponrest_rest.wav)),1,1};
+        titles[]={};
+    };
+    class GVAR(unrest)
+    {
+        name=QGVAR(unrest);
+        sound[]={QUOTE(PATHTOF(sounds\weaponrest_unrest.wav)),1,1};
+        titles[]={};
+    };
+};
\ No newline at end of file
diff --git a/addons/resting/config.cpp b/addons/resting/config.cpp
index ac710c82a8..599c15d318 100644
--- a/addons/resting/config.cpp
+++ b/addons/resting/config.cpp
@@ -17,3 +17,5 @@ class CfgPatches {
 #include "CfgWeapons.hpp"
 
 #include "CfgMoves.hpp"
+
+#include "CfgSounds.hpp"
\ No newline at end of file
diff --git a/addons/resting/functions/fnc_restWeapon.sqf b/addons/resting/functions/fnc_restWeapon.sqf
index e22a1309f3..e66e13bc6f 100644
--- a/addons/resting/functions/fnc_restWeapon.sqf
+++ b/addons/resting/functions/fnc_restWeapon.sqf
@@ -14,6 +14,8 @@
 
 EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon);
 
+systemChat format["restingWeapon %1", _this];
+
 if (_weapon != primaryWeapon _unit) exitWith {};
 
 if (_unit getVariable ["ACE_weaponRested", false]) exitWith {_this call FUNC(unRestWeapon)};
@@ -33,6 +35,8 @@ if (true in _intersects) then {
 
   // REST THE WEAPON
   addCamShake CAMSHAKE;
+  playSound QGVAR(rest);
+ // playSound3D [QUOTE(PATHTOF(sounds\weaponrest_rest.wav)), _unit];
 
   if ([_weapon] call FUNC(hasBipod) && {_intersects select 3}) then {
     _unit setVariable ["ACE_bipodDeployed", true];
diff --git a/addons/resting/functions/fnc_unRestWeapon.sqf b/addons/resting/functions/fnc_unRestWeapon.sqf
index b182cd89e8..deeb4f6c52 100644
--- a/addons/resting/functions/fnc_unRestWeapon.sqf
+++ b/addons/resting/functions/fnc_unRestWeapon.sqf
@@ -43,6 +43,8 @@ if (_unit getVariable ["ACE_bipodDeployed", false]) then {
   _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
   [localize "STR_ACE_Resting_WeaponLifted", _picture] call EFUNC(common,displayTextPicture);
 };
+playSound QGVAR(unrest);
+//playSound3D [QUOTE(PATHTOF(sounds\weaponrest_unrest.wav)), _unit];
 
 _unit setVariable ["ACE_weaponRested", false];
 _unit setVariable ["ACE_bipodDeployed", false];
diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/sound/weaponrest_rest.wav b/addons/resting/sounds/weaponrest_rest.wav
similarity index 100%
rename from TO_MERGE/cse/sys_equipment/weaponresting/sound/weaponrest_rest.wav
rename to addons/resting/sounds/weaponrest_rest.wav
diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/sound/weaponrest_unrest.wav b/addons/resting/sounds/weaponrest_unrest.wav
similarity index 100%
rename from TO_MERGE/cse/sys_equipment/weaponresting/sound/weaponrest_unrest.wav
rename to addons/resting/sounds/weaponrest_unrest.wav

From 96e0d0e758514eceb8210441b48c9e89ca07c618 Mon Sep 17 00:00:00 2001
From: Glowbal <thomasskooi@live.nl>
Date: Sun, 1 Feb 2015 11:14:21 +0100
Subject: [PATCH 2/3] Removed rouge debug code & dead code

---
 addons/resting/functions/fnc_restWeapon.sqf   | 3 ---
 addons/resting/functions/fnc_unRestWeapon.sqf | 1 -
 2 files changed, 4 deletions(-)

diff --git a/addons/resting/functions/fnc_restWeapon.sqf b/addons/resting/functions/fnc_restWeapon.sqf
index e66e13bc6f..52b1932f62 100644
--- a/addons/resting/functions/fnc_restWeapon.sqf
+++ b/addons/resting/functions/fnc_restWeapon.sqf
@@ -14,8 +14,6 @@
 
 EXPLODE_3_PVT(_this,_unit,_vehicle,_weapon);
 
-systemChat format["restingWeapon %1", _this];
-
 if (_weapon != primaryWeapon _unit) exitWith {};
 
 if (_unit getVariable ["ACE_weaponRested", false]) exitWith {_this call FUNC(unRestWeapon)};
@@ -36,7 +34,6 @@ if (true in _intersects) then {
   // REST THE WEAPON
   addCamShake CAMSHAKE;
   playSound QGVAR(rest);
- // playSound3D [QUOTE(PATHTOF(sounds\weaponrest_rest.wav)), _unit];
 
   if ([_weapon] call FUNC(hasBipod) && {_intersects select 3}) then {
     _unit setVariable ["ACE_bipodDeployed", true];
diff --git a/addons/resting/functions/fnc_unRestWeapon.sqf b/addons/resting/functions/fnc_unRestWeapon.sqf
index deeb4f6c52..86caa31ac8 100644
--- a/addons/resting/functions/fnc_unRestWeapon.sqf
+++ b/addons/resting/functions/fnc_unRestWeapon.sqf
@@ -44,7 +44,6 @@ if (_unit getVariable ["ACE_bipodDeployed", false]) then {
   [localize "STR_ACE_Resting_WeaponLifted", _picture] call EFUNC(common,displayTextPicture);
 };
 playSound QGVAR(unrest);
-//playSound3D [QUOTE(PATHTOF(sounds\weaponrest_unrest.wav)), _unit];
 
 _unit setVariable ["ACE_weaponRested", false];
 _unit setVariable ["ACE_bipodDeployed", false];

From 0419b7cbe5f9c7797bab070fc98ac4e06af6e9fd Mon Sep 17 00:00:00 2001
From: Glowbal <thomasskooi@live.nl>
Date: Sun, 1 Feb 2015 11:17:15 +0100
Subject: [PATCH 3/3] Formatting

---
 addons/overheating/CfgSounds.hpp | 40 ++++++++++++++++----------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/addons/overheating/CfgSounds.hpp b/addons/overheating/CfgSounds.hpp
index d230561c09..c32fc02abf 100644
--- a/addons/overheating/CfgSounds.hpp
+++ b/addons/overheating/CfgSounds.hpp
@@ -3,24 +3,24 @@ class CfgSounds {
         sound[] = {QUOTE(PATHTOF(sounds\barrelswap.ogg)),5,1,200};
         titles[] = {};
     };
-	class GVAR(jamming_rifle) {
-		name=QGVAR(jamming_rifle);
-		sound[]={QUOTE(PATHTOF(sounds\jamming_rifle.wav)),1,1};
-		titles[]={};
-	};
-	class GVAR(jamming_pistol) {
-		name=QGVAR(jamming_pistol);
-		sound[]={QUOTE(PATHTOF(sounds\jamming_pistol.wav)),1,1};
-		titles[]={};
-	};
-	class GVAR(fixing_rifle) {
-		name=QGVAR(fixing_rifle);
-		sound[]={QUOTE(PATHTOF(sounds\fixing_rifle.wav)),1,1};
-		titles[]={};
-	};
-	class GVAR(fixing_pistol) {
-		name= QGVAR(fixing_pistol);
-		sound[]={QUOTE(PATHTOF(sounds\fixing_pistol.wav)),1,1};
-		titles[]={};
-	};
+    class GVAR(jamming_rifle) {
+        name=QGVAR(jamming_rifle);
+        sound[]={QUOTE(PATHTOF(sounds\jamming_rifle.wav)),1,1};
+        titles[]={};
+    };
+    class GVAR(jamming_pistol) {
+        name=QGVAR(jamming_pistol);
+        sound[]={QUOTE(PATHTOF(sounds\jamming_pistol.wav)),1,1};
+        titles[]={};
+    };
+    class GVAR(fixing_rifle) {
+        name=QGVAR(fixing_rifle);
+        sound[]={QUOTE(PATHTOF(sounds\fixing_rifle.wav)),1,1};
+        titles[]={};
+    };
+    class GVAR(fixing_pistol) {
+        name= QGVAR(fixing_pistol);
+        sound[]={QUOTE(PATHTOF(sounds\fixing_pistol.wav)),1,1};
+        titles[]={};
+    };
 };