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.