Update to 1.10.0-beta2

This commit is contained in:
dP
2020-01-06 18:49:34 +03:00
parent 599ccf0c2b
commit c7c3966eec
1366 changed files with 2926 additions and 5639 deletions
+12 -26
View File
@@ -1,5 +1,3 @@
/* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
@@ -42,16 +40,14 @@ static void UpdateWaypointOrder(Order *o)
void MoveBuoysToWaypoints()
{
/* Buoy orders become waypoint orders */
OrderList *ol;
FOR_ALL_ORDER_LISTS(ol) {
for (OrderList *ol : OrderList::Iterate()) {
VehicleType vt = ol->GetFirstSharedVehicle()->type;
if (vt != VEH_SHIP && vt != VEH_TRAIN) continue;
for (Order *o = ol->GetFirstOrder(); o != nullptr; o = o->next) UpdateWaypointOrder(o);
}
Vehicle *v;
FOR_ALL_VEHICLES(v) {
for (Vehicle *v : Vehicle::Iterate()) {
VehicleType vt = v->type;
if (vt != VEH_SHIP && vt != VEH_TRAIN) continue;
@@ -59,8 +55,7 @@ void MoveBuoysToWaypoints()
}
/* Now make the stations waypoints */
Station *st;
FOR_ALL_STATIONS(st) {
for (Station *st : Station::Iterate()) {
if ((st->had_vehicle_of_type & HVOT_WAYPOINT) == 0) continue;
StationID index = st->index;
@@ -111,8 +106,7 @@ void MoveBuoysToWaypoints()
void AfterLoadStations()
{
/* Update the speclists of all stations to point to the currently loaded custom stations. */
BaseStation *st;
FOR_ALL_BASE_STATIONS(st) {
for (BaseStation *st : BaseStation::Iterate()) {
for (uint i = 0; i < st->num_specs; i++) {
if (st->speclist[i].grfid == 0) continue;
@@ -135,12 +129,11 @@ void AfterLoadStations()
void AfterLoadRoadStops()
{
/* First construct the drive through entries */
RoadStop *rs;
FOR_ALL_ROADSTOPS(rs) {
for (RoadStop *rs : RoadStop::Iterate()) {
if (IsDriveThroughStopTile(rs->xy)) rs->MakeDriveThrough();
}
/* And then rebuild the data in those entries */
FOR_ALL_ROADSTOPS(rs) {
for (RoadStop *rs : RoadStop::Iterate()) {
if (!HasBit(rs->status, RoadStop::RSSFB_BASE_ENTRY)) continue;
rs->GetEntry(DIAGDIR_NE)->Rebuild(rs);
@@ -378,8 +371,7 @@ static void Ptrs_STNS()
if (!IsSavegameVersionBefore(SLV_123)) return;
uint num_cargo = IsSavegameVersionBefore(SLV_EXTEND_CARGOTYPES) ? 32 : NUM_CARGO;
Station *st;
FOR_ALL_STATIONS(st) {
for (Station *st : Station::Iterate()) {
if (!IsSavegameVersionBefore(SLV_68)) {
for (CargoID i = 0; i < num_cargo; i++) {
GoodsEntry *ge = &st->goods[i];
@@ -516,9 +508,8 @@ static void RealSave_STNN(BaseStation *bst)
static void Save_STNN()
{
BaseStation *st;
/* Write the stations */
FOR_ALL_BASE_STATIONS(st) {
for (BaseStation *st : BaseStation::Iterate()) {
SlSetArrayIndex(st->index);
SlAutolength((AutolengthProc*)RealSave_STNN, st);
}
@@ -590,8 +581,7 @@ static void Ptrs_STNN()
if (IsSavegameVersionBefore(SLV_123)) return;
uint num_cargo = IsSavegameVersionBefore(SLV_EXTEND_CARGOTYPES) ? 32 : NUM_CARGO;
Station *st;
FOR_ALL_STATIONS(st) {
for (Station *st : Station::Iterate()) {
for (CargoID i = 0; i < num_cargo; i++) {
GoodsEntry *ge = &st->goods[i];
if (IsSavegameVersionBefore(SLV_183)) {
@@ -608,17 +598,14 @@ static void Ptrs_STNN()
SlObject(st, _station_desc);
}
Waypoint *wp;
FOR_ALL_WAYPOINTS(wp) {
for (Waypoint *wp : Waypoint::Iterate()) {
SlObject(wp, _waypoint_desc);
}
}
static void Save_ROADSTOP()
{
RoadStop *rs;
FOR_ALL_ROADSTOPS(rs) {
for (RoadStop *rs : RoadStop::Iterate()) {
SlSetArrayIndex(rs->index);
SlObject(rs, _roadstop_desc);
}
@@ -637,8 +624,7 @@ static void Load_ROADSTOP()
static void Ptrs_ROADSTOP()
{
RoadStop *rs;
FOR_ALL_ROADSTOPS(rs) {
for (RoadStop *rs : RoadStop::Iterate()) {
SlObject(rs, _roadstop_desc);
}
}