Mercurial > hg > openttd
diff src/station_cmd.cpp @ 8300:ae1baac75172 draft
(svn r11864) -Codechange: pass owner whose signals we will update instead of complex detection later
author | smatz <smatz@openttd.org> |
---|---|
date | Tue, 15 Jan 2008 15:00:01 +0000 |
parents | f3452c2b7b01 |
children | 56a9dfa21fe7 |
line wrap: on
line diff
--- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1073,7 +1073,7 @@ tile += tile_delta; } while (--w); - SetSignalsOnBothDir(tile_org, track); + SetSignalsOnBothDir(tile_org, track, _current_player); YapfNotifyTrackLayoutChange(tile_org, track); tile_org += tile_delta ^ TileDiffXY(1, 1); // perpendicular to tile_delta } while (--numtracks); @@ -1202,11 +1202,14 @@ quantity++; if (flags & DC_EXEC) { + /* read variables before the station tile is removed */ uint specindex = GetCustomStationSpecIndex(tile2); Track track = GetRailStationTrack(tile2); + Owner owner = GetTileOwner(tile2); + DoClearSquare(tile2); st->rect.AfterRemoveTile(st, tile2); - SetSignalsOnBothDir(tile2, track); + SetSignalsOnBothDir(tile2, track, owner); YapfNotifyTrackLayoutChange(tile2, track); DeallocateSpecFromStation(st, specindex); @@ -1257,15 +1260,17 @@ do { int w_bak = w; do { - // for nonuniform stations, only remove tiles that are actually train station tiles + /* for nonuniform stations, only remove tiles that are actually train station tiles */ if (st->TileBelongsToRailStation(tile)) { if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR; cost.AddCost(_price.remove_rail_station); if (flags & DC_EXEC) { + /* read variables before the station tile is removed */ Track track = GetRailStationTrack(tile); + Owner owner = GetTileOwner(tile); // _current_player can be OWNER_WATER DoClearSquare(tile); - SetSignalsOnBothDir(tile, track); + SetSignalsOnBothDir(tile, track, owner); YapfNotifyTrackLayoutChange(tile, track); } }