diff --git a/src/ai/api/ai_marine.cpp b/src/ai/api/ai_marine.cpp index 532d04d4df..8fcfb51357 100644 --- a/src/ai/api/ai_marine.cpp +++ b/src/ai/api/ai_marine.cpp @@ -59,7 +59,7 @@ /* Tiles not neighbouring */ if (::DistanceManhattan(t1, t2) != 1) return false; - DiagDirection to_other_tile = ::DiagdirBetweenTiles(t1, t2); + DiagDirection to_other_tile = ::DiagdirBetweenTiles(t2, t1); /* Determine the reachable tracks from the shared edge */ TrackBits gtts1 = ::TrackStatusToTrackBits(::GetTileTrackStatus(t1, TRANSPORT_WATER, 0, to_other_tile)) & ::DiagdirReachesTracks(to_other_tile); diff --git a/src/crashlog.cpp b/src/crashlog.cpp index d77c7637d7..ce17ea5564 100644 --- a/src/crashlog.cpp +++ b/src/crashlog.cpp @@ -109,25 +109,25 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const buffer += seprintf(buffer, last, "Configuration:\n" " Blitter: %s\n" - " Graphics set: %s (%d)\n" + " Graphics set: %s (%u)\n" " Language: %s\n" " Music driver: %s\n" - " Music set: %s (%d)\n" + " Music set: %s (%u)\n" " Network: %s\n" " Sound driver: %s\n" - " Sound set: %s (%d)\n" + " Sound set: %s (%u)\n" " Video driver: %s\n\n", BlitterFactoryBase::GetCurrentBlitter() == NULL ? "none" : BlitterFactoryBase::GetCurrentBlitter()->GetName(), BaseGraphics::GetUsedSet() == NULL ? "none" : BaseGraphics::GetUsedSet()->name, - BaseGraphics::GetUsedSet() == NULL ? -1 : BaseGraphics::GetUsedSet()->version, + BaseGraphics::GetUsedSet() == NULL ? UINT32_MAX : BaseGraphics::GetUsedSet()->version, StrEmpty(_dynlang.curr_file) ? "none" : _dynlang.curr_file, _music_driver == NULL ? "none" : _music_driver->GetName(), BaseMusic::GetUsedSet() == NULL ? "none" : BaseMusic::GetUsedSet()->name, - BaseMusic::GetUsedSet() == NULL ? -1 : BaseMusic::GetUsedSet()->version, + BaseMusic::GetUsedSet() == NULL ? UINT32_MAX : BaseMusic::GetUsedSet()->version, _networking ? (_network_server ? "server" : "client") : "no", _sound_driver == NULL ? "none" : _sound_driver->GetName(), BaseSounds::GetUsedSet() == NULL ? "none" : BaseSounds::GetUsedSet()->name, - BaseSounds::GetUsedSet() == NULL ? -1 : BaseSounds::GetUsedSet()->version, + BaseSounds::GetUsedSet() == NULL ? UINT32_MAX : BaseSounds::GetUsedSet()->version, _video_driver == NULL ? "none" : _video_driver->GetName() ); diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 1b2336ef83..d3d57e6313 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -56,7 +56,12 @@ static void PlaceDocks_Dock(TileIndex tile) /* tile is always the land tile, so need to evaluate _thd.pos */ CommandContainer cmdcont = { tile, _ctrl_pressed, p2, CMD_BUILD_DOCK | CMD_MSG(STR_ERROR_CAN_T_BUILD_DOCK_HERE), CcBuildDocks, "" }; - ShowSelectStationIfNeeded(cmdcont, TileArea(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE)); + + /* Determine the watery part of the dock. */ + DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile, NULL)); + TileIndex tile_to = (dir != INVALID_DIAGDIR ? TileAddByDiagDir(tile, ReverseDiagDir(dir)) : tile); + + ShowSelectStationIfNeeded(cmdcont, TileArea(tile, tile_to)); } static void PlaceDocks_Depot(TileIndex tile) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 0f6f9f27f8..fb282c7187 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -518,7 +518,7 @@ CommandCost CmdInsertOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 } case OT_GOTO_DEPOT: { - if (new_order.GetDepotActionType() != ODATFB_NEAREST_DEPOT) { + if ((new_order.GetDepotActionType() & ODATFB_NEAREST_DEPOT) == 0) { if (v->type == VEH_AIRCRAFT) { const Station *st = Station::GetIfValid(new_order.GetDestination()); diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 4fcab34ea9..9e449a9257 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -30,6 +30,7 @@ #include "newgrf_text.h" #include "autoslope.h" #include "tunnelbridge_map.h" +#include "unmovable_map.h" #include "strings_func.h" #include "window_func.h" #include "string_func.h" @@ -92,6 +93,12 @@ Town::~Town() DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); break; + case MP_UNMOVABLE: + if (GetUnmovableType(tile) == UNMOVABLE_STATUE && GetStatueTownID(tile) == this->index) { + DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); + } + break; + default: break; } @@ -2418,7 +2425,10 @@ static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags) TileIndex tile = t->xy; if (CircularTileSearch(&tile, 9, SearchTileForStatue, NULL)) { if (flags & DC_EXEC) { + CompanyID old = _current_company; + _current_company = OWNER_NONE; DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); + _current_company = old; MakeStatue(tile, _current_company, t->index); SetBit(t->statues, _current_company); // Once found and built, "inform" the Town. MarkTileDirtyByTile(tile);