From 9eae9cf71ce8d828b5e09bd49388bfc3b13c1282 Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Thu, 23 May 2013 16:32:05 +0100
Subject: [PATCH] [Change] Rumble of the afterburners are now stored in
 outift.xml

---
 dat/outfit.xml |  2 ++
 src/outfit.c   | 12 +++++-------
 src/outfit.h   |  7 ++++---
 src/player.c   |  2 +-
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/dat/outfit.xml b/dat/outfit.xml
index cb0a603..2aa1455 100644
--- a/dat/outfit.xml
+++ b/dat/outfit.xml
@@ -255,6 +255,7 @@
    <gfx_store>afterburner</gfx_store>
   </general>
   <specific type="16">
+    <rumble>30</rumble>
    <thrust_perc>100</thrust_perc>
    <thrust_abs>50</thrust_abs>
    <speed_perc>50</speed_perc>
@@ -272,6 +273,7 @@
    <gfx_store>afterburner</gfx_store>
   </general>
   <specific type="16">
+    <rumble>50</rumble>
    <thrust_perc>185</thrust_perc>
    <thrust_abs>100</thrust_abs>
    <speed_perc>85</speed_perc>
diff --git a/src/outfit.c b/src/outfit.c
index d0c9d71..0965313 100644
--- a/src/outfit.c
+++ b/src/outfit.c
@@ -339,16 +339,14 @@ static void outfit_parseSAfterburner(Outfit* tmp, const xmlNodePtr parent) {
   tmp->u.afb.speed_perc  = 1.;
 
   do {
+    xmlr_float(node, "rumble", tmp->u.afb.rumble);
     if(xml_isNode(node, "thrust_perc"))
       tmp->u.afb.thrust_perc = 1. + xml_getFloat(node)/100.;
-    else if(xml_isNode(node, "thrust_abs"))
-      tmp->u.afb.thrust_abs = xml_getFloat(node);
-    else if(xml_isNode(node, "speed_perc"))
+    xmlr_float(node, "thrust_abs", tmp->u.afb.thrust_abs);
+    if(xml_isNode(node, "speed_perc"))
       tmp->u.afb.speed_perc = 1. + xml_getFloat(node)/100.;
-    else if(xml_isNode(node, "speed_abs"))
-      tmp->u.afb.speed_abs = xml_getFloat(node);
-    else if(xml_isNode(node, "energy"))
-      tmp->u.afb.energy = xml_getFloat(node);
+    xmlr_float(node, "speed_abs", tmp->u.afb.speed_abs);
+    xmlr_float(node, "energy", tmp->u.afb.energy);
   } while((node = node->next));
 }
 
diff --git a/src/outfit.h b/src/outfit.h
index 3a9a8a6..d9d2c88 100644
--- a/src/outfit.h
+++ b/src/outfit.h
@@ -96,9 +96,10 @@ typedef struct Outfit_ {
       int cargo; // Cargo space to add.
     } mod;
     struct { // Afterburner.
-      double thrust_perc, thrust_abs; // Percent and absolute thrust bonus.
-      double speed_perc, speed_abs;  // Percent and absolute speed bonus.
-      double energy;         // Energy used while active.
+      double rumble;                    // Percent of rumble.
+      double thrust_perc, thrust_abs;   // Percent and absolute thrust bonus.
+      double speed_perc, speed_abs;     // Percent and absolute speed bonus.
+      double energy;                    // Energy used while active.
     } afb;
   } u;
 } Outfit;
diff --git a/src/player.c b/src/player.c
index fcf3710..2838823 100644
--- a/src/player.c
+++ b/src/player.c
@@ -1305,7 +1305,7 @@ void player_afterburn(void) {
   if(player->afterburner != NULL) {
     player_setFlag(PLAYER_AFTERBURNER);
     pilot_setFlag(player, PILOT_AFTERBURNER);
-    spfx_shake(50.);
+    spfx_shake(player->afterburner->outfit->u.afb.rumble * SHAKE_MAX);
   }
 }