Changeset - r12082:e5ac2652fcbe
[Not reviewed]
master
0 1 0
smatz - 15 years ago 2009-06-01 13:34:13
smatz@openttd.org
(svn r16496) -Codechange: remove one useless dynamic_cast<>
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/rail_gui.cpp
Show inline comments
 
@@ -851,13 +851,13 @@ static void SetupRailToolbar(RailType ra
 
 */
 
void ShowBuildRailToolbar(RailType railtype, int button)
 
{
 
	BuildRailToolbarWindow *w;
 

	
 
	if (!Company::IsValidID(_local_company)) return;
 
	if (!ValParamRailtype(railtype)) return;
 

	
 
	BuildRailToolbarWindow *w = (BuildRailToolbarWindow *)FindWindowById(WC_BUILD_TOOLBAR, TRANSPORT_RAIL);
 

	
 
	/* don't recreate the window if we're clicking on a button and the window exists. */
 
	if (button < 0 || !(w = dynamic_cast<BuildRailToolbarWindow*>(FindWindowById(WC_BUILD_TOOLBAR, TRANSPORT_RAIL)))) {
 
	if (button < 0 || w == NULL) {
 
		DeleteWindowByClass(WC_BUILD_TOOLBAR);
 
		_cur_railtype = railtype;
 
		w = AllocateWindowDescFront<BuildRailToolbarWindow>(&_build_rail_desc, TRANSPORT_RAIL);
0 comments (0 inline, 0 general)