[Fix] FFS. Wasn't incrementing number of outfits while trying to add it.

This commit is contained in:
Allanis 2013-03-17 20:13:43 +00:00
parent a037112f72
commit c2d44ebb74
3 changed files with 7 additions and 5 deletions

View File

@ -278,6 +278,7 @@ static void outfits_buy(char* str) {
q = outfits_getMod(); q = outfits_getMod();
// Can player actually fit the outfit?
if((player_freeSpace() - outfit->mass) < 0) { if((player_freeSpace() - outfit->mass) < 0) {
toolkit_alert("No enough free space (you need %d more slots).", toolkit_alert("No enough free space (you need %d more slots).",
outfit->mass - player_freeSpace()); 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); toolkit_alert("You can only carry %d of this outfit.", outfit->max);
return; return;
} }
// Not enough.
else if(q*(int)outfit->price >= player_credits) { else if(q*(int)outfit->price >= player_credits) {
credits2str(buf, q*outfit->price - player_credits, 2); credits2str(buf, q*outfit->price - player_credits, 2);
toolkit_alert("You need %s more SCred.", buf); toolkit_alert("You need %s more SCred.", buf);

View File

@ -158,6 +158,10 @@ const char* outfit_typename[] = {
"Modification" "Modification"
}; };
const char* outfit_getType(const Outfit* o) {
return outfit_typename[o->type];
}
// Return the broad outfit type. // Return the broad outfit type.
const char* outfit_typenamebroad[] = { const char* outfit_typenamebroad[] = {
"NULL", "NULL",
@ -179,10 +183,6 @@ const char* outfit_getTypeBroad(const Outfit* o) {
return outfit_typenamebroad[i]; 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. // Parses the specific area for a weapon and loads it into outfit.
static void outfit_parseSWeapon(Outfit* tmp, const xmlNodePtr parent) { static void outfit_parseSWeapon(Outfit* tmp, const xmlNodePtr parent) {
xmlNodePtr cur, node; xmlNodePtr cur, node;

View File

@ -454,6 +454,7 @@ int pilot_addOutfit(Pilot* pilot, Outfit* outfit, int quantity) {
pilot->outfits[i].quantity = outfit->max; pilot->outfits[i].quantity = outfit->max;
} }
pilot->outfits[pilot->noutfits].timer = 0; pilot->outfits[pilot->noutfits].timer = 0;
(pilot->noutfits)++;
if(outfit_isTurret(outfit)) if(outfit_isTurret(outfit))
// Used to speed up AI. // Used to speed up AI.