openttd.c
branch0.5
changeset 5468 10836820b2bc
parent 5459 74356913b47d
child 5497 b9c8c76d31b7
equal deleted inserted replaced
5467:24a2a4d58223 5468:10836820b2bc
   383 			if (mgo.opt != NULL) {
   383 			if (mgo.opt != NULL) {
   384 				strcpy(_file_to_saveload.name, mgo.opt);
   384 				strcpy(_file_to_saveload.name, mgo.opt);
   385 				_switch_mode = SM_LOAD;
   385 				_switch_mode = SM_LOAD;
   386 			} else {
   386 			} else {
   387 				_switch_mode = SM_NEWGAME;
   387 				_switch_mode = SM_NEWGAME;
       
   388 				/* Give a random map */
       
   389 				generation_seed = InteractiveRandom();
   388 			}
   390 			}
   389 			break;
   391 			break;
   390 		case 'G': generation_seed = atoi(mgo.opt); break;
   392 		case 'G': generation_seed = atoi(mgo.opt); break;
   391 		case 'c': _config_file = strdup(mgo.opt); break;
   393 		case 'c': _config_file = strdup(mgo.opt); break;
   392 		case -2:
   394 		case -2:
  1592 		FOR_ALL_STATIONS(st) {
  1594 		FOR_ALL_STATIONS(st) {
  1593 			if (IsBuoy(st) && IsTileOwner(st->xy, OWNER_NONE)) SetTileOwner(st->xy, OWNER_WATER);
  1595 			if (IsBuoy(st) && IsTileOwner(st->xy, OWNER_NONE)) SetTileOwner(st->xy, OWNER_WATER);
  1594 		}
  1596 		}
  1595 	}
  1597 	}
  1596 
  1598 
       
  1599 	if (CheckSavegameVersion(7)) {
       
  1600 		Station *st;
       
  1601 		FOR_ALL_STATIONS(st) {
       
  1602 			CargoID c;
       
  1603 			for (c = 0; c < NUM_CARGO; c++) {
       
  1604 				GoodsEntry *ge = &st->goods[c];
       
  1605 
       
  1606 				/* In old versions, enroute_from used 0xFF as INVALID_STATION */
       
  1607 				if (ge->enroute_from == 0xFF) {
       
  1608 					ge->enroute_from = INVALID_STATION;
       
  1609 				}
       
  1610 			}
       
  1611 		}
       
  1612 	}
       
  1613 
  1597 	return true;
  1614 	return true;
  1598 }
  1615 }
  1599 
  1616 
  1600 /** Reload all NewGRF files during a running game. This is a cut-down
  1617 /** Reload all NewGRF files during a running game. This is a cut-down
  1601  * version of AfterLoadGame().
  1618  * version of AfterLoadGame().