(svn r20494) [1.0] -Backport from trunk:

- Fix: [NoAI] checking whether water tiles are connected failed in some cases [FS#4031] (r20489)
- Fix: Statues were not removed when towns would be removed (r20481)
- Fix: Building statues used different companys for CMD_LANDSCAPE_CLEAR during testrun and DC_EXEC (r20469)
- Fix: Adding 'goto nearest depot and stop' orders in one go was denied. This caused both AI adding those orders and backed up order restoration to fail [FS#4024] (r20441)
- Fix: For docks 'facing' north, i.e. having the watery part a the northern side, the station joiner had an off-by-one to the north w.r.t. the station spread against the actual other (correct) building tools [FS#4022] (r20438)
This commit is contained in:
rubidium 2010-08-14 18:01:55 +00:00
parent ebbe9409bd
commit 7e81ab9d9f
5 changed files with 24 additions and 9 deletions

View File

@ -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);

View File

@ -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()
);

View File

@ -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)

View File

@ -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());

View File

@ -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);