src/waypoint_gui.cpp
changeset 9970 8608ca115990
parent 9953 42938fdeb0dc
child 9978 4c10b20eaf54
--- a/src/waypoint_gui.cpp	Thu Aug 21 20:45:52 2008 +0000
+++ b/src/waypoint_gui.cpp	Fri Aug 22 01:14:25 2008 +0000
@@ -37,6 +37,7 @@
 	WaypointWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
 	{
 		this->wp = GetWaypoint(this->window_number);
+		this->caption_color = (byte)GetTileOwner(this->wp->xy);
 
 		this->flags4 |= WF_DISABLE_VP_SCROLL;
 		InitializeWindowViewport(this, 3, 17, 254, 86, this->wp->xy, ZOOM_LVL_MIN);
@@ -107,5 +108,6 @@
 
 void ShowWaypointWindow(const Waypoint *wp)
 {
+	if (!wp->IsValid()) return;  // little safety
 	AllocateWindowDescFront<WaypointWindow>(&_waypoint_view_desc, wp->index);
 }