mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 23:50:25 +00:00
(svn r16496) -Codechange: remove one useless dynamic_cast<>
This commit is contained in:
parent
333795bc70
commit
1a506f5912
@ -851,13 +851,13 @@ static void SetupRailToolbar(RailType railtype, Window *w)
|
|||||||
*/
|
*/
|
||||||
void ShowBuildRailToolbar(RailType railtype, int button)
|
void ShowBuildRailToolbar(RailType railtype, int button)
|
||||||
{
|
{
|
||||||
BuildRailToolbarWindow *w;
|
|
||||||
|
|
||||||
if (!Company::IsValidID(_local_company)) return;
|
if (!Company::IsValidID(_local_company)) return;
|
||||||
if (!ValParamRailtype(railtype)) 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. */
|
/* 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);
|
DeleteWindowByClass(WC_BUILD_TOOLBAR);
|
||||||
_cur_railtype = railtype;
|
_cur_railtype = railtype;
|
||||||
w = AllocateWindowDescFront<BuildRailToolbarWindow>(&_build_rail_desc, TRANSPORT_RAIL);
|
w = AllocateWindowDescFront<BuildRailToolbarWindow>(&_build_rail_desc, TRANSPORT_RAIL);
|
||||||
|
Loading…
Reference in New Issue
Block a user