mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r2210) - Fix: When a road-station is deleted, also delete the assigned slots of all vehicles headed to that station. This fixes an assertion, thanks go to Tron for finding the cause.
This commit is contained in:
parent
0fa9c23225
commit
878cebaa70
@ -1560,8 +1560,17 @@ static int32 RemoveRoadStop(Station *st, uint32 flags, TileIndex tile)
|
|||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
|
int i;
|
||||||
DoClearSquare(tile);
|
DoClearSquare(tile);
|
||||||
|
|
||||||
|
/* Clear all vehicles destined for this station */
|
||||||
|
for (i = 0; i != NUM_SLOTS; i++) {
|
||||||
|
if (cur_stop->slot[i] != INVALID_SLOT) {
|
||||||
|
Vehicle *v = GetVehicle(cur_stop->slot[i]);
|
||||||
|
ClearSlot(v, v->u.road.slot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cur_stop->used = false;
|
cur_stop->used = false;
|
||||||
if (cur_stop->prev != NULL) //alter previous stop
|
if (cur_stop->prev != NULL) //alter previous stop
|
||||||
cur_stop->prev->next = cur_stop->next;
|
cur_stop->prev->next = cur_stop->next;
|
||||||
|
Loading…
Reference in New Issue
Block a user