diff --git a/src/player.c b/src/player.c index 3932ea4..6a0a5ca 100644 --- a/src/player.c +++ b/src/player.c @@ -1594,6 +1594,9 @@ static int player_saveShip(xmlTextWriterPtr writer, Pilot* ship, char* loc) { if(loc != NULL) xmlw_elem(writer, "location", loc); + /* Save the fuel. */ + xmlw_elem(writer, "fuel", "%f", ship->fuel); + /* Save the outfits. */ xmlw_startElem(writer, "outfits"); for(i = 0; i < ship->noutfits; i++) { @@ -1717,6 +1720,7 @@ static int player_parseDone(xmlNodePtr parent) { static int player_parseShip(xmlNodePtr parent, int is_player) { char* name, *model, *loc, *q, *id; int i, n; + double fuel; Pilot* ship; xmlNodePtr node, cur; @@ -1737,9 +1741,14 @@ static int player_parseShip(xmlNodePtr parent, int is_player) { node = parent->xmlChildrenNode; + fuel = 0; + do { if(!is_player == 0) xmlr_str(node, "location", loc); + /* Get fuel. */ + xmlr_float(node, "fuel", ship->fuel); + if(xml_isNode(node, "outfits")) { cur = node->xmlChildrenNode; do {