summaryrefslogtreecommitdiff
path: root/src/waypoint_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-08-01 11:55:49 +0000
committerfrosch <frosch@openttd.org>2009-08-01 11:55:49 +0000
commit1cd07265f8ced5de94e950c80fca7fdc072a02db (patch)
tree46b85d619bb211f86b79cc2daef00cefd4c23293 /src/waypoint_cmd.cpp
parentb4abe942cb5f1da1511f843f632d9e9bac8824df (diff)
downloadopenttd-1cd07265f8ced5de94e950c80fca7fdc072a02db.tar.xz
(svn r17020) -Fix: Recenter viewport of waypoint-gui after moving the sign.
Diffstat (limited to 'src/waypoint_cmd.cpp')
-rw-r--r--src/waypoint_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp
index 1b23e6784..94a959e78 100644
--- a/src/waypoint_cmd.cpp
+++ b/src/waypoint_cmd.cpp
@@ -34,6 +34,8 @@ void Waypoint::UpdateVirtCoord()
Point pt = RemapCoords2(TileX(this->xy) * TILE_SIZE, TileY(this->xy) * TILE_SIZE);
SetDParam(0, this->index);
this->sign.UpdatePosition(pt.x, pt.y - 0x20, STR_WAYPOINT_VIEWPORT);
+ /* Recenter viewport */
+ InvalidateWindowData(WC_WAYPOINT_VIEW, this->index);
}
/**
@@ -270,7 +272,6 @@ CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint
} else if (!wp->IsInUse()) {
/* Move existing (recently deleted) waypoint to the new location */
wp->xy = start_tile;
- InvalidateWindowData(WC_WAYPOINT_VIEW, wp->index);
}
wp->owner = GetTileOwner(start_tile);