From c2d44ebb74943e6cd1fb36289970c7bb663d756d Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Sun, 17 Mar 2013 20:13:43 +0000
Subject: [PATCH] [Fix] FFS. Wasn't incrementing number of outfits while trying
 to add it.

---
 src/land.c   | 3 ++-
 src/outfit.c | 8 ++++----
 src/pilot.c  | 1 +
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/land.c b/src/land.c
index 1889b35..2669af9 100644
--- a/src/land.c
+++ b/src/land.c
@@ -278,6 +278,7 @@ static void outfits_buy(char* str) {
 
 	q = outfits_getMod();
 
+	// Can player actually fit the outfit?
 	if((player_freeSpace() - outfit->mass) < 0) {
 		toolkit_alert("No enough free space (you need %d more slots).",
 					outfit->mass - player_freeSpace());
@@ -288,7 +289,7 @@ static void outfits_buy(char* str) {
 		toolkit_alert("You can only carry %d of this outfit.", outfit->max);
 		return;
 	}
-	
+	// Not enough.
 	else if(q*(int)outfit->price >= player_credits) {
 		credits2str(buf, q*outfit->price - player_credits, 2);
 		toolkit_alert("You need %s more SCred.", buf);
diff --git a/src/outfit.c b/src/outfit.c
index 653f7bc..354d509 100644
--- a/src/outfit.c
+++ b/src/outfit.c
@@ -158,6 +158,10 @@ const char* outfit_typename[] = {
 	"Modification"
 };
 
+const char* outfit_getType(const Outfit* o) {
+  return outfit_typename[o->type];
+}
+
 // Return the broad outfit type.
 const char* outfit_typenamebroad[] = { 
 	"NULL",
@@ -179,10 +183,6 @@ const char* outfit_getTypeBroad(const Outfit* o) {
   return outfit_typenamebroad[i];
 }
 
-const char* outfit_getType(const Outfit* o) {
-  return outfit_typename[o->type];
-}
-
 // Parses the specific area for a weapon and loads it into outfit.
 static void outfit_parseSWeapon(Outfit* tmp, const xmlNodePtr parent) {
   xmlNodePtr cur, node;
diff --git a/src/pilot.c b/src/pilot.c
index d169491..705cd9e 100644
--- a/src/pilot.c
+++ b/src/pilot.c
@@ -454,6 +454,7 @@ int pilot_addOutfit(Pilot* pilot, Outfit* outfit, int quantity) {
 		pilot->outfits[i].quantity = outfit->max;
 	}
 	pilot->outfits[pilot->noutfits].timer 		= 0;
+	(pilot->noutfits)++;
 
 	if(outfit_isTurret(outfit))
 		// Used to speed up AI.