[Fix] Fuel loads properly now.
This commit is contained in:
parent
26211ee1f5
commit
7a66419f7c
@ -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));
|
||||||
|
Loading…
Reference in New Issue
Block a user