[Fix] Fuel loads properly now.

This commit is contained in:
Allanis 2013-07-06 14:46:06 +01:00
parent 26211ee1f5
commit 7a66419f7c

View File

@ -1762,7 +1762,7 @@ static int player_parseShip(xmlNodePtr parent, int is_player) {
if(!is_player == 0) xmlr_str(node, "location", loc); if(!is_player == 0) xmlr_str(node, "location", loc);
/* Get fuel. */ /* Get fuel. */
xmlr_float(node, "fuel", ship->fuel); xmlr_float(node, "fuel", fuel);
if(xml_isNode(node, "outfits")) { if(xml_isNode(node, "outfits")) {
cur = node->xmlChildrenNode; cur = node->xmlChildrenNode;
@ -1797,6 +1797,10 @@ static int player_parseShip(xmlNodePtr parent, int is_player) {
} }
} while(xml_nextNode(node)); } while(xml_nextNode(node));
/* Set fuel. */
if(fuel != 0)
ship->fuel = MIN(ship->fuel_max, fuel);
/* Add it to the stack if it's not what the player is in. */ /* Add it to the stack if it's not what the player is in. */
if(is_player == 0) { if(is_player == 0) {
player_stack = realloc(player_stack, sizeof(Pilot*)*(player_nstack+1)); player_stack = realloc(player_stack, sizeof(Pilot*)*(player_nstack+1));