From 96906c1a45ed4e68c0132c2ad918db58c1e68f73 Mon Sep 17 00:00:00 2001 From: alberth Date: Fri, 24 Dec 2010 17:51:46 +0000 Subject: (svn r21628) -Codechange: Remove local variables that just point to global _thd. --- src/rail_gui.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/rail_gui.cpp') diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 6e39d41d8..79ec40661 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -360,11 +360,10 @@ static void DoRailroadTrack(int mode) static void HandleAutodirPlacement() { - TileHighlightData *thd = &_thd; - int trackstat = thd->drawstyle & HT_DIR_MASK; // 0..5 + int trackstat = _thd.drawstyle & HT_DIR_MASK; // 0..5 - if (thd->drawstyle & HT_RAIL) { // one tile case - GenericPlaceRail(TileVirtXY(thd->selend.x, thd->selend.y), trackstat); + if (_thd.drawstyle & HT_RAIL) { // one tile case + GenericPlaceRail(TileVirtXY(_thd.selend.x, _thd.selend.y), trackstat); return; } @@ -379,11 +378,10 @@ static void HandleAutodirPlacement() */ static void HandleAutoSignalPlacement() { - TileHighlightData *thd = &_thd; - uint32 p2 = GB(thd->drawstyle, 0, 3); // 0..5 + uint32 p2 = GB(_thd.drawstyle, 0, 3); // 0..5 - if ((thd->drawstyle & HT_DRAG_MASK) == HT_RECT) { // one tile case - GenericPlaceSignals(TileVirtXY(thd->selend.x, thd->selend.y)); + if ((_thd.drawstyle & HT_DRAG_MASK) == HT_RECT) { // one tile case + GenericPlaceSignals(TileVirtXY(_thd.selend.x, _thd.selend.y)); return; } @@ -406,7 +404,7 @@ static void HandleAutoSignalPlacement() /* _settings_client.gui.drag_signals_density is given as a parameter such that each user * in a network game can specify his/her own signal density */ - DoCommandP(TileVirtXY(thd->selstart.x, thd->selstart.y), TileVirtXY(thd->selend.x, thd->selend.y), p2, + DoCommandP(TileVirtXY(_thd.selstart.x, _thd.selstart.y), TileVirtXY(_thd.selend.x, _thd.selend.y), p2, _remove_button_clicked ? CMD_REMOVE_SIGNAL_TRACK | CMD_MSG(STR_ERROR_CAN_T_REMOVE_SIGNALS_FROM) : CMD_BUILD_SIGNAL_TRACK | CMD_MSG(STR_ERROR_CAN_T_BUILD_SIGNALS_HERE), -- cgit v1.2.3-54-g00ecf