mirror of https://github.com/OpenTTD/OpenTTD
(svn r25978) [1.3] -Backport from trunk:
- Fix: Some icu_config scripts are too stupid to separate two ldflags by spaces, thus only call it with one (r25642, r25638) - Fix: Do not suggest a start date for the game when there will be no vehicles available at all (r25640, r25639) - Fix: City list sort of population and rating are reversed compared to the icon [FS#5666] (r25630) - Fix: [Script] Give a slightly less generic error when removing inexisting rail [FS#5651] (r25614)release/1.3
parent
e57c544643
commit
38bcb67c38
|
@ -1718,9 +1718,9 @@ make_cflags_and_ldflags() {
|
|||
|
||||
# Some icu-configs have the 'feature' of not adding a space where others do add the space
|
||||
if [ "$static_icu" != "0" ]; then
|
||||
LIBS="$LIBS `$icu_config --ldflags-searchpath` `$icu_config --ldflags-libsonly --ldflags-layout | tr '\n\r' ' ' | sed s/licu/lsicu/g`"
|
||||
LIBS="$LIBS `$icu_config --ldflags-searchpath` `($icu_config --ldflags-libsonly; $icu_config --ldflags-layout) | tr '\n\r' ' ' | sed s/licu/lsicu/g`"
|
||||
else
|
||||
LIBS="$LIBS `$icu_config --ldflags-searchpath` `$icu_config --ldflags-libsonly --ldflags-layout | tr '\n\r' ' '`"
|
||||
LIBS="$LIBS `$icu_config --ldflags-searchpath` `($icu_config --ldflags-libsonly; $icu_config --ldflags-layout) | tr '\n\r' ' '`"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -1112,12 +1112,16 @@ void CheckEngines()
|
|||
if (!e->IsEnabled()) continue;
|
||||
|
||||
/* We have an available engine... yay! */
|
||||
if (e->flags & ENGINE_AVAILABLE && e->company_avail != 0) return;
|
||||
if ((e->flags & ENGINE_AVAILABLE) != 0 && e->company_avail != 0) return;
|
||||
|
||||
/* Okay, try to find the earliest date. */
|
||||
min_date = min(min_date, e->info.base_intro);
|
||||
}
|
||||
|
||||
SetDParam(0, min_date);
|
||||
ShowErrorMessage(STR_ERROR_NO_VEHICLES_AVAILABLE, STR_ERROR_NO_VEHICLES_AVAILABLE_EXPLANATION, WL_WARNING);
|
||||
if (min_date < INT32_MAX) {
|
||||
SetDParam(0, min_date);
|
||||
ShowErrorMessage(STR_ERROR_NO_VEHICLES_AVAILABLE_YET, STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION, WL_WARNING);
|
||||
} else {
|
||||
ShowErrorMessage(STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL, STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION, WL_WARNING);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4190,8 +4190,10 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Can't ch
|
|||
|
||||
STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vehicle is destroyed
|
||||
|
||||
STR_ERROR_NO_VEHICLES_AVAILABLE :{WHITE}No vehicles are available yet
|
||||
STR_ERROR_NO_VEHICLES_AVAILABLE_EXPLANATION :{WHITE}Start a new game after {DATE_SHORT} or use a NewGRF that provides early vehicles
|
||||
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}No vehicles will be available at all
|
||||
STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Change your NewGRF configuration
|
||||
STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}No vehicles are available yet
|
||||
STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Start a new game after {DATE_SHORT} or use a NewGRF that provides early vehicles
|
||||
|
||||
# Specific vehicle errors
|
||||
STR_ERROR_CAN_T_MAKE_TRAIN_PASS_SIGNAL :{WHITE}Can't make train pass signal at danger...
|
||||
|
|
|
@ -53,6 +53,9 @@ void SQAIRail_Register(Squirrel *engine)
|
|||
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_CROSSING_ON_ONEWAY_ROAD, ScriptRail::ERR_CROSSING_ON_ONEWAY_ROAD);
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK, ScriptRail::ERR_UNSUITABLE_TRACK);
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK, ScriptRail::ERR_UNSUITABLE_TRACK);
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_THERE_ARE_NO_SIGNALS, ScriptRail::ERR_UNSUITABLE_TRACK);
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_THERE_IS_NO_STATION, ScriptRail::ERR_UNSUITABLE_TRACK);
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_CROSSING_DISALLOWED, ScriptRail::ERR_RAILTYPE_DISALLOWS_CROSSING);
|
||||
|
||||
ScriptError::RegisterErrorMapString(ScriptRail::ERR_CROSSING_ON_ONEWAY_ROAD, "ERR_CROSSING_ON_ONEWAY_ROAD");
|
||||
|
|
|
@ -53,6 +53,9 @@ void SQGSRail_Register(Squirrel *engine)
|
|||
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_CROSSING_ON_ONEWAY_ROAD, ScriptRail::ERR_CROSSING_ON_ONEWAY_ROAD);
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK, ScriptRail::ERR_UNSUITABLE_TRACK);
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK, ScriptRail::ERR_UNSUITABLE_TRACK);
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_THERE_ARE_NO_SIGNALS, ScriptRail::ERR_UNSUITABLE_TRACK);
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_THERE_IS_NO_STATION, ScriptRail::ERR_UNSUITABLE_TRACK);
|
||||
ScriptError::RegisterErrorMap(STR_ERROR_CROSSING_DISALLOWED, ScriptRail::ERR_RAILTYPE_DISALLOWS_CROSSING);
|
||||
|
||||
ScriptError::RegisterErrorMapString(ScriptRail::ERR_CROSSING_ON_ONEWAY_ROAD, "ERR_CROSSING_ON_ONEWAY_ROAD");
|
||||
|
|
|
@ -32,8 +32,8 @@ public:
|
|||
/** One-way roads cannot have crossings */
|
||||
ERR_CROSSING_ON_ONEWAY_ROAD, // [STR_ERROR_CROSSING_ON_ONEWAY_ROAD]
|
||||
|
||||
/** Track not suitable for signals */
|
||||
ERR_UNSUITABLE_TRACK, // [STR_ERROR_NO_SUITABLE_RAILROAD_TRACK]
|
||||
/** No suitable track could be found */
|
||||
ERR_UNSUITABLE_TRACK, // [STR_ERROR_NO_SUITABLE_RAILROAD_TRACK, STR_ERROR_THERE_IS_NO_RAILROAD_TRACK, STR_ERROR_THERE_ARE_NO_SIGNALS, STR_ERROR_THERE_IS_NO_STATION]
|
||||
|
||||
/** This railtype cannot have crossings */
|
||||
ERR_RAILTYPE_DISALLOWS_CROSSING, // [STR_ERROR_CROSSING_DISALLOWED]
|
||||
|
@ -268,6 +268,9 @@ public:
|
|||
* Build a NewGRF rail station. This calls callback 18 to let a NewGRF
|
||||
* provide the station class / id to build, so we don't end up with
|
||||
* only the default stations on the map.
|
||||
* When no NewGRF provides a rail station, or an unbuildable rail station is
|
||||
* returned by a NewGRF, this function will fall back to building a default
|
||||
* non-NewGRF station as if ScriptRail::BuildRailStation was called.
|
||||
* @param tile Place to build the station.
|
||||
* @param direction The direction to build the station.
|
||||
* @param num_platforms The number of platforms to build.
|
||||
|
@ -319,6 +322,7 @@ public:
|
|||
* @pre IsValidTile(tile).
|
||||
* @pre IsValidTile(tile2).
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptRail::ERR_UNSUITABLE_TRACK
|
||||
* @return Whether at least one tile has been/can be cleared or not.
|
||||
*/
|
||||
static bool RemoveRailWaypointTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail);
|
||||
|
@ -331,6 +335,7 @@ public:
|
|||
* @pre IsValidTile(tile).
|
||||
* @pre IsValidTile(tile2).
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptRail::ERR_UNSUITABLE_TRACK
|
||||
* @return Whether at least one tile has been/can be cleared or not.
|
||||
*/
|
||||
static bool RemoveRailStationTileRectangle(TileIndex tile, TileIndex tile2, bool keep_rail);
|
||||
|
@ -369,6 +374,7 @@ public:
|
|||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @pre (GetRailTracks(tile) & rail_track) != 0.
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptRail::ERR_UNSUITABLE_TRACK
|
||||
* @return Whether the rail has been/can be removed or not.
|
||||
* @note You can only remove a single track with this function so do not
|
||||
* use the values from RailTrack as bitmask.
|
||||
|
@ -424,6 +430,7 @@ public:
|
|||
* (ScriptMap::GetTileX(from) == ScriptMap::GetTileX(tile) && ScriptMap::GetTileX(tile) == ScriptMap::GetTileX(to)) ||
|
||||
* (ScriptMap::GetTileY(from) == ScriptMap::GetTileY(tile) && ScriptMap::GetTileY(tile) == ScriptMap::GetTileY(to)).
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptRail::ERR_UNSUITABLE_TRACK
|
||||
* @return Whether the rail has been/can be removed or not.
|
||||
*/
|
||||
static bool RemoveRail(TileIndex from, TileIndex tile, TileIndex to);
|
||||
|
@ -457,6 +464,7 @@ public:
|
|||
* @pre ScriptMap::DistanceManhattan(tile, front) == 1.
|
||||
* @pre GetSignalType(tile, front) != SIGNALTYPE_NONE.
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptRail::ERR_UNSUITABLE_TRACK
|
||||
* @return Whether the signal has been/can be removed or not.
|
||||
*/
|
||||
static bool RemoveSignal(TileIndex tile, TileIndex front);
|
||||
|
|
|
@ -681,7 +681,10 @@ private:
|
|||
/** Sort by population */
|
||||
static int CDECL TownPopulationSorter(const Town * const *a, const Town * const *b)
|
||||
{
|
||||
return (*a)->cache.population - (*b)->cache.population;
|
||||
uint32 a_population = (*a)->cache.population;
|
||||
uint32 b_population = (*b)->cache.population;
|
||||
if (a_population == b_population) return TownDirectoryWindow::TownNameSorter(a, b);
|
||||
return (a_population < b_population) ? -1 : 1;
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue