(svn r26393) -Fix: Update distances between link graph nodes when station sign is moved

This commit is contained in:
fonsinchen
2014-03-06 21:19:41 +00:00
parent 20b9015d74
commit 3570104d24
3 changed files with 24 additions and 0 deletions

View File

@@ -641,6 +641,14 @@ static void UpdateStationSignCoord(BaseStation *st)
/* clamp sign coord to be inside the station rect */
st->xy = TileXY(ClampU(TileX(st->xy), r->left, r->right), ClampU(TileY(st->xy), r->top, r->bottom));
st->UpdateVirtCoord();
if (!Station::IsExpected(st)) return;
Station *full_station = Station::From(st);
for (CargoID c = 0; c < NUM_CARGO; ++c) {
LinkGraphID lg = full_station->goods[c].link_graph;
if (!LinkGraph::IsValidID(lg)) continue;
LinkGraph::Get(lg)->UpdateDistances(full_station->goods[c].node, st->xy);
}
}
/**