src/economy.cpp
changeset 8727 797f81c2e88e
parent 8726 5ae45b46506b
child 8734 b7fc8c6fd379
equal deleted inserted replaced
8726:5ae45b46506b 8727:797f81c2e88e
  1546 			}
  1546 			}
  1547 		}
  1547 		}
  1548 		return;
  1548 		return;
  1549 	}
  1549 	}
  1550 
  1550 
  1551 	if (v->type == VEH_TRAIN && !IsTileType(v->tile, MP_STATION)) {
  1551 	StationID last_visited = v->last_station_visited;
       
  1552 	Station *st = GetStation(last_visited);
       
  1553 
       
  1554 	if (v->type == VEH_TRAIN && (!IsTileType(v->tile, MP_STATION) || GetStationIndex(v->tile) != st->index)) {
  1552 		/* The train reversed in the station. Take the "easy" way
  1555 		/* The train reversed in the station. Take the "easy" way
  1553 		 * out and let the train just leave as it always did. */
  1556 		 * out and let the train just leave as it always did. */
  1554 		SetBit(v->vehicle_flags, VF_LOADING_FINISHED);
  1557 		SetBit(v->vehicle_flags, VF_LOADING_FINISHED);
  1555 		return;
  1558 		return;
  1556 	}
  1559 	}
  1565 	bool anything_loaded   = false;
  1568 	bool anything_loaded   = false;
  1566 	uint32 cargo_not_full  = 0;
  1569 	uint32 cargo_not_full  = 0;
  1567 	uint32 cargo_full      = 0;
  1570 	uint32 cargo_full      = 0;
  1568 
  1571 
  1569 	v->cur_speed = 0;
  1572 	v->cur_speed = 0;
  1570 
       
  1571 	StationID last_visited = v->last_station_visited;
       
  1572 	Station *st = GetStation(last_visited);
       
  1573 
  1573 
  1574 	for (; v != NULL; v = v->Next()) {
  1574 	for (; v != NULL; v = v->Next()) {
  1575 		if (v->cargo_cap == 0) continue;
  1575 		if (v->cargo_cap == 0) continue;
  1576 
  1576 
  1577 		byte load_amount = EngInfo(v->engine_type)->load_amount;
  1577 		byte load_amount = EngInfo(v->engine_type)->load_amount;