Compare commits

...

6 Commits

Author SHA1 Message Date
rubidium c59ee45081 (svn r18501) -Release: 0.7.5-RC1 2009-12-14 20:57:44 +00:00
rubidium ab03517694 (svn r18500) [0.7] -Backport from trunk:
- Fix: Read after free in case no network connection could be made with the content server (r18493)
- Fix: [NoAI] AIOrder::SkipToOrder did not properly resolve ORDER_CURRENT (r18471)
[0.7] -Prepare for 0.7.5-RC1
2009-12-14 20:50:32 +00:00
rubidium 0df9eddc9c (svn r18478) [0.7] -Backport from trunk:
- Fix: When moving a wagon and only the last part of a dual headed engine you could split the dual headed engine over two vehicles (r18462)
- Fix: [Windows] Forgot to load the symbol from SDL.dll (r18439)
- Fix: Do not run the 'jam protection' for vehicles in a depot [FS#3360] (r18428)
- Fix: [Windows] the help window would be too large in some cases [FS#3327] (r18424)
- Fix: Under some circumstances a pointer could be left untouched and then freed. Make sure this does not happen by ensuring it starts out as NULL instead of 'garbage' [FS#3298] (r18418)
2009-12-13 00:33:00 +00:00
rubidium ff67ed58da (svn r18477) [0.7] -Backport from trunk:
- Fix: On slopes the original and better road layouts did not check their minimum distance requirements [FS#3332] (r18415)
- Fix: Aqueducts were not influenced by the "long bridges" setting [FS#3338] (r18407)
- Fix: Drive through road stops did not get flooded (r18401)
- Fix: [YAPP] Trains on bridges were not found, when searching for the origin of a reservation [FS#3345] (r18392)
2009-12-13 00:24:53 +00:00
rubidium fd89332101 (svn r18476) [0.7] -Backport from trunk:
- Fix: (Invalid) GRFs could trigger invalid reads (r18391)
- Fix: One could not share orders between buses carrying different cargos (r18380)
- Fix: Off-by-one in the preconfigured music lists [FS#3339] (r18369)
- Change [FS#3349]: Recolour the bubble generator just like any other industry (r18409)
- Add: Some missing latin-ish characters from the OpenGFX set (r18431)
2009-12-13 00:13:06 +00:00
frosch 8808835412 (svn r18475) [0.7] -Fix (r18300)[FS#3344]: Initialisation of cargo payment works different in 0.7 than trunk r18207. 2009-12-12 23:56:41 +00:00
32 changed files with 167 additions and 69 deletions
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -24,7 +24,7 @@ TRGI.GRF = da6a6c9dcc451eec88d79211437b76a8
TRGC.GRF = ed446637e034104c5559b32c18afe78d
TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9
TRGT.GRF = e30e8a398ae86c03dc534a8ac7dfb3b6
OPENTTDD.GRF = c886c7d5b38a93f2cb1cdc0d33472eb8
OPENTTDD.GRF = 2e1f3667175e8eeb013ea35881ecffb7
[origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM.
+1 -1
View File
@@ -24,7 +24,7 @@ TRGI.GRF = da6a6c9dcc451eec88d79211437b76a8
TRGC.GRF = ed446637e034104c5559b32c18afe78d
TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9
TRGT.GRF = fcde1d7e8a74197d72a62695884b909e
OPENTTDD.GRF = c886c7d5b38a93f2cb1cdc0d33472eb8
OPENTTDD.GRF = 2e1f3667175e8eeb013ea35881ecffb7
[origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM.
+1 -1
View File
@@ -24,7 +24,7 @@ TRGIR.GRF = 0c2484ff6be49fc63a83be6ab5c38f32
TRGCR.GRF = 3668f410c761a050b5e7095a2b14879b
TRGHR.GRF = 06bf2b7a31766f048baac2ebe43457b1
TRGTR.GRF = de53650517fe661ceaa3138c6edb0eb8
OPENTTDW.GRF = b6689105405fa3ea34cb8a5543633d29
OPENTTDW.GRF = a73ff4dce8936fadc02dea183afad638
[origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM.
+21
View File
@@ -1,3 +1,24 @@
0.7.5-RC1 (2009-12-14)
------------------------------------------------------------------------
- Add: Some missing latin-ish characters from the OpenGFX set (r18431)
- Change [FS#3349]: Recolour the bubble generator just like any other industry (r18409)
- Fix: Read after free in case no network connection could be made with the content server (r18493)
- Fix: [NewGRF] Initialisation of cargo payment was broken for NewGRF cargos [FS#3344] (r18475)
- Fix: [NoAI] AIOrder::SkipToOrder did not properly resolve ORDER_CURRENT (r18471)
- Fix: When moving a wagon and only the last part of a dual headed engine you could split the dual headed engine over two vehicles (r18462)
- Fix: [Windows] Forgot to load the symbol from SDL.dll (r18439)
- Fix: Do not run the 'jam protection' for vehicles in a depot [FS#3360] (r18428)
- Fix: [Windows] the help window would be too large in some cases [FS#3327] (r18424)
- Fix: Under some circumstances a pointer could be left untouched and then freed. Make sure this does not happen by ensuring it starts out as NULL instead of 'garbage' [FS#3298] (r18418)
- Fix: On slopes the original and better road layouts did not check their minimum distance requirements [FS#3332] (r18415)
- Fix: Aqueducts were not influenced by the 'long bridges' setting [FS#3338] (r18407)
- Fix: Drive through road stops did not get flooded (r18401)
- Fix: [YAPP] Trains on bridges were not found, when searching for the origin of a reservation [FS#3345] (r18392)
- Fix: (Invalid) GRFs could trigger invalid reads (r18391)
- Fix: One could not share orders between buses carrying different cargos (r18380)
- Fix: Off-by-one in the preconfigured music lists [FS#3339] (r18369)
0.7.4 (2009-12-01)
------------------------------------------------------------------------
- Fix: Endianness issue with saving the zoom level [FS#3333] (r18351)
+1 -1
View File
@@ -5,7 +5,7 @@ log() {
}
set_default() {
released_version=""
released_version="0.7.5-RC1"
ignore_extra_parameters="0"
# We set all kinds of defaults for params. Later on the user can override
+6
View File
@@ -1,3 +1,9 @@
openttd (0.7.5~RC1) unstable; urgency=low
* New upstream release.
-- Matthijs Kooijman <matthijs@stdin.nl> Mon, 14 Dec 2009 19:28:37 +0100
openttd (0.7.4) unstable; urgency=low
* New upstream release.
+3 -3
View File
@@ -1,7 +1,7 @@
!define APPNAME "OpenTTD" ; Define application name
!define APPVERSION "0.7.4" ; Define application version
!define APPVERSIONINTERNAL "0.7.4.0" ; Define application version in X.X.X.X
!define INSTALLERVERSION 70 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
!define APPVERSION "0.7.5-RC1" ; Define application version
!define APPVERSIONINTERNAL "0.7.5.0" ; Define application version in X.X.X.X
!define INSTALLERVERSION 71 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
!include ${VERSION_INCLUDE}
!define APPURLLINK "http://www.openttd.org"
+1
View File
@@ -32,6 +32,7 @@ Sub UpdateFiles(version)
modified = Mid(version, InStrRev(version, Chr(9)) + 1)
version = Mid(version, 1, InStr(version, Chr(9)) - 1)
Else
version = "0.7.5-RC1"
revision = 0
modified = 1
End If
+6
View File
@@ -162,6 +162,12 @@ bool AIFileInfo::CheckMethod(const char *name) const
return 0;
}
AIInfo::AIInfo() :
min_loadable_version(0),
use_as_random(false)
{
}
AIInfo::~AIInfo()
{
/* Free all allocated strings */
+2 -1
View File
@@ -41,7 +41,7 @@ public:
friend class AIInfo;
friend class AILibrary;
AIFileInfo() : SQ_instance(NULL), main_script(NULL), author(NULL), name(NULL), short_name(NULL), description(NULL), date(NULL), instance_name(NULL), url(NULL) {};
AIFileInfo() : SQ_instance(NULL), main_script(NULL), author(NULL), name(NULL), short_name(NULL), description(NULL), date(NULL), instance_name(NULL), version(0), url(NULL) {};
~AIFileInfo();
/**
@@ -123,6 +123,7 @@ class AIInfo : public AIFileInfo {
public:
static const char *GetClassName() { return "AIInfo"; }
AIInfo();
~AIInfo();
/**
+2
View File
@@ -393,6 +393,8 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
/* static */ bool AIOrder::SkipToOrder(VehicleID vehicle_id, OrderPosition next_order)
{
next_order = AIOrder::ResolveOrderPosition(vehicle_id, next_order);
EnforcePrecondition(false, IsValidVehicleOrder(vehicle_id, next_order));
return AIObject::DoCommand(0, vehicle_id, next_order, CMD_SKIP_TO_ORDER);
+1 -5
View File
@@ -188,11 +188,7 @@
/* static */ bool AIVehicle::SkipToVehicleOrder(VehicleID vehicle_id, AIOrder::OrderPosition order_position)
{
order_position = AIOrder::ResolveOrderPosition(vehicle_id, order_position);
EnforcePrecondition(false, AIOrder::IsValidVehicleOrder(vehicle_id, order_position));
return AIObject::DoCommand(0, vehicle_id, order_position, CMD_SKIP_TO_ORDER);
return AIOrder::SkipToOrder(vehicle_id, order_position);
}
/* static */ bool AIVehicle::ReverseVehicle(VehicleID vehicle_id)
+4
View File
@@ -4,6 +4,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "functions.h"
#include "landscape.h"
#include "company_func.h"
#include "variables.h"
@@ -284,6 +285,9 @@ void GenerateWorld(GenerateWorldMode mode, uint size_x, uint size_y, bool reset_
GfxLoadSprites();
LoadStringWidthTable();
/* Initialise cargo payment */
InitializeLandscapeVariables(false);
/* Re-init the windowing system */
ResetWindowSystem();
+1 -1
View File
@@ -64,7 +64,7 @@ static ReusableBuffer<uint8> _cursor_backup;
*/
static Rect _invalid_rect;
static const byte *_colour_remap_ptr;
static byte _string_colourremap[3];
static byte _string_colourremap[3]; ///< Recoloursprite for stringdrawing. The grf loader ensures, that ST_FONT sprites only use colours 0 to 2.
enum {
DIRTY_BLOCK_HEIGHT = 8,
+3 -3
View File
@@ -29,15 +29,15 @@ static byte _playlist_all[] = {
};
static byte _playlist_old_style[] = {
1, 8, 2, 9, 14, 15, 19, 13, 0
2, 9, 3, 10, 15, 16, 20, 14, 0
};
static byte _playlist_new_style[] = {
6, 11, 10, 17, 21, 18, 5, 0
7, 12, 11, 18, 22, 19, 6, 0
};
static byte _playlist_ezy_street[] = {
12, 7, 16, 3, 20, 4, 0
13, 8, 17, 4, 21, 5, 0
};
static byte * const _playlists[] = {
+1
View File
@@ -711,6 +711,7 @@ public:
if (!success) {
ShowErrorMessage(INVALID_STRING_ID, STR_CONTENT_ERROR_COULD_NOT_CONNECT, 0, 0);
delete this;
return;
}
this->SetDirty();
+2 -3
View File
@@ -1094,9 +1094,8 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
return CMD_ERROR;
/* Trucks can't share orders with busses (and visa versa) */
if (src->type == VEH_ROAD) {
if (src->cargo_type != dst->cargo_type && (IsCargoInClass(src->cargo_type, CC_PASSENGERS) || IsCargoInClass(dst->cargo_type, CC_PASSENGERS)))
return CMD_ERROR;
if (src->type == VEH_ROAD && IsCargoInClass(src->cargo_type, CC_PASSENGERS) != IsCargoInClass(dst->cargo_type, CC_PASSENGERS)) {
return CMD_ERROR;
}
/* Is the vehicle already in the shared list? */
+15 -4
View File
@@ -57,6 +57,17 @@ BEGIN
END
101 DIALOG DISCARDABLE 0, 0, 600, 400
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "OpenTTD command line help"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "&OK",12,274,378,50,14,BS_CENTER
EDITTEXT 11,7,6,583,365,ES_MULTILINE | ES_READONLY | WS_VSCROLL | WS_HSCROLL
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
@@ -64,8 +75,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,7,0,!!REVISION!!
PRODUCTVERSION 0,7,0,!!REVISION!!
FILEVERSION 0,7,5,18501
PRODUCTVERSION 0,7,5,18501
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -83,14 +94,14 @@ BEGIN
VALUE "Comments", "This program is licensed under the GNU General Public License.\0"
VALUE "CompanyName", "OpenTTD Development Team\0"
VALUE "FileDescription", "OpenTTD\0"
VALUE "FileVersion", "Development !!VERSION!!\0"
VALUE "FileVersion", "0.7.5-RC1\0"
VALUE "InternalName", "openttd\0"
VALUE "LegalCopyright", "Copyright \xA9 OpenTTD Developers 2002-2009. All Rights Reserved.\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "openttd.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "OpenTTD\0"
VALUE "ProductVersion", "Development !!VERSION!!\0"
VALUE "ProductVersion", "0.7.5-RC1\0"
VALUE "SpecialBuild", "-\0"
END
END
+3 -1
View File
@@ -233,7 +233,9 @@ static Vehicle *FindTrainOnTrackEnum(Vehicle *v, void *data)
{
FindTrainOnTrackInfo *info = (FindTrainOnTrackInfo *)data;
if (v->type == VEH_TRAIN && !(v->vehstatus & VS_CRASHED) && HasBit((TrackBits)v->u.rail.track, TrackdirToTrack(info->res.trackdir))) {
if (v->type != VEH_TRAIN || (v->vehstatus & VS_CRASHED)) return NULL;
if (v->u.rail.track == TRACK_BIT_WORMHOLE || HasBit((TrackBits)v->u.rail.track, TrackdirToTrack(info->res.trackdir))) {
v = v->First();
/* ALWAYS return the lowest ID (anti-desync!) */
+3 -3
View File
@@ -20,7 +20,7 @@
* norev000 is for non-releases that are made on systems without
* subversion or sources that are not a checkout of subversion.
*/
const char _openttd_revision[] = "!!VERSION!!";
const char _openttd_revision[] = "0.7.5-RC1";
/**
* Let us know if current build was modified. This detection
@@ -45,11 +45,11 @@ const byte _openttd_revision_modified = !!MODIFIED!!;
* final release will always have a lower version number than the released
* version, thus making comparisions on specific revisions easy.
*/
const uint32 _openttd_newgrf_version = 0 << 28 | 7 << 24 | 0 << 20 | 0 << 19 | (!!REVISION!! & ((1 << 19) - 1));
const uint32 _openttd_newgrf_version = 0 << 28 | 7 << 24 | 5 << 20 | 0 << 19 | (18501 & ((1 << 19) - 1));
#ifdef __MORPHOS__
/**
* Variable used by MorphOS to show the version.
*/
extern const char morphos_versions_tag[] = "$VER: OpenTTD !!VERSION!! (!!DATE!!) OpenTTD Team [MorphOS, PowerPC]";
extern const char morphos_versions_tag[] = "$VER: OpenTTD 0.7.5-RC1 (!!DATE!!) OpenTTD Team [MorphOS, PowerPC]";
#endif
+3 -3
View File
@@ -736,7 +736,7 @@ static Vehicle *EnumCheckRoadVehClose(Vehicle *v, void *data)
return NULL;
}
static Vehicle *RoadVehFindCloseTo(Vehicle *v, int x, int y, Direction dir)
static Vehicle *RoadVehFindCloseTo(Vehicle *v, int x, int y, Direction dir, bool update_blocked_ctr = true)
{
RoadVehFindData rvf;
Vehicle *front = v->First();
@@ -765,7 +765,7 @@ static Vehicle *RoadVehFindCloseTo(Vehicle *v, int x, int y, Direction dir)
return NULL;
}
if (++front->u.road.blocked_ctr > 1480) return NULL;
if (update_blocked_ctr && ++front->u.road.blocked_ctr > 1480) return NULL;
return rvf.best;
}
@@ -1227,7 +1227,7 @@ static bool RoadVehLeaveDepot(Vehicle *v, bool first)
int y = TileY(v->tile) * TILE_SIZE + (rdp[RVC_DEPOT_START_FRAME].y & 0xF);
if (first) {
if (RoadVehFindCloseTo(v, x, y, v->direction) != NULL) return true;
if (RoadVehFindCloseTo(v, x, y, v->direction, false) != NULL) return true;
VehicleServiceInDepot(v);
+1 -1
View File
@@ -46,7 +46,7 @@ void ResetViewportAfterLoadGame()
w->viewport->dest_scrollpos_y = _saved_scrollpos_y;
ViewPort *vp = w->viewport;
vp->zoom = min<ZoomLevel>(_saved_scrollpos_zoom, ZOOM_LVL_MAX);
vp->zoom = (ZoomLevel)min(_saved_scrollpos_zoom, ZOOM_LVL_MAX);
vp->virtual_width = ScaleByZoom(vp->width, vp->zoom);
vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);
+1
View File
@@ -61,6 +61,7 @@ static const char sdl_files[] =
M("SDL_SetColorKey")
M("SDL_WM_SetIcon")
M("SDL_MapRGB")
M("SDL_VideoModeOK")
M("")
;
#undef M
+10 -2
View File
@@ -121,7 +121,11 @@ bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot,
}
for (int x = 0; x < length; x++) {
data->m = ((sprite_type == ST_NORMAL && _palette_remap_grf[file_slot]) ? _palette_remap[*dest] : *dest);
switch (sprite_type) {
case ST_NORMAL: data->m = _palette_remap_grf[file_slot] ? _palette_remap[*dest] : *dest; break;
case ST_FONT: data->m = min(*dest, 2u); break;
default: data->m = *dest; break;
}
dest++;
data++;
}
@@ -142,7 +146,11 @@ bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot,
dest = dest_orig;
for (int i = 0; i < sprite->width * sprite->height; i++) {
sprite->data[i].m = ((sprite_type == ST_NORMAL && _palette_remap_grf[file_slot]) ? _palette_remap[dest[i]] : dest[i]);
switch (sprite_type) {
case ST_NORMAL: sprite->data[i].m = _palette_remap_grf[file_slot] ? _palette_remap[dest[i]] : dest[i]; break;
case ST_FONT: sprite->data[i].m = min(dest[i], 2u); break;
default: sprite->data[i].m = dest[i]; break;
}
}
}
+3
View File
@@ -3154,6 +3154,9 @@ static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_o
*/
static bool CanRemoveRoadWithStop(TileIndex tile, DoCommandFlag flags)
{
/* Yeah... water can always remove stops, right? */
if (_current_company == OWNER_WATER) return true;
Owner road_owner = _current_company;
Owner tram_owner = _current_company;
+9 -9
View File
@@ -684,17 +684,17 @@ static const DrawBuildingsTileStruct _industry_draw_tile_data[NEW_INDUSTRYTILEOF
M( 0x1244, PAL_NONE, 0x1282 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1285 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1289, PALETTE_TO_RED, 0, 0, 16, 16, 50, 3),
M( 0x1243, PAL_NONE, 0x1289, PALETTE_TO_RED, 0, 0, 16, 16, 50, 3),
M( 0x1243, PAL_NONE, 0x1289, PALETTE_TO_RED, 0, 0, 16, 16, 50, 3),
M( 0x1243, PAL_NONE, 0x1289 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 3),
M( 0x1243, PAL_NONE, 0x1289 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 3),
M( 0x1243, PAL_NONE, 0x1289 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 3),
M( 0x1244, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),
+4 -15
View File
@@ -760,19 +760,8 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir)
}
cur_slope = _settings_game.construction.build_on_slopes ? GetFoundationSlope(tile, NULL) : GetTileSlope(tile, NULL);
if (cur_slope == SLOPE_FLAT) {
no_slope:
/* Tile has no slope */
switch (t->layout) {
default: NOT_REACHED();
case TL_ORIGINAL: // Disallow the road if any neighboring tile has a road (distance: 1)
return !IsNeighborRoadTile(tile, dir, 1);
case TL_BETTER_ROADS: // Disallow the road if any neighboring tile has a road (distance: 1 and 2).
return !IsNeighborRoadTile(tile, dir, 2);
}
}
bool ret = !IsNeighborRoadTile(tile, dir, t->layout == TL_ORIGINAL ? 1 : 2);
if (cur_slope == SLOPE_FLAT) return ret;
/* If the tile is not a slope in the right direction, then
* maybe terraform some. */
@@ -787,12 +776,12 @@ no_slope:
}
if (CmdFailed(res) && Chance16(1, 3)) {
/* We can consider building on the slope, though. */
goto no_slope;
return ret;
}
}
return false;
}
return true;
return ret;
}
}
-4
View File
@@ -965,10 +965,6 @@ static void AddWagonToConsist(Vehicle *v, Vehicle *dest)
*/
static void NormaliseTrainConsist(Vehicle *v)
{
if (IsFreeWagon(v)) return;
assert(IsFrontEngine(v));
for (; v != NULL; v = GetNextVehicle(v)) {
if (!IsMultiheaded(v) || !IsTrainEngine(v)) continue;
+2
View File
@@ -248,6 +248,8 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u
if (transport_type != TRANSPORT_WATER) {
/* set and test bridge length, availability */
if (!CheckBridge_Stuff(bridge_type, bridge_len, flags)) return_cmd_error(STR_5015_CAN_T_BUILD_BRIDGE_HERE);
} else {
if (bridge_len > (_settings_game.construction.longbridges ? 100U : 16U)) return_cmd_error(STR_5015_CAN_T_BUILD_BRIDGE_HERE);
}
/* retrieve landscape height and ensure it's on land */
+56 -7
View File
@@ -937,23 +937,72 @@ void CreateConsole()
#endif
}
/** Temporary pointer to get the help message to the window */
static const char *_help_msg;
/** Callback function to handle the window */
static INT_PTR CALLBACK HelpDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG: {
char help_msg[8192];
const char *p = _help_msg;
char *q = help_msg;
while (q != lastof(help_msg) && *p != '\0') {
if (*p == '\n') {
*q++ = '\r';
if (q == lastof(help_msg)) {
q[-1] = '\0';
break;
}
}
*q++ = *p++;
}
*q = '\0';
#if defined(UNICODE)
/* We need to put the text in a seperate buffer because the default
* buffer in MB_TO_WIDE might not be large enough (512 chars) */
wchar_t help_msgW[8192];
#endif
SetDlgItemText(wnd, 11, MB_TO_WIDE_BUFFER(help_msg, help_msgW, lengthof(help_msgW)));
SendDlgItemMessage(wnd, 11, WM_SETFONT, (WPARAM)GetStockObject(ANSI_FIXED_FONT), FALSE);
} return TRUE;
case WM_COMMAND:
if (wParam == 12) ExitProcess(0);
return TRUE;
case WM_CLOSE:
ExitProcess(0);
}
return FALSE;
}
void ShowInfo(const char *str)
{
if (_has_console) {
fprintf(stderr, "%s\n", str);
} else {
bool old;
#if defined(UNICODE)
/* We need to put the text in a seperate buffer because the default
* buffer in MB_TO_WIDE might not be large enough (512 chars) */
wchar_t help_msgW[8192];
#endif
ReleaseCapture();
_left_button_clicked = _left_button_down = false;
old = MyShowCursor(true);
if (MessageBox(GetActiveWindow(), MB_TO_WIDE_BUFFER(str, help_msgW, lengthof(help_msgW)), _T("OpenTTD"), MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL) {
CreateConsole();
if (strlen(str) > 2048) {
/* The minimum length of the help message is 2048. Other messages sent via
* ShowInfo are much shorter, or so long they need this way of displaying
* them anyway. */
_help_msg = str;
DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(101), NULL, HelpDialogFunc);
} else {
#if defined(UNICODE)
/* We need to put the text in a seperate buffer because the default
* buffer in MB_TO_WIDE might not be large enough (512 chars) */
wchar_t help_msgW[8192];
#endif
if (MessageBox(GetActiveWindow(), MB_TO_WIDE_BUFFER(str, help_msgW, lengthof(help_msgW)), _T("OpenTTD"), MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL) {
CreateConsole();
}
}
MyShowCursor(old);
}