OpenTTD

Tasklist

FS#747 - bad assert checking train at station

Attached to Project: OpenTTD
Opened by Phazorx (Phazorx) - Tuesday, 24 April 2007, 18:52 GMT
Type Bug
Category Vehicles
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

r9712

sending to depot reversed loading train that is longer than station causes:
openttd: /home/ottdcoop/svn-sandbox/src/vehicle.cpp:2936: void Vehicle::LeaveStation(): Assertion `IsTileType(tile, MP_STATION) || type == VEH_SHIP' failed.

logic problem, trainhead after reversing is not on station tile anymore and fails that check.

recommendation: replace "train at station" criteria to either loading or unloading

void Vehicle::LeaveStation()
{
assert(current_order.type == OT_LOADING);
current_order.type = OT_LEAVESTATION;
current_order.flags = 0;
GetStation(this->last_station_visited)->loading_vehicles.remove(this);
}
This task depends upon

Closed by  Peter Nelson (peter1138)
Tuesday, 24 April 2007, 19:21 GMT
Reason for closing:  Fixed

Loading...