summaryrefslogtreecommitdiff
path: root/src/newgrf_debug_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2014-12-18 18:22:23 +0000
committeralberth <alberth@openttd.org>2014-12-18 18:22:23 +0000
commit107bf32953f3261a0d7c02fa9113afeb94b68219 (patch)
tree5369e1e38edbef69201aa91f20e0c20001bece23 /src/newgrf_debug_gui.cpp
parent78896895cf23deead6ebffe6bcd615729a833d3a (diff)
downloadopenttd-107bf32953f3261a0d7c02fa9113afeb94b68219.tar.xz
(svn r27086) -Codechange: Simplify opening of windows by always returning a valid window pointer.
Diffstat (limited to 'src/newgrf_debug_gui.cpp')
-rw-r--r--src/newgrf_debug_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp
index 4abfa4b1f..82c7a7d22 100644
--- a/src/newgrf_debug_gui.cpp
+++ b/src/newgrf_debug_gui.cpp
@@ -702,8 +702,8 @@ void ShowNewGRFInspectWindow(GrfSpecFeature feature, uint index, const uint32 gr
if (!IsNewGRFInspectable(feature, index)) return;
WindowNumber wno = GetInspectWindowNumber(feature, index);
- NewGRFInspectWindow *w = AllocateWindowDescFront<NewGRFInspectWindow>(feature == GSF_TRAINS || feature == GSF_ROADVEHICLES ? &_newgrf_inspect_chain_desc : &_newgrf_inspect_desc, wno);
- if (w == NULL) w = (NewGRFInspectWindow *)FindWindowById(WC_NEWGRF_INSPECT, wno);
+ WindowDesc *desc = (feature == GSF_TRAINS || feature == GSF_ROADVEHICLES) ? &_newgrf_inspect_chain_desc : &_newgrf_inspect_desc;
+ NewGRFInspectWindow *w = AllocateWindowDescFront<NewGRFInspectWindow>(desc, wno, true);
w->SetCallerGRFID(grfid);
}