From 7a66419f7c0d5e38ea6ceb095637118e10cb3b6f Mon Sep 17 00:00:00 2001 From: Allanis <allanis@saracraft.net> Date: Sat, 6 Jul 2013 14:46:06 +0100 Subject: [PATCH] [Fix] Fuel loads properly now. --- src/player.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/player.c b/src/player.c index dd6a9b9..854a970 100644 --- a/src/player.c +++ b/src/player.c @@ -1762,7 +1762,7 @@ static int player_parseShip(xmlNodePtr parent, int is_player) { if(!is_player == 0) xmlr_str(node, "location", loc); /* Get fuel. */ - xmlr_float(node, "fuel", ship->fuel); + xmlr_float(node, "fuel", fuel); if(xml_isNode(node, "outfits")) { cur = node->xmlChildrenNode; @@ -1796,6 +1796,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. */ if(is_player == 0) {