1
0
Fork 0

(svn r20428) [1.0] -Backport form trunk:

- Fix: Strip non-printable characters before showing it in an edit box, so when renaming a vehicle type you won't get the 'SETX stuff' that some NewGRFs use [FS#3974] (r20220)
- Fix: NewGRFs that defined a vehicle without either loaded or loading groups could crash OpenTTD [FS#3964] (r20199)
- Fix: [NewGRF] Crash when GetNearbyTileInformation is used to get the terrain type of a MP_VOID tile [FS#3963] (r20197)
- Fix: Inconsistencies w.r.t. to km/h vs km-ish/h as 'base' unit for aircraft speeds [FS#3870] (r20164)
release/1.0
rubidium 2010-08-09 21:17:19 +00:00
parent fc3c216e66
commit 266bb52e1e
12 changed files with 66 additions and 15 deletions

View File

@ -4998,7 +4998,7 @@ ERROR: HasNext() is invalid as Begin() is never called
CanRefitCargo(): false
GetCapacity(): 25
GetReliability(): 58
GetMaxSpeed(): 238
GetMaxSpeed(): 236
GetPrice(): 28710
GetMaxAge(): 7320
GetRunningCost(): 2390
@ -5016,7 +5016,7 @@ ERROR: HasNext() is invalid as Begin() is never called
CanRefitCargo(): false
GetCapacity(): 65
GetReliability(): 95
GetMaxSpeed(): 238
GetMaxSpeed(): 236
GetPrice(): 30761
GetMaxAge(): 8784
GetRunningCost(): 2812
@ -5070,7 +5070,7 @@ ERROR: HasNext() is invalid as Begin() is never called
CanRefitCargo(): false
GetCapacity(): 30
GetReliability(): 77
GetMaxSpeed(): 238
GetMaxSpeed(): 236
GetPrice(): 30761
GetMaxAge(): 10980
GetRunningCost(): 2756

View File

@ -67,6 +67,38 @@ No suitable AI can be found
"AI Settings" -> "Select AI" -> "Check Online Content" which is also
accessed via the main menu.
After a while of playing, colours get corrupted
In Windows 7 the background slideshow corrupts the colour mapping of
OpenTTD's 8bpp screen modes. Workarounds for this are:
a) Switching to windowed mode, instead of fullscreen
b) Switching off background slideshow
c) Setting up the 32bpp-anim or 32bpp-optimized blitter
Long delay between switching songs/music
On Windows there is a delay of a (few) second(s) between switching of
songs for the "win32" driver. This delay is caused by the fact that
opening a MIDI file via MCI is extremely slow.
DirectMusic, known as "dmusic" in OpenTTD, has a much shorter delay.
However, under some circumstances DirectMusic does not reset its
state properly causing wrongly pitched/bad sounding songs. This
problem is in DirectMusic as it is reproducable with Microsoft's
DirectMusic Producer. DirectMusic has been deprecated since 2004
and as such has no support for 64 bits OpenTTD.
As a delay is favourable over bad sounding music the "win32" driver
is the default driver for OpenTTD. You can change this default by
setting the "musicdriver" in your openttd.cfg to "dmusic".
Custom vehicle type name is incorrectly aligned
Some NewGRFs use sprites that are bigger than normal in the "buy
vehicle" window. Due to this they have to encode an offset for the
vehicle type name. Upon renaming the vehicle type this encoded offset
is stripped from the name because the "edit box" cannot show this
encoding. As a result the custom vehicle type names will get the
default alignment. The only way to (partly) fix this is by adding
spaces to the custom name.
Clipping problems [FS#119]
In some cases sprites are not drawn as one would expect. Examples of
this are aircraft that might be hidden below the runway or trees that
@ -178,3 +210,9 @@ OpenTTD not properly resizing with SDL on X [FS#3305]
Window managers that are known to exhibit this behaviour are KDE's
and GNOME's. With the XFCE's and LXDE's window managers the resize
event is sent when the user releases the mouse.
Crashes when playing music [FS#3941]
Mac OS X's QuickTime (default music driver) and Windows' MCI (win32
music driver) crash on some songs from OpenMSX. OpenTTD cannot do
anything about this. Please report these crashes to the authors of
OpenMSX so the crash causing songs can be removed or fixed.

View File

@ -251,7 +251,7 @@ openttd (0.6.0-2) unstable; urgency=low
[ Matthijs Kooijman ]
* Don't install anything into ~ during make install, this prevented
successful builds on some architectures. Fix imported from upstream.
* Put the homepage in it's own Homepage field instead of in the description.
* Put the homepage in its own Homepage field instead of in the description.
* Bump Standards-Version to 3.7.3
-- Jordi Mallach <jordi@debian.org> Thu, 03 Apr 2008 00:07:10 +0200

View File

@ -669,8 +669,8 @@ void UpdateAircraftCache(Aircraft *v)
{
uint max_speed = GetVehicleProperty(v, PROP_AIRCRAFT_SPEED, 0);
if (max_speed != 0) {
/* Convert from original units to (approx) km/h */
max_speed = (max_speed * 129) / 10;
/* Convert from original units to km-ish/h */
max_speed = (max_speed * 128) / 10;
v->acache.cached_max_speed = max_speed;
} else {

View File

@ -1237,7 +1237,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
case VEH_TRAIN: t = Train::From(u)->tcache.cached_max_speed; break;
case VEH_ROAD: t = u->max_speed / 2; break;
case VEH_SHIP: t = u->max_speed; break;
case VEH_AIRCRAFT: t = u->max_speed * 10 / 129; break; // convert to old units
case VEH_AIRCRAFT: t = u->max_speed * 10 / 128; break; // convert to old units
default: NOT_REACHED();
}

View File

@ -1251,7 +1251,7 @@ struct QueryStringWindow : public QueryStringBaseWindow
QueryStringBaseWindow(maxsize)
{
GetString(this->edit_str_buf, str, &this->edit_str_buf[maxsize - 1]);
this->edit_str_buf[maxsize - 1] = '\0';
str_validate(this->edit_str_buf, &this->edit_str_buf[maxsize - 1], false, true);
if ((flags & QSF_ACCEPT_UNCHANGED) == 0) this->orig = strdup(this->edit_str_buf);

View File

@ -1034,12 +1034,12 @@ static ChangeInfoResult AircraftVehicleChangeInfo(uint engine, int numinfo, int
avi->cost_factor = buf->ReadByte();
break;
case PROP_AIRCRAFT_SPEED: // 0x0C Speed (1 unit is 8 mph, we translate to 1 unit is 1 km/h)
avi->max_speed = (buf->ReadByte() * 129) / 10;
case PROP_AIRCRAFT_SPEED: // 0x0C Speed (1 unit is 8 mph, we translate to 1 unit is 1 km-ish/h)
avi->max_speed = (buf->ReadByte() * 128) / 10;
break;
case 0x0D: // Acceleration
avi->acceleration = (buf->ReadByte() * 129) / 10;
avi->acceleration = (buf->ReadByte() * 128) / 10;
break;
case PROP_AIRCRAFT_RUNNING_COST_FACTOR: // 0x0E Running cost factor

View File

@ -322,6 +322,7 @@ uint32 GetTerrainType(TileIndex tile, bool upper_halftile)
has_snow = (GetTileMaxZ(tile) > GetSnowLine());
break;
case MP_VOID:
case MP_WATER:
has_snow = (GetTileZ(tile) > GetSnowLine());
break;

View File

@ -863,6 +863,8 @@ static const SpriteGroup *VehicleResolveReal(const ResolverObject *object, const
uint totalsets = in_motion ? group->num_loaded : group->num_loading;
if (totalsets == 0) return NULL;
uint set = (v->cargo.Count() * totalsets) / max((uint16)1, v->cargo_cap);
set = min(set, totalsets - 1);

View File

@ -1295,11 +1295,11 @@ bool AfterLoadGame()
if (CheckSavegameVersion(50)) {
Aircraft *v;
/* Aircraft units changed from 8 mph to 1 km/h */
/* Aircraft units changed from 8 mph to 1 km-ish/h */
FOR_ALL_AIRCRAFT(v) {
if (v->subtype <= AIR_AIRCRAFT) {
const AircraftVehicleInfo *avi = AircraftVehInfo(v->engine_type);
v->cur_speed *= 129;
v->cur_speed *= 128;
v->cur_speed /= 10;
v->max_speed = avi->max_speed;
v->acceleration = avi->acceleration;

View File

@ -113,7 +113,7 @@ void str_validate(char *str, const char *last, bool allow_newlines, bool ignore)
/* Assume the ABSOLUTE WORST to be in str as it comes from the outside. */
char *dst = str;
while (*str != '\0') {
while (str <= last && *str != '\0') {
size_t len = Utf8EncodedCharLen(*str);
/* If the character is unknown, i.e. encoded length is 0
* we assume worst case for the length check.
@ -146,6 +146,16 @@ void str_validate(char *str, const char *last, bool allow_newlines, bool ignore)
/* Replace the undesirable character with a question mark */
str += len;
if (!ignore) *dst++ = '?';
/* In case of these two special cases assume that they really
* mean SETX/SETXY and also "eat" the paramater. If this was
* not the case the string was broken to begin with and this
* would not break much more. */
if (c == SCC_SETX) {
str++;
} else if (c == SCC_SETXY) {
str += 2;
}
}
}

View File

@ -558,7 +558,7 @@ static const ShipVehicleInfo _orig_ship_vehicle_info[] = {
* @param h mail_capacity
* @param i passenger_capacity
*/
#define AVI(a, b, c, d, e, f, g, h, i) { a, b, c, d, e, f, (g * 129) / 10, h, i }
#define AVI(a, b, c, d, e, f, g, h, i) { a, b, c, d, e, f, (g * 128) / 10, h, i }
#define H AIR_HELI
#define P AIR_CTOL
#define J AIR_CTOL | AIR_FAST