[Add] Fuel is saved too now.
This commit is contained in:
		
							parent
							
								
									d11eabd358
								
							
						
					
					
						commit
						73d8e18a2a
					
				| @ -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 { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Allanis
						Allanis