(svn r9321) [gamebalance] -Sync: r9025:9314 from trunk gamebalance
authorcelestar
Mon, 19 Mar 2007 12:38:16 +0000
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 9894 70d78ac95d6c
child 9896 2473804114de
(svn r9321) [gamebalance] -Sync: r9025:9314 from trunk
Doxyfile
Makefile.in
config.lib
configure
docs/landscape.html
projects/openttd.vcproj
projects/openttd.vcproj.in
projects/openttd_vs80.vcproj
projects/openttd_vs80.vcproj.in
projects/strgen.tgt
projects/strgen.vcproj
projects/strgen_vs80.vcproj
source.list
src/ai/ai.cpp
src/ai/ai.h
src/ai/default/default.cpp
src/ai/trolly/pathfinder.cpp
src/ai/trolly/trolly.cpp
src/aircraft.h
src/aircraft_cmd.cpp
src/airport.cpp
src/airport.h
src/airport_gui.cpp
src/airport_movement.h
src/autoreplace_cmd.cpp
src/autoreplace_gui.cpp
src/aystar.h
src/bmp.h
src/bridge.h
src/build_vehicle_gui.cpp
src/cargotype.h
src/clear_cmd.cpp
src/clear_map.h
src/command.cpp
src/command.h
src/console.cpp
src/console.h
src/console_cmds.cpp
src/currency.cpp
src/currency.h
src/date.cpp
src/date.h
src/debug.cpp
src/debug.h
src/dedicated.cpp
src/depot.cpp
src/depot.h
src/depot_gui.cpp
src/direction.h
src/disaster_cmd.cpp
src/dock_gui.cpp
src/driver.cpp
src/economy.cpp
src/economy.h
src/elrail.cpp
src/engine.cpp
src/engine.h
src/engine_gui.cpp
src/fileio.cpp
src/fileio.h
src/fios.cpp
src/fios.h
src/fontcache.cpp
src/fontcache.h
src/functions.h
src/genworld.cpp
src/genworld.h
src/genworld_gui.cpp
src/gfx.cpp
src/gfx.h
src/gfxinit.cpp
src/gfxinit.h
src/graph_gui.cpp
src/gui.h
src/hal.h
src/heightmap.cpp
src/industry.h
src/industry_cmd.cpp
src/industry_gui.cpp
src/industry_map.h
src/intro_gui.cpp
src/landscape.cpp
src/lang/american.txt
src/lang/brazilian_portuguese.txt
src/lang/bulgarian.txt
src/lang/catalan.txt
src/lang/czech.txt
src/lang/danish.txt
src/lang/dutch.txt
src/lang/english.txt
src/lang/esperanto.txt
src/lang/estonian.txt
src/lang/finnish.txt
src/lang/french.txt
src/lang/galician.txt
src/lang/german.txt
src/lang/hungarian.txt
src/lang/icelandic.txt
src/lang/italian.txt
src/lang/japanese.txt
src/lang/korean.txt
src/lang/lithuanian.txt
src/lang/norwegian_bokmal.txt
src/lang/norwegian_nynorsk.txt
src/lang/polish.txt
src/lang/portuguese.txt
src/lang/romanian.txt
src/lang/russian.txt
src/lang/simplified_chinese.txt
src/lang/slovak.txt
src/lang/slovenian.txt
src/lang/spanish.txt
src/lang/swedish.txt
src/lang/traditional_chinese.txt
src/lang/turkish.txt
src/lang/ukrainian.txt
src/lang/unfinished/afrikaans.txt
src/lang/unfinished/croatian.txt
src/lang/unfinished/greek.txt
src/lang/unfinished/latvian.txt
src/livery.h
src/lzoconf.h
src/main_gui.cpp
src/map.h
src/md5.h
src/mersenne.cpp
src/minilzo.cpp
src/misc.cpp
src/misc/autoptr.hpp
src/misc_cmd.cpp
src/misc_gui.cpp
src/mixer.cpp
src/mixer.h
src/music.h
src/music/bemidi.cpp
src/music/dmusic.cpp
src/music/extmidi.cpp
src/music/libtimidity.cpp
src/music/null_m.cpp
src/music/os2_m.cpp
src/music/qtmidi.cpp
src/music/win32_m.cpp
src/music_gui.cpp
src/network/core/core.cpp
src/network/core/core.h
src/network/core/game.h
src/network/core/packet.cpp
src/network/core/packet.h
src/network/core/tcp.h
src/network/network.cpp
src/network/network.h
src/network/network_client.cpp
src/network/network_client.h
src/network/network_data.h
src/network/network_gamelist.cpp
src/network/network_gamelist.h
src/network/network_gui.cpp
src/network/network_gui.h
src/network/network_server.cpp
src/network/network_server.h
src/network/network_udp.cpp
src/network/network_udp.h
src/newgrf.cpp
src/newgrf.h
src/newgrf_callbacks.h
src/newgrf_config.cpp
src/newgrf_config.h
src/newgrf_engine.cpp
src/newgrf_engine.h
src/newgrf_gui.cpp
src/newgrf_sound.cpp
src/newgrf_sound.h
src/newgrf_spritegroup.cpp
src/newgrf_spritegroup.h
src/newgrf_station.cpp
src/newgrf_station.h
src/newgrf_text.cpp
src/newgrf_text.h
src/news.h
src/news_gui.cpp
src/npf.cpp
src/npf.h
src/oldloader.cpp
src/oldpool.h
src/openttd.cpp
src/openttd.h
src/order.h
src/order_cmd.cpp
src/order_gui.cpp
src/os/macosx/macos.mm
src/os/macosx/splash.cpp
src/os/macosx/splash.h
src/os2.cpp
src/os_timer.cpp
src/pathfind.cpp
src/pathfind.h
src/player.h
src/player_gui.cpp
src/players.cpp
src/queue.h
src/rail.h
src/rail_cmd.cpp
src/rail_gui.cpp
src/rail_map.h
src/road.h
src/road_cmd.cpp
src/road_gui.cpp
src/road_map.h
src/roadveh.h
src/roadveh_cmd.cpp
src/saveload.cpp
src/saveload.h
src/screenshot.cpp
src/screenshot.h
src/sdl.cpp
src/sdl.h
src/settings.cpp
src/settings.h
src/settings_gui.cpp
src/ship.h
src/ship_cmd.cpp
src/signs.cpp
src/signs.h
src/signs_gui.cpp
src/slope.h
src/smallmap_gui.cpp
src/sound.cpp
src/sound.h
src/sound/cocoa_s.cpp
src/sound/null_s.cpp
src/sound/sdl_s.cpp
src/sound/win32_s.cpp
src/sprite.h
src/spritecache.cpp
src/spritecache.h
src/station.cpp
src/station.h
src/station_cmd.cpp
src/station_gui.cpp
src/station_map.h
src/stdafx.h
src/strgen/strgen.cpp
src/string.cpp
src/string.h
src/strings.cpp
src/strings.h
src/subsidy_gui.cpp
src/table/ai_rail.h
src/table/build_industry.h
src/table/cargo_const.h
src/table/elrail_data.h
src/table/engines.h
src/table/industry_land.h
src/table/namegen.h
src/table/palettes.h
src/table/sprites.h
src/table/town_land.h
src/table/tree_land.h
src/table/unicode.h
src/table/unmovable_land.h
src/table/water_land.h
src/texteff.cpp
src/tgp.cpp
src/tgp.h
src/thread.cpp
src/thread.h
src/tile.h
src/town.h
src/town_cmd.cpp
src/town_gui.cpp
src/train.h
src/train_cmd.cpp
src/train_gui.cpp
src/tree_cmd.cpp
src/tree_map.h
src/tunnelbridge_cmd.cpp
src/unix.cpp
src/unmovable_cmd.cpp
src/unmovable_map.h
src/variables.h
src/vehicle.cpp
src/vehicle.h
src/vehicle_gui.cpp
src/vehicle_gui.h
src/video/cocoa_v.mm
src/video/dedicated_v.cpp
src/video/null_v.cpp
src/video/sdl_v.cpp
src/video/win32_v.cpp
src/viewport.cpp
src/viewport.h
src/water_cmd.cpp
src/water_map.h
src/waypoint.cpp
src/waypoint.h
src/widget.cpp
src/win32.cpp
src/win32.h
src/window.cpp
src/window.h
src/yapf/follow_track.hpp
src/yapf/yapf.h
src/yapf/yapf.hpp
src/yapf/yapf_costrail.hpp
src/yapf/yapf_settings.h
--- a/Doxyfile	Mon Mar 19 09:33:17 2007 +0000
+++ b/Doxyfile	Mon Mar 19 12:38:16 2007 +0000
@@ -84,6 +84,7 @@
                          *.cpp \
                          *.c++ \
                          *.h \
+                         *.hpp \
                          table/*.h
 RECURSIVE              = YES
 EXCLUDE                =
--- a/Makefile.in	Mon Mar 19 09:33:17 2007 +0000
+++ b/Makefile.in	Mon Mar 19 12:38:16 2007 +0000
@@ -94,7 +94,10 @@
 	done
 
 run: all
-	$(Q)cd !!BIN_DIR!! && ./!!TTD!!
+	$(Q)cd !!BIN_DIR!! && ./!!TTD!! $(OPENTTD_ARGS)
+
+run-gdb: all
+	$(Q)cd !!BIN_DIR!! && gdb --ex run --args ./!!TTD!! $(OPENTTD_ARGS)
 
 %.o:
 	@for dir in $(SRC_DIRS); do \
@@ -133,8 +136,8 @@
 
 # An OSX application bundle needs the data files, lang files and openttd executable in a different location.
 ifdef OSXAPP
-DATA_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Data
-LANG_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Lang
+DATA_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/data
+LANG_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/lang
 TTD_DIR  = $(BUNDLE_DIR)/$(OSXAPP)/Contents/MacOS
 else
 DATA_DIR = $(BUNDLE_DIR)/data
--- a/config.lib	Mon Mar 19 09:33:17 2007 +0000
+++ b/config.lib	Mon Mar 19 12:38:16 2007 +0000
@@ -41,6 +41,7 @@
 	enable_strip="1"
 	enable_universal="1"
 	enable_osx_g5="0"
+	enable_unicode="1"
 	with_osx_sysroot="1"
 	with_application_bundle="1"
 	with_sdl="1"
@@ -58,7 +59,7 @@
 	with_fontconfig="1"
 	with_psp_config="1"
 
-	save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir custom_lang_dir second_data_dir enable_install enable_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_osx_sysroot enable_universal enable_osx_g5 with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_libtimidity with_freetype with_fontconfig with_psp_config CC CXX CFLAGS LDFLAGS"
+	save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir custom_lang_dir second_data_dir enable_install enable_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_osx_sysroot enable_universal enable_osx_g5 enable_unicode with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_libtimidity with_freetype with_fontconfig with_psp_config CC CXX CFLAGS LDFLAGS"
 }
 
 detect_params() {
@@ -168,6 +169,9 @@
 			--disable-osx-g5)             enable_osx_g5="0";;
 			--enable-osx-g5)              enable_osx_g5="2";;
 			--enable-osx-g5=*)            enable_osx_g5="$optarg";;
+			--disable-unicode)            enable_unicode="0";;
+			--enable-unicode)             enable_unicode="2";;
+			--enable-unicode=*)           enable_unicode="$optarg";;
 
 			--with-sdl)                   with_sdl="2";;
 			--without-sdl)                with_sdl="0";;
@@ -271,7 +275,7 @@
 	echo "Running configure with following options:" >> $config_log
 	echo "" >> $config_log
 
-	configure="$0 --ignore-extra-parameters"
+	configure="$CONFIGURE_EXECUTABLE --ignore-extra-parameters"
 	for p in $save_params_array; do
 		eval "v=\"\$$p\""
 		p=`echo "$p" | sed 's/_/-/g;s/\n//g;'`
@@ -370,6 +374,20 @@
 		log 1 "checking static... no"
 	fi
 
+	if [ "$enable_unicode" = "1" ]; then
+		if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
+			enable_unicode="2"
+		else
+			enable_unicode="0"
+		fi
+	fi
+
+	if [ "$enable_unicode" != "0" ]; then
+		log 1 "checking unicode... yes"
+	else
+		log 1 "checking unicode... no"
+	fi
+
 	# Show what we configured
 	if [ "$enable_debug" = "0" ]; then
 		log 1 "using debug level... no"
@@ -478,6 +496,10 @@
 			strip_arg=""
 			# OS2 uses strip via gcc, because it needs to be feed to emxbind
 			LDFLAGS="$LDFLAGS -s"
+		elif [ "$os" = "SUNOS" ]; then
+			# The GNU strip does know -s, the non-GNU doesn't
+			#  So try to detect it (in a bit of an ugly way)
+			strip_arg="`$strip -s strip.test 2>/dev/null && echo \"-s\"`"
 		else
 			strip_arg="-s"
 		fi
@@ -533,18 +555,18 @@
 		OSXAPP="OpenTTD.app"
 
 # TODO: remove next few lines of code when the search path patch has been applied
-		if [ -n "$custom_lang_dir" ] && [ "$custom_lang_dir" != "${OSXAPP}/Contents/Lang/" ]; then
+		if [ -n "$custom_lang_dir" ] && [ "$custom_lang_dir" != "${OSXAPP}/Contents/Resources/lang/" ]; then
 			log 1 "configure: error: --custom-lang-dir and --with-application-bundle are not compatible
 			exit 1
 		fi
 
-		if [ -n "$custom_lang_dir" ] && [ "$second_data_dir" != "${OSXAPP}/Contents/Data/" ]; then
+		if [ -n "$custom_lang_dir" ] && [ "$second_data_dir" != "${OSXAPP}/Contents/Resources/data/" ]; then
 			log 1 "configure: error: --second-data-dir and --with-application-bundle are not compatible
 			exit 1
 		fi
 
-		custom_lang_dir="${OSXAPP}/Contents/Lang/"
-		second_data_dir="${OSXAPP}/Contents/Data/"
+		custom_lang_dir="${OSXAPP}/Contents/Resources/lang/"
+		second_data_dir="${OSXAPP}/Contents/Resources/data/"
 # TODO: remove till here
 	else
 		OSXAPP=""
@@ -559,8 +581,8 @@
 			# First, are we a real OSX system, else we can't detect it
 			native=`LC_ALL=C uname | tr '[A-Z]' '[a-z]' | grep darwin`
 			# If $host doesn't match $build , we are cross-compiling
-			if [ -n "$native" ] && [ "$build" != "$host" ]; then
-				$cc_build $SRC_DIR/os/macosx/G5_detector.cpp -o G5_detector
+			if [ -n "$native" ] && [ "$build" == "$host" ]; then
+				$cxx_build $SRC_DIR/os/macosx/G5_detector.cpp -o G5_detector
 				res=`./G5_detector`
 				rm -f G5_detector
 				if [ -n "$res" ]; then
@@ -727,10 +749,12 @@
 	if [ -n "$sdl_config" ]; then
 		CFLAGS="$CFLAGS -DWITH_SDL"
 		CFLAGS="$CFLAGS `$sdl_config --cflags`"
-		if [ "$enable_static" != "0" ]; then
-			LIBS="$LIBS `$sdl_config --static-libs`"
-		else
-			LIBS="$LIBS `$sdl_config --libs`"
+		if [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ] && [ "$os" != "WINCE" ]; then
+			if [ "$enable_static" != "0" ]; then
+				LIBS="$LIBS `$sdl_config --static-libs`"
+			else
+				LIBS="$LIBS `$sdl_config --libs`"
+			fi
 		fi
 	fi
 
@@ -757,10 +781,27 @@
 			if [ "$os" = "OSX" ]; then
 				LIBS="$LIBS `$png_config --prefix`/lib/libpng.a"
 			else
-				LIBS="$LIBS `$png_config --static --ldflags --libs --L_opts | tr '\n\r' '  '`"
+				LIBS="$LIBS `$png_config --static --ldflags | tr '\n\r' '  '`"
 			fi
 		else
-			LIBS="$LIBS `$png_config --ldflags --libs --L_opts | tr '\n\r' '  '`"
+			LIBS="$LIBS `$png_config --ldflags | tr '\n\r' '  '`"
+		fi
+	fi
+
+	if [ -n "$fontconfig_config" ]; then
+		CFLAGS="$CFLAGS -DWITH_FONTCONFIG"
+		CFLAGS="$CFLAGS `$fontconfig_config --cflags | tr '\n\r' '  '`"
+
+		if [ "$enable_static" != "0" ]; then
+			if [ "$os" = "OSX" ]; then
+				# fontconfig_config goes via pkg-config on all systems, which doesn't know --prefix
+				# Also, despite the reason we link to the .a file ourself (because we can't use -static), we do need to ask pkg-config about possible other deps
+				LIBS="$LIBS `$fontconfig_config --variable=prefix`/lib/libfontconfig.a `$fontconfig_config --libs --static | sed s/-lfontconfig//`"
+			else
+				LIBS="$LIBS `$fontconfig_config --libs --static | tr '\n\r' '  '`"
+			fi
+		else
+			LIBS="$LIBS `$fontconfig_config --libs | tr '\n\r' '  '`"
 		fi
 	fi
 
@@ -780,21 +821,6 @@
 		fi
 	fi
 
-	if [ -n "$fontconfig_config" ]; then
-		CFLAGS="$CFLAGS -DWITH_FONTCONFIG"
-		CFLAGS="$CFLAGS `$fontconfig_config --cflags | tr '\n\r' '  '`"
-
-		if [ "$enable_static" != "0" ]; then
-			if [ "$os" = "OSX" ]; then
-				LIBS="$LIBS `$fontconfig_config --prefix`/lib/libfontconfig.a"
-			else
-				LIBS="$LIBS `$fontconfig_config --libs --static | tr '\n\r' '  '`"
-			fi
-		else
-			LIBS="$LIBS `$fontconfig_config --libs | tr '\n\r' '  '`"
-		fi
-	fi
-
 	if [ "$with_direct_music" != "0" ]; then
 		CFLAGS="$CFLAGS -DWIN32_ENABLE_DIRECTMUSIC_SUPPORT"
 		# GCC 4.0+ doesn't like the DirectX includes (gives tons of
@@ -834,6 +860,10 @@
 		CFLAGS="$CFLAGS -DDEDICATED"
 	fi
 
+	if [ "$enable_unicode" != "0" ]; then
+		CFLAGS="$CFLAGS -DUNICODE -D_UNICODE"
+	fi
+
 	if [ "$enable_network" != "0" ]; then
 		CFLAGS="$CFLAGS -DENABLE_NETWORK"
 
@@ -1541,6 +1571,12 @@
 		return 0
 	fi
 
+	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
+		log 1 "checking libfontconfig... WIN32, skipping"
+		fontconfig_config=""
+		return 0
+	fi
+
 	if [ "$with_fontconfig" = "1" ] || [ "$with_fontconfig" = "" ] || [ "$with_fontconfig" = "2" ]; then
 		fontconfig_config="pkg-config fontconfig"
 	else
--- a/configure	Mon Mar 19 09:33:17 2007 +0000
+++ b/configure	Mon Mar 19 12:38:16 2007 +0000
@@ -1,5 +1,10 @@
 #!/bin/sh
 
+CONFIGURE_EXECUTABLE="$_"
+# On *nix systems those two are equal when ./configure is done
+if [ "$0" != "$CONFIGURE_EXECUTABLE" ]; then
+	CONFIGURE_EXECUTABLE="$CONFIGURE_EXECUTABLE $0"
+fi
 # Find out where configure is (in what dir)
 ROOT_DIR="`dirname $0`"
 ROOT_DIR="`cd $ROOT_DIR && pwd`"
--- a/docs/landscape.html	Mon Mar 19 09:33:17 2007 +0000
+++ b/docs/landscape.html	Mon Mar 19 12:38:16 2007 +0000
@@ -2066,8 +2066,13 @@
    <td valign=top nowrap>&nbsp;</td>
    <td>
     <ul>
-     <li>m1: <a href="#OwnershipInfo">owner</a> of the object (for lighthouses and transmitters normally <tt>10</tt>)</li>
-     <li>m5: tile type:
+     <li>m1 : <a href="#OwnershipInfo">owner</a> of the object (for lighthouses and transmitters normally <tt>10</tt>)</li>
+     <li>m2 :
+      <ul>
+       <li>for company statue (m5 = 02), TownID on which the statue is built in</li>
+      </ul>
+     </li>
+     <li>m5 : tile type:
       <table>
        <tr>
         <td nowrap valign=top><tt>00</tt>&nbsp; </td>
--- a/projects/openttd.vcproj	Mon Mar 19 09:33:17 2007 +0000
+++ b/projects/openttd.vcproj	Mon Mar 19 12:38:16 2007 +0000
@@ -13,12 +13,12 @@
 	<Configurations>
 		<Configuration
 			Name="Release|Win32"
-			OutputDirectory="..\objs\$(ConfigurationName)"
-			IntermediateDirectory="..\objs\$(ConfigurationName)"
+			OutputDirectory="..\objs\$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="..\objs\$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="1"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2"
+			CharacterSet="1"
 			WholeProgramOptimization="TRUE">
 			<Tool
 				Name="VCCLCompilerTool"
@@ -57,7 +57,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="unicows.lib winmm.lib ws2_32.lib libpng.lib zlibstat.lib dxguid.lib libfreetype2.lib"
+				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib dxguid.lib libfreetype2.lib"
 				LinkIncremental="1"
 				SuppressStartupBanner="TRUE"
 				IgnoreDefaultLibraryNames=""
@@ -93,8 +93,8 @@
 		</Configuration>
 		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory="..\objs\$(ConfigurationName)\"
-			IntermediateDirectory="..\objs\$(ConfigurationName)\"
+			OutputDirectory="..\objs\$(PlatformName)\$(ConfigurationName)\"
+			IntermediateDirectory="..\objs\$(PlatformName)\$(ConfigurationName)\"
 			ConfigurationType="1"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="FALSE"
@@ -167,6 +167,9 @@
 				RelativePath=".\..\src\aystar.cpp">
 			</File>
 			<File
+				RelativePath=".\..\src\autoreplace_cmd.cpp">
+			</File>
+			<File
 				RelativePath=".\..\src\bmp.cpp">
 			</File>
 			<File
--- a/projects/openttd.vcproj.in	Mon Mar 19 09:33:17 2007 +0000
+++ b/projects/openttd.vcproj.in	Mon Mar 19 12:38:16 2007 +0000
@@ -13,12 +13,12 @@
 	<Configurations>
 		<Configuration
 			Name="Release|Win32"
-			OutputDirectory="..\objs\$(ConfigurationName)"
-			IntermediateDirectory="..\objs\$(ConfigurationName)"
+			OutputDirectory="..\objs\$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="..\objs\$(PlatformName)\$(ConfigurationName)"
 			ConfigurationType="1"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="FALSE"
-			CharacterSet="2"
+			CharacterSet="1"
 			WholeProgramOptimization="TRUE">
 			<Tool
 				Name="VCCLCompilerTool"
@@ -57,7 +57,7 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="unicows.lib winmm.lib ws2_32.lib libpng.lib zlibstat.lib dxguid.lib libfreetype2.lib"
+				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib dxguid.lib libfreetype2.lib"
 				LinkIncremental="1"
 				SuppressStartupBanner="TRUE"
 				IgnoreDefaultLibraryNames=""
@@ -93,8 +93,8 @@
 		</Configuration>
 		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory="..\objs\$(ConfigurationName)\"
-			IntermediateDirectory="..\objs\$(ConfigurationName)\"
+			OutputDirectory="..\objs\$(PlatformName)\$(ConfigurationName)\"
+			IntermediateDirectory="..\objs\$(PlatformName)\$(ConfigurationName)\"
 			ConfigurationType="1"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="FALSE"
--- a/projects/openttd_vs80.vcproj	Mon Mar 19 09:33:17 2007 +0000
+++ b/projects/openttd_vs80.vcproj	Mon Mar 19 12:38:16 2007 +0000
@@ -28,7 +28,7 @@
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
+			CharacterSet="1"
 			WholeProgramOptimization="1"
 			>
 			<Tool
@@ -139,7 +139,7 @@
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
+			CharacterSet="1"
 			WholeProgramOptimization="1"
 			>
 			<Tool
@@ -251,7 +251,7 @@
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
+			CharacterSet="1"
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
@@ -346,7 +346,7 @@
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
+			CharacterSet="1"
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
@@ -452,6 +452,10 @@
 				>
 			</File>
 			<File
+				RelativePath=".\..\src\autoreplace_cmd.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\..\src\bmp.cpp"
 				>
 			</File>
--- a/projects/openttd_vs80.vcproj.in	Mon Mar 19 09:33:17 2007 +0000
+++ b/projects/openttd_vs80.vcproj.in	Mon Mar 19 12:38:16 2007 +0000
@@ -28,7 +28,7 @@
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
+			CharacterSet="1"
 			WholeProgramOptimization="1"
 			>
 			<Tool
@@ -139,7 +139,7 @@
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
+			CharacterSet="1"
 			WholeProgramOptimization="1"
 			>
 			<Tool
@@ -251,7 +251,7 @@
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
+			CharacterSet="1"
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
@@ -346,7 +346,7 @@
 			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
 			UseOfMFC="0"
 			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
+			CharacterSet="1"
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
--- a/projects/strgen.tgt	Mon Mar 19 09:33:17 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-40
-targetIdent
-0
-MProject
-1
-MComponent
-0
-2
-WString
-4
-OEXE
-3
-WString
-5
-oc2en
-1
-0
-0
-4
-MCommand
-0
-5
-MCommand
-26
-..\os\os2\build_lang.cmd
-
-6
-MItem
-10
-strgen.exe
-7
-WString
-4
-OEXE
-8
-WVList
-2
-9
-MRState
-10
-WString
-7
-OS2LINK
-11
-WString
-25
-?????No debug information
-1
-1
-12
-MRState
-13
-WString
-7
-OS2LINK
-14
-WString
-14
-?????Debug All
-1
-0
-15
-WVList
-0
--1
-1
-1
-0
-16
-WPickList
-2
-17
-MItem
-3
-*.c
-18
-WString
-4
-COBJ
-19
-WVList
-2
-20
-MRState
-21
-WString
-3
-WCC
-22
-WString
-29
-?????No debugging information
-0
-1
-23
-MRState
-24
-WString
-3
-WCC
-25
-WString
-28
-?????Line number information
-0
-0
-26
-WVList
-0
--1
-1
-1
-0
-27
-MItem
-8
-strgen.c
-28
-WString
-4
-COBJ
-29
-WVList
-0
-30
-WVList
-0
-17
-1
-1
-0
--- a/projects/strgen.vcproj	Mon Mar 19 09:33:17 2007 +0000
+++ b/projects/strgen.vcproj	Mon Mar 19 12:38:16 2007 +0000
@@ -31,7 +31,7 @@
 				AssemblerOutput="2"
 				AssemblerListingLocation="$(IntDir)"
 				ObjectFile="$(IntDir)"
-				ProgramDataBaseFileName="$(IntDir)"
+				ProgramDataBaseFileName="$(IntDir)\$(TargetName).pdb"
 				WarningLevel="3"
 				WarnAsError="TRUE"
 				SuppressStartupBanner="TRUE"
@@ -40,11 +40,11 @@
 				Name="VCCustomBuildTool"/>
 			<Tool
 				Name="VCLinkerTool"
-				OutputFile="$(OutDir)\strgen.exe"
+				OutputFile="$(IntDir)\strgen.exe"
 				LinkIncremental="1"
 				SuppressStartupBanner="TRUE"
 				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile="$(OutDir)\strgen.pdb"
+				ProgramDatabaseFile="$(IntDir)\strgen.pdb"
 				SubSystem="1"
 				TargetMachine="1"/>
 			<Tool
@@ -84,12 +84,6 @@
 			</File>
 			<File
 				RelativePath="..\src\string.cpp">
-				<FileConfiguration
-					Name="Release|Win32">
-					<Tool
-						Name="VCCLCompilerTool"
-						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
-				</FileConfiguration>
 			</File>
 		</Filter>
 		<File
--- a/projects/strgen_vs80.vcproj	Mon Mar 19 09:33:17 2007 +0000
+++ b/projects/strgen_vs80.vcproj	Mon Mar 19 12:38:16 2007 +0000
@@ -119,14 +119,6 @@
 			<File
 				RelativePath="..\src\string.cpp"
 				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						ObjectFile="$(IntDir)/$(InputName)1.obj"
-					/>
-				</FileConfiguration>
 			</File>
 		</Filter>
 		<File
--- a/source.list	Mon Mar 19 09:33:17 2007 +0000
+++ b/source.list	Mon Mar 19 12:38:16 2007 +0000
@@ -1,6 +1,7 @@
 # Source Files
 airport.cpp
 aystar.cpp
+autoreplace_cmd.cpp
 bmp.cpp
 callback_table.cpp
 cargotype.cpp
--- a/src/ai/ai.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/ai/ai.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -166,7 +166,7 @@
  * The gameloop for AIs.
  *  Handles one tick for all the AIs.
  */
-void AI_RunGameLoop(void)
+void AI_RunGameLoop()
 {
 	/* Don't do anything if ai is disabled */
 	if (!_ai.enabled) return;
@@ -224,7 +224,7 @@
 /**
  * Initialize some AI-related stuff.
  */
-void AI_Initialize(void)
+void AI_Initialize()
 {
 	/* First, make sure all AIs are DEAD! */
 	AI_Uninitialize();
@@ -238,7 +238,7 @@
 /**
  * Deinitializer for AI-related stuff.
  */
-void AI_Uninitialize(void)
+void AI_Uninitialize()
 {
 	const Player* p;
 
--- a/src/ai/ai.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/ai/ai.h	Mon Mar 19 12:38:16 2007 +0000
@@ -7,7 +7,7 @@
 #include "../command.h"
 
 /* How DoCommands look like for an AI */
-typedef struct AICommand {
+struct AICommand {
 	uint32 tile;
 	uint32 p1;
 	uint32 p2;
@@ -17,22 +17,22 @@
 	char *text;
 	uint uid;
 
-	struct AICommand *next;
-} AICommand;
+	AICommand *next;
+};
 
 /* The struct for an AIScript Player */
-typedef struct AIPlayer {
+struct AIPlayer {
 	bool active;            ///< Is this AI active?
 	AICommand *queue;       ///< The commands that he has in his queue
 	AICommand *queue_tail;  ///< The tail of this queue
-} AIPlayer;
+};
 
 /* The struct to keep some data about the AI in general */
-typedef struct AIStruct {
+struct AIStruct {
 	/* General */
 	bool enabled;           ///< Is AI enabled?
 	uint tick;              ///< The current tick (something like _frame_counter, only for AIs)
-} AIStruct;
+};
 
 VARDEF AIStruct _ai;
 VARDEF AIPlayer _ai_player[MAX_PLAYERS];
@@ -40,9 +40,9 @@
 // ai.c
 void AI_StartNewAI(PlayerID player);
 void AI_PlayerDied(PlayerID player);
-void AI_RunGameLoop(void);
-void AI_Initialize(void);
-void AI_Uninitialize(void);
+void AI_RunGameLoop();
+void AI_Initialize();
+void AI_Uninitialize();
 int32 AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
 int32 AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc, CommandCallback* callback);
 
@@ -50,7 +50,7 @@
  * This function checks some boundries to see if we should launch a new AI.
  * @return True if we can start a new AI.
  */
-static inline bool AI_AllowNewAI(void)
+static inline bool AI_AllowNewAI()
 {
 	/* If disabled, no AI */
 	if (!_ai.enabled)
@@ -97,7 +97,7 @@
 /**
  * The random-function that should be used by ALL AIs.
  */
-static inline uint32 AI_Random(void)
+static inline uint32 AI_Random()
 {
 /* We pick RandomRange if we are in SP (so when saved, we do the same over and over)
 	 *   but we pick InteractiveRandomRange if we are a network_server or network-client.
--- a/src/ai/default/default.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/ai/default/default.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -93,12 +93,12 @@
 	FOR_ALL_VEHICLES_FROM(v, index) {
 		if (v->owner != _current_player) continue;
 
-		if ((v->type == VEH_Train && v->subtype == 0) ||
-				v->type == VEH_Road ||
-				(v->type == VEH_Aircraft && IsNormalAircraft(v)) ||
-				v->type == VEH_Ship) {
+		if ((v->type == VEH_TRAIN && v->subtype == 0) ||
+				v->type == VEH_ROAD ||
+				(v->type == VEH_AIRCRAFT && IsNormalAircraft(v)) ||
+				v->type == VEH_SHIP) {
 			/* replace engine? */
-			if (v->type == VEH_Train && v->engine_type < 3 &&
+			if (v->type == VEH_TRAIN && v->engine_type < 3 &&
 					(_price.build_railvehicle >> 3) < p->player_money) {
 				p->ai.state = AIS_VEH_CHECK_REPLACE_VEHICLE;
 				p->ai.cur_veh = v;
@@ -427,8 +427,8 @@
 
 	if (!IsValidVehicle(v) ||
 			v->owner != _current_player ||
-			v->type > VEH_Ship ||
-			_veh_check_replace_proc[v->type - VEH_Train](p, v) == INVALID_ENGINE) {
+			v->type > VEH_SHIP ||
+			_veh_check_replace_proc[v->type - VEH_TRAIN](p, v) == INVALID_ENGINE) {
 		p->ai.state = AIS_VEH_LOOP;
 	} else {
 		p->ai.state_counter = 0;
@@ -443,24 +443,27 @@
 	p->ai.state = AIS_VEH_LOOP;
 	// vehicle is not owned by the player anymore, something went very wrong.
 	if (!IsValidVehicle(v) || v->owner != _current_player) return;
-	_veh_do_replace_proc[v->type - VEH_Train](p);
+	_veh_do_replace_proc[v->type - VEH_TRAIN](p);
 }
 
-typedef struct FoundRoute {
+struct FoundRoute {
 	int distance;
 	CargoID cargo;
 	void *from;
 	void *to;
-} FoundRoute;
-
-static Town *AiFindRandomTown(void)
+};
+
+static Town *AiFindRandomTown()
 {
 	return GetRandomTown();
 }
 
-static Industry *AiFindRandomIndustry(void)
+static Industry *AiFindRandomIndustry()
 {
-	return GetRandomIndustry();
+	int num = RandomRange(GetMaxIndustryIndex());
+	if (IsValidIndustry(GetIndustry(num))) return GetIndustry(num);
+
+	return NULL;
 }
 
 static void AiFindSubsidyIndustryRoute(FoundRoute *fr)
@@ -1824,12 +1827,12 @@
 	return tile + ToTileIndexDiff(p->tileoffs) - TileOffsByDiagDir(*dir = p->attr);
 }
 
-typedef struct AiRailPathFindData {
+struct AiRailPathFindData {
 	TileIndex tile;
 	TileIndex tile2;
 	int count;
 	bool flag;
-} AiRailPathFindData;
+};
 
 static bool AiEnumFollowTrack(TileIndex tile, AiRailPathFindData *a, int track, uint length, byte *state)
 {
@@ -1858,7 +1861,7 @@
 	return arpfd.count > 8;
 }
 
-typedef struct AiRailFinder {
+struct AiRailFinder {
 	TileIndex final_tile;
 	byte final_dir;
 	byte depth;
@@ -1873,7 +1876,7 @@
 	TileIndex cur_best_tile, best_tile;
 	TileIndex bridge_end_tile;
 	Player *player;
-} AiRailFinder;
+};
 
 static const byte _ai_table_15[4][8] = {
 	{0, 0, 4, 3, 3, 1, 128 + 0, 64},
@@ -2713,7 +2716,7 @@
 	p->ai.state_mode = 255;
 }
 
-typedef struct {
+struct AiRoadFinder {
 	TileIndex final_tile;
 	byte final_dir;
 	byte depth;
@@ -2728,14 +2731,14 @@
 	TileIndex cur_best_tile, best_tile;
 	TileIndex bridge_end_tile;
 	Player *player;
-} AiRoadFinder;
-
-typedef struct AiRoadEnum {
+};
+
+struct AiRoadEnum {
 	TileIndex dest;
 	TileIndex best_tile;
 	int best_track;
 	uint best_dist;
-} AiRoadEnum;
+};
 
 static const byte _dir_by_track[] = {
 	0, 1, 0, 1, 2, 1,
@@ -3515,7 +3518,7 @@
 	Vehicle *v = p->ai.cur_veh;
 
 	if (v->owner == _current_player) {
-		if (v->type == VEH_Train) {
+		if (v->type == VEH_TRAIN) {
 
 			if (!IsTileDepotType(v->tile, TRANSPORT_RAIL) || v->u.rail.track != 0x80 || !(v->vehstatus&VS_STOPPED)) {
 				if (v->current_order.type != OT_GOTO_DEPOT)
@@ -3526,7 +3529,7 @@
 			// Sell whole train
 			DoCommand(v->tile, v->index, 1, DC_EXEC, CMD_SELL_RAIL_WAGON);
 
-		} else if (v->type == VEH_Road) {
+		} else if (v->type == VEH_ROAD) {
 			if (!IsRoadVehInDepotStopped(v)) {
 				if (v->current_order.type != OT_GOTO_DEPOT)
 					DoCommand(0, v->index, 0, DC_EXEC, CMD_SEND_ROADVEH_TO_DEPOT);
@@ -3534,7 +3537,7 @@
 			}
 
 			DoCommand(0, v->index, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
-		} else if (v->type == VEH_Aircraft) {
+		} else if (v->type == VEH_AIRCRAFT) {
 			if (!IsAircraftInHangarStopped(v)) {
 				if (v->current_order.type != OT_GOTO_DEPOT)
 					DoCommand(0, v->index, 0, DC_EXEC, CMD_SEND_AIRCRAFT_TO_HANGAR);
@@ -3542,9 +3545,9 @@
 			}
 
 			DoCommand(0, v->index, 0, DC_EXEC, CMD_SELL_AIRCRAFT);
-			} else if (v->type == VEH_Ship) {
+			} else if (v->type == VEH_SHIP) {
 			// XXX: not implemented
-			error("!v->type == VEH_Ship");
+			error("!v->type == VEH_SHIP");
 		}
 	}
 
--- a/src/ai/trolly/pathfinder.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/ai/trolly/pathfinder.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -372,9 +372,9 @@
 extern uint GetRailFoundation(Slope tileh, TrackBits bits); // XXX function declaration in .c
 extern uint GetRoadFoundation(Slope tileh, RoadBits bits); // XXX function declaration in .c
 extern uint GetBridgeFoundation(Slope tileh, Axis); // XXX function declaration in .c
-typedef enum BridgeFoundations{
+enum BridgeFoundation {
 	BRIDGE_NO_FOUNDATION = 1 << 0 | 1 << 3 | 1 << 6 | 1 << 9 | 1 << 12,
-} BridgeFoundation;
+};
 
 // The most important function: it calculates the g-value
 static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, OpenListNode *parent)
--- a/src/ai/trolly/trolly.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/ai/trolly/trolly.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -126,7 +126,7 @@
 			p->ainew.last_vehiclecheck_date = _date;
 		} else if (c < 100 && !_patches.ai_disable_veh_roadveh) {
 			// Do we have any spots for road-vehicles left open?
-			if (GetFreeUnitNumber(VEH_Road) <= _patches.max_roadveh) {
+			if (GetFreeUnitNumber(VEH_ROAD) <= _patches.max_roadveh) {
 				if (c < 85) {
 					p->ainew.action = AI_ACTION_TRUCK_ROUTE;
 				} else {
@@ -135,7 +135,7 @@
 			}
 #if 0
 		} else if (c < 200 && !_patches.ai_disable_veh_train) {
-			if (GetFreeUnitNumber(VEH_Train) <= _patches.max_trains) {
+			if (GetFreeUnitNumber(VEH_TRAIN) <= _patches.max_trains) {
 				p->ainew.action = AI_ACTION_TRAIN_ROUTE;
 			}
 #endif
@@ -173,7 +173,7 @@
 	//  to build the route anyway..
 	if (p->ainew.action == AI_ACTION_BUS_ROUTE &&
 			money > AI_MINIMUM_BUS_ROUTE_MONEY) {
-		if (GetFreeUnitNumber(VEH_Road) > _patches.max_roadveh) {
+		if (GetFreeUnitNumber(VEH_ROAD) > _patches.max_roadveh) {
 			p->ainew.action = AI_ACTION_NONE;
 			return;
 		}
@@ -184,7 +184,7 @@
 	}
 	if (p->ainew.action == AI_ACTION_TRUCK_ROUTE &&
 			money > AI_MINIMUM_TRUCK_ROUTE_MONEY) {
-		if (GetFreeUnitNumber(VEH_Road) > _patches.max_roadveh) {
+		if (GetFreeUnitNumber(VEH_ROAD) > _patches.max_roadveh) {
 			p->ainew.action = AI_ACTION_NONE;
 			return;
 		}
@@ -1264,7 +1264,7 @@
 
 			// We are already sending him back
 			if (AiNew_GetSpecialVehicleFlag(p, v) & AI_VEHICLEFLAG_SELL) {
-				if (v->type == VEH_Road && IsTileDepotType(v->tile, TRANSPORT_ROAD) &&
+				if (v->type == VEH_ROAD && IsTileDepotType(v->tile, TRANSPORT_ROAD) &&
 						(v->vehstatus&VS_STOPPED)) {
 					// We are at the depot, sell the vehicle
 					AI_DoCommand(0, v->index, 0, DC_EXEC, CMD_SELL_ROAD_VEH);
@@ -1275,7 +1275,7 @@
 			if (!AiNew_SetSpecialVehicleFlag(p, v, AI_VEHICLEFLAG_SELL)) return;
 			{
 				int ret = 0;
-				if (v->type == VEH_Road)
+				if (v->type == VEH_ROAD)
 					ret = AI_DoCommand(0, v->index, 0, DC_EXEC, CMD_SEND_ROADVEH_TO_DEPOT);
 				// This means we can not find a depot :s
 				//				if (CmdFailed(ret))
@@ -1293,7 +1293,7 @@
 	FOR_ALL_VEHICLES(v) {
 		if (v->owner != p->index) continue;
 		// Currently, we only know how to handle road-vehicles
-		if (v->type != VEH_Road) continue;
+		if (v->type != VEH_ROAD) continue;
 
 		AiNew_CheckVehicle(p, v);
 	}
--- a/src/aircraft.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/aircraft.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,12 +8,12 @@
 #include "station_map.h"
 #include "vehicle.h"
 
-typedef enum AircraftSubTypes {
+enum AircraftSubType {
 	AIR_HELICOPTER = 0,
 	AIR_AIRCRAFT   = 2,
 	AIR_SHADOW     = 4,
 	AIR_ROTOR      = 6
-} AircraftSubType;
+};
 
 
 /** Check if the aircraft type is a normal flying device; eg
@@ -23,7 +23,7 @@
  * false if it is a shadow or a rotor) */
 static inline bool IsNormalAircraft(const Vehicle *v)
 {
-	assert(v->type == VEH_Aircraft);
+	assert(v->type == VEH_AIRCRAFT);
 	/* To be fully correct the commented out functionality is the proper one,
 	 * but since value can only be 0 or 2, it is sufficient to only check <= 2
 	 * return (v->subtype == AIR_HELICOPTER) || (v->subtype == AIR_AIRCRAFT); */
@@ -33,7 +33,7 @@
 
 static inline bool IsAircraftInHangar(const Vehicle* v)
 {
-	assert(v->type == VEH_Aircraft);
+	assert(v->type == VEH_AIRCRAFT);
 	return v->vehstatus & VS_HIDDEN && IsHangarTile(v->tile);
 }
 
@@ -42,6 +42,20 @@
 	return IsAircraftInHangar(v) && v->vehstatus & VS_STOPPED;
 }
 
+/** Checks if an aircraft is buildable at the tile in question
+ * @param engine The engine to test
+ * @param tile The tile where the hangar is
+ * @return true if the aircraft can be build
+ */
+static inline bool IsAircraftBuildableAtStation(EngineID engine, TileIndex tile)
+{
+	const Station *st = GetStationByTile(tile);
+	const AirportFTAClass *apc = st->Airport();
+	const AircraftVehicleInfo *avi = AircraftVehInfo(engine);
+
+	return (apc->flags & (avi->subtype & AIR_CTOL ? AirportFTAClass::AIRPLANES : AirportFTAClass::HELICOPTERS)) != 0;
+}
+
 uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo*);
 
 void CcBuildAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2);
--- a/src/aircraft_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/aircraft_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -227,7 +227,6 @@
 	}
 }
 
-
 /** Build an aircraft.
  * @param tile tile of depot where aircraft is built
  * @param flags for command
@@ -237,7 +236,7 @@
  */
 int32 CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
-	if (!IsEngineBuildable(p1, VEH_Aircraft, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
+	if (!IsEngineBuildable(p1, VEH_AIRCRAFT, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
 
 	const AircraftVehicleInfo *avi = AircraftVehInfo(p1);
 	int32 value = EstimateAircraftCost(avi);
@@ -250,11 +249,7 @@
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
 	/* Prevent building aircraft types at places which can't handle them */
-	const Station* st = GetStationByTile(tile);
-	const AirportFTAClass* apc = st->Airport();
-	if (!(apc->flags & (avi->subtype & AIR_CTOL ? AirportFTAClass::AIRPLANES : AirportFTAClass::HELICOPTERS))) {
-		return CMD_ERROR;
-	}
+	if (!IsAircraftBuildableAtStation(p1, tile)) return CMD_ERROR;
 
 	/* Allocate 2 or 3 vehicle structs, depending on type
 	 * vl[0] = aircraft, vl[1] = shadow, [vl[2] = rotor] */
@@ -263,7 +258,7 @@
 		return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 	}
 
-	UnitID unit_num = HASBIT(p2, 0) ? 0 : GetFreeUnitNumber(VEH_Aircraft);
+	UnitID unit_num = HASBIT(p2, 0) ? 0 : GetFreeUnitNumber(VEH_AIRCRAFT);
 	if (unit_num > _patches.max_aircraft)
 		return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 
@@ -272,7 +267,7 @@
 		Vehicle *u = vl[1]; // shadow
 
 		v->unitnumber = unit_num;
-		v->type = u->type = VEH_Aircraft;
+		v->type = u->type = VEH_AIRCRAFT;
 		v->direction = DIR_SE;
 
 		v->owner = u->owner = _current_player;
@@ -367,6 +362,9 @@
 		 * layout for #th position of depot. Since layout must start with a listing
 		 * of all depots, it is simple */
 		for (uint i = 0;; i++) {
+			const Station *st = GetStationByTile(tile);
+			const AirportFTAClass *apc = st->Airport();
+
 			assert(i != apc->nof_depots);
 			if (st->airport_tile + ToTileIndexDiff(apc->airport_depots[i]) == tile) {
 				assert(apc->layout[i].heading == HANGAR);
@@ -402,7 +400,7 @@
 
 			u->next = w;
 
-			w->type = VEH_Aircraft;
+			w->type = VEH_AIRCRAFT;
 			w->direction = DIR_N;
 			w->owner = _current_player;
 			w->x_pos = v->x_pos;
@@ -425,7 +423,7 @@
 		RebuildVehicleLists();
 		InvalidateWindow(WC_COMPANY, v->owner);
 		if (IsLocalPlayer())
-			InvalidateAutoreplaceWindow(VEH_Aircraft); //updates the replace Aircraft window
+			InvalidateAutoreplaceWindow(VEH_AIRCRAFT); //updates the replace Aircraft window
 
 		GetPlayer(_current_player)->num_engines[p1]++;
 	}
@@ -457,7 +455,7 @@
 
 	Vehicle *v = GetVehicle(p1);
 
-	if (v->type != VEH_Aircraft || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
 	if (!IsAircraftInHangarStopped(v)) return_cmd_error(STR_A01B_AIRCRAFT_MUST_BE_STOPPED);
 
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
@@ -484,7 +482,7 @@
 
 	Vehicle *v = GetVehicle(p1);
 
-	if (v->type != VEH_Aircraft || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	/* cannot stop airplane when in flight, or when taking off / landing */
 	if (v->u.air.state >= STARTTAKEOFF && v->u.air.state < TERM7)
@@ -526,14 +524,14 @@
 	if (p2 & DEPOT_MASS_SEND) {
 		/* Mass goto depot requested */
 		if (!ValidVLWFlags(p2 & VLW_MASK)) return CMD_ERROR;
-		return SendAllVehiclesToDepot(VEH_Aircraft, flags, p2 & DEPOT_SERVICE, _current_player, (p2 & VLW_MASK), p1);
+		return SendAllVehiclesToDepot(VEH_AIRCRAFT, flags, p2 & DEPOT_SERVICE, _current_player, (p2 & VLW_MASK), p1);
 	}
 
 	if (!IsValidVehicleID(p1)) return CMD_ERROR;
 
 	Vehicle *v = GetVehicle(p1);
 
-	if (v->type != VEH_Aircraft || !CheckOwnership(v->owner) || IsAircraftInHangar(v)) return CMD_ERROR;
+	if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner) || IsAircraftInHangar(v)) return CMD_ERROR;
 
 	if (v->current_order.type == OT_GOTO_DEPOT && !(p2 & DEPOT_LOCATE_HANGAR)) {
 		if (!!(p2 & DEPOT_SERVICE) == HASBIT(v->current_order.flags, OFB_HALT_IN_DEPOT)) {
@@ -603,12 +601,12 @@
 
 	Vehicle *v = GetVehicle(p1);
 
-	if (v->type != VEH_Aircraft || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
 	if (!IsAircraftInHangarStopped(v)) return_cmd_error(STR_A01B_AIRCRAFT_MUST_BE_STOPPED);
 
 	/* Check cargo */
 	CargoID new_cid = GB(p2, 0, 8);
-	if (new_cid > NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
+	if (new_cid >= NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
 
 	SET_EXPENSES_TYPE(EXPENSES_AIRCRAFT_RUN);
 
@@ -726,12 +724,12 @@
 	InvalidateWindowClasses(WC_AIRCRAFT_LIST);
 }
 
-void AircraftYearlyLoop(void)
+void AircraftYearlyLoop()
 {
 	Vehicle *v;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Aircraft && IsNormalAircraft(v)) {
+		if (v->type == VEH_AIRCRAFT && IsNormalAircraft(v)) {
 			v->profit_last_year = v->profit_this_year;
 			v->profit_this_year = 0;
 			InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
@@ -1065,19 +1063,38 @@
 	if (v->load_unload_time_rem != 0) v->load_unload_time_rem--;
 
 	do {
-		/* Turn. Do it slowly if in the air. */
-		Direction newdir = GetDirectionTowards(v, x + amd->x, y + amd->y);
-		if (newdir != v->direction) {
-			v->direction = newdir;
-			if (amd->flag & AMED_SLOWTURN) {
-				if (v->load_unload_time_rem == 0) v->load_unload_time_rem = 8;
-			} else {
-				v->cur_speed >>= 1;
+
+		GetNewVehiclePosResult gp;
+
+		if (dist < 4) {
+			/* move vehicle one pixel towards target */
+			gp.x = (v->x_pos != (x + amd->x)) ?
+					v->x_pos + ((x + amd->x > v->x_pos) ? 1 : -1) :
+					v->x_pos;
+			gp.y = (v->y_pos != (y + amd->y)) ?
+					v->y_pos + ((y + amd->y > v->y_pos) ? 1 : -1) :
+					v->y_pos;
+
+			/* Oilrigs must keep v->tile as st->airport_tile, since the landing pad is in a non-airport tile */
+			gp.new_tile = (st->airport_type == AT_OILRIG) ? st->airport_tile : TileVirtXY(gp.x, gp.y);
+
+		} else {
+
+			/* Turn. Do it slowly if in the air. */
+			Direction newdir = GetDirectionTowards(v, x + amd->x, y + amd->y);
+			if (newdir != v->direction) {
+				v->direction = newdir;
+				if (amd->flag & AMED_SLOWTURN) {
+					if (v->load_unload_time_rem == 0) v->load_unload_time_rem = 8;
+				} else {
+					v->cur_speed >>= 1;
+				}
 			}
+
+			/* Move vehicle. */
+			gp = GetNewVehiclePos(v);
 		}
 
-		/* Move vehicle. */
-		GetNewVehiclePosResult gp = GetNewVehiclePos(v);
 		v->tile = gp.new_tile;
 		/* If vehicle is in the air, use tile coordinate 0. */
 		// if (amd->flag & (AMED_TAKEOFF | AMED_SLOWTURN | AMED_LAND)) v->tile = 0;
@@ -1275,8 +1292,7 @@
 
 			if (CmdFailed(ret)) CrashAirplane(v);
 		} else if (v->current_order.type != OT_GOTO_DEPOT) {
-			v->current_order.type = OT_NOTHING;
-			v->current_order.flags = 0;
+			v->current_order.Free();
 		}
 		return;
 	}
@@ -1328,8 +1344,7 @@
 			}
 
 			Order b = v->current_order;
-			v->current_order.type = OT_NOTHING;
-			v->current_order.flags = 0;
+			v->current_order.Free();
 			MarkAircraftDirty(v);
 			if (!(b.flags & OF_NON_STOP)) return;
 			break;
@@ -1554,8 +1569,7 @@
 
 	/* if we were sent to the depot, stay there */
 	if (v->current_order.type == OT_GOTO_DEPOT && (v->vehstatus & VS_STOPPED)) {
-		v->current_order.type = OT_NOTHING;
-		v->current_order.flags = 0;
+		v->current_order.Free();
 		return;
 	}
 
@@ -1603,7 +1617,7 @@
 		return;
 	}
 
-	if (v->current_order.type == OT_NOTHING) return;
+	if (!v->current_order.IsValid()) return;
 
 	/* if the block of the next position is busy, stay put */
 	if (AirportHasBlock(v, &apc->layout[v->u.air.pos], apc)) return;
@@ -1624,8 +1638,7 @@
 			}
 			break;
 		default:  // orders have been deleted (no orders), goto depot and don't bother us
-			v->current_order.type = OT_NOTHING;
-			v->current_order.flags = 0;
+			v->current_order.Free();
 			v->u.air.state = HANGAR;
 	}
 	AirportMove(v, apc);
@@ -2099,14 +2112,14 @@
 
 	for (uint i = 0; i != 2; i++) {
 		AircraftEventHandler(v, i);
-		if (v->type != VEH_Aircraft) // In case it was deleted
+		if (v->type != VEH_AIRCRAFT) // In case it was deleted
 			break;
 	}
 }
 
 
 /** need to be called to load aircraft from old version */
-void UpdateOldAircraft(void)
+void UpdateOldAircraft()
 {
 	/* set airport_flags to 0 for all airports just to be sure */
 	Station *st;
@@ -2118,7 +2131,7 @@
 	FOR_ALL_VEHICLES(v_oldstyle) {
 	/* airplane has another vehicle with subtype 4 (shadow), helicopter also has 3 (rotor)
 	 * skip those */
-		if (v_oldstyle->type == VEH_Aircraft && IsNormalAircraft(v_oldstyle)) {
+		if (v_oldstyle->type == VEH_AIRCRAFT && IsNormalAircraft(v_oldstyle)) {
 			/* airplane in terminal stopped doesn't hurt anyone, so goto next */
 			if (v_oldstyle->vehstatus & VS_STOPPED && v_oldstyle->u.air.state == 0) {
 				v_oldstyle->u.air.state = HANGAR;
@@ -2148,7 +2161,7 @@
 
 	Vehicle *v;
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Aircraft && IsNormalAircraft(v)) {
+		if (v->type == VEH_AIRCRAFT && IsNormalAircraft(v)) {
 			if (v->u.air.targetairport == st->index) { // if heading to this airport
 				/* update position of airplane. If plane is not flying, landing, or taking off
 				 *you cannot delete airport, so it doesn't matter */
--- a/src/airport.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/airport.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -32,7 +32,7 @@
 static AirportFTAClass *HeliStation;
 
 
-void InitializeAirports(void)
+void InitializeAirports()
 {
 	CountryAirport = new AirportFTAClass(
 		_airport_moving_data_country,
@@ -175,7 +175,7 @@
 	);
 }
 
-void UnInitializeAirports(void)
+void UnInitializeAirports()
 {
 	delete CountryAirport;
 	delete CityAirport;
@@ -467,7 +467,7 @@
 }
 
 
-uint32 GetValidAirports(void)
+uint32 GetValidAirports()
 {
 	uint32 mask = 0;
 
--- a/src/airport.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/airport.h	Mon Mar 19 12:38:16 2007 +0000
@@ -112,17 +112,17 @@
 
 	NOTHING_block            = 1 << 30;
 
-typedef struct AirportMovingData {
+struct AirportMovingData {
 	int16 x;
 	int16 y;
 	uint16 flag;
 	DirectionByte direction;
-} AirportMovingData;
+};
 
 struct AirportFTAbuildup;
 
 // Finite sTate mAchine --> FTA
-typedef struct AirportFTAClass {
+struct AirportFTAClass {
 	public:
 		enum Flags {
 			AIRPLANES   = 0x1,
@@ -167,22 +167,22 @@
 	byte size_y;
 	byte delta_z;                         // Z adjustment for helicopter pads
 	byte catchment;
-} AirportFTAClass;
+};
 
 DECLARE_ENUM_AS_BIT_SET(AirportFTAClass::Flags)
 
 
 // internal structure used in openttd - Finite sTate mAchine --> FTA
-typedef struct AirportFTA {
-	struct AirportFTA *next; // possible extra movement choices from this position
+struct AirportFTA {
+	AirportFTA *next;        // possible extra movement choices from this position
 	uint64 block;            // 64 bit blocks (st->airport_flags), should be enough for the most complex airports
 	byte position;           // the position that an airplane is at
 	byte next_position;      // next position from this position
 	byte heading;            // heading (current orders), guiding an airplane to its target on an airport
-} AirportFTA;
+};
 
-void InitializeAirports(void);
-void UnInitializeAirports(void);
+void InitializeAirports();
+void UnInitializeAirports();
 const AirportFTAClass *GetAirport(const byte airport_type);
 
 /** Get buildable airport bitmask.
@@ -190,6 +190,6 @@
  * Bit 0 means the small airport is buildable, etc.
  * @todo set availability of airports by year, instead of airplane
  */
-uint32 GetValidAirports(void);
+uint32 GetValidAirports();
 
 #endif /* AIRPORT_H */
--- a/src/airport_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/airport_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -21,7 +21,7 @@
 
 static byte _selected_airport_type;
 
-static void ShowBuildAirportPicker(void);
+static void ShowBuildAirportPicker();
 
 
 void CcBuildAirport(bool success, TileIndex tile, uint32 p1, uint32 p2)
@@ -132,7 +132,7 @@
 	BuildAirToolbWndProc
 };
 
-void ShowBuildAirToolbar(void)
+void ShowBuildAirToolbar()
 {
 	if (!IsValidPlayer(_current_player)) return;
 
@@ -256,12 +256,12 @@
 	BuildAirportPickerWndProc
 };
 
-static void ShowBuildAirportPicker(void)
+static void ShowBuildAirportPicker()
 {
 	AllocateWindowDesc(&_build_airport_desc);
 }
 
-void InitializeAirportGui(void)
+void InitializeAirportGui()
 {
 	_selected_airport_type = AT_SMALL;
 }
--- a/src/airport_movement.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/airport_movement.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,12 +8,12 @@
 
 // state machine input struct (from external file, etc.)
 // Finite sTate mAchine --> FTA
-typedef struct AirportFTAbuildup {
+struct AirportFTAbuildup {
 	byte position; // the position that an airplane is at
 	byte heading;  // the current orders (eg. TAKEOFF, HANGAR, ENDLANDING, etc.)
 	uint64 block;  // the block this position is on on the airport (st->airport_flags)
 	byte next;     // next position from this position
-} AirportFTAbuildup;
+};
 
 ///////////////////////////////////////////////////////////////////////
 /////*********Movement Positions on Airports********************///////
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/autoreplace_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -0,0 +1,414 @@
+/* $Id$ */
+
+#include "stdafx.h"
+#include "openttd.h"
+#include "roadveh.h"
+#include "ship.h"
+#include "table/strings.h"
+#include "functions.h"
+#include "news.h"
+#include "command.h"
+#include "player.h"
+#include "engine.h"
+#include "debug.h"
+#include "vehicle_gui.h"
+#include "depot.h"
+#include "train.h"
+#include "aircraft.h"
+#include "cargotype.h"
+
+
+/*
+ * move the cargo from one engine to another if possible
+ */
+static void MoveVehicleCargo(Vehicle *dest, Vehicle *source)
+{
+	Vehicle *v = dest;
+	int units_moved;
+
+	do {
+		do {
+			if (source->cargo_type != dest->cargo_type)
+				continue; // cargo not compatible
+
+			if (dest->cargo_count == dest->cargo_cap)
+				continue; // the destination vehicle is already full
+
+			units_moved = min(source->cargo_count, dest->cargo_cap - dest->cargo_count);
+			source->cargo_count -= units_moved;
+			dest->cargo_count   += units_moved;
+			dest->cargo_source   = source->cargo_source;
+
+			// copy the age of the cargo
+			dest->cargo_days   = source->cargo_days;
+			dest->day_counter  = source->day_counter;
+			dest->tick_counter = source->tick_counter;
+
+		} while (source->cargo_count > 0 && (dest = dest->next) != NULL);
+		dest = v;
+	} while ((source = source->next) != NULL);
+
+	/*
+	 * The of the train will be incorrect at this moment. This is due
+	 * to the fact that removing the old wagon updates the weight of
+	 * the complete train, which is without the weight of cargo we just
+	 * moved back into some (of the) new wagon(s).
+	 */
+	if (dest->type == VEH_TRAIN) TrainConsistChanged(dest->first);
+}
+
+static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, const EngineID engine_type)
+{
+	const Order *o;
+	const Vehicle *u;
+
+	if (v->type == VEH_TRAIN) {
+		u = GetFirstVehicleInChain(v);
+	} else {
+		u = v;
+	}
+
+	FOR_VEHICLE_ORDERS(u, o) {
+		if (!(o->refit_cargo < NUM_CARGO)) continue;
+		if (!CanRefitTo(v->engine_type, o->refit_cargo)) continue;
+		if (!CanRefitTo(engine_type, o->refit_cargo)) return false;
+	}
+
+	return true;
+}
+
+/**
+ * Function to find what type of cargo to refit to when autoreplacing
+ * @param *v Original vehicle, that is being replaced
+ * @param engine_type The EngineID of the vehicle that is being replaced to
+ * @return The cargo type to replace to
+ *    CT_NO_REFIT is returned if no refit is needed
+ *    CT_INVALID is returned when both old and new vehicle got cargo capacity and refitting the new one to the old one's cargo type isn't possible
+ */
+static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type)
+{
+	bool new_cargo_capacity = true;
+	CargoID new_cargo_type = CT_INVALID;
+
+	switch (v->type) {
+		case VEH_TRAIN:
+			new_cargo_capacity = (RailVehInfo(engine_type)->capacity > 0);
+			new_cargo_type     = RailVehInfo(engine_type)->cargo_type;
+			break;
+
+		case VEH_ROAD:
+			new_cargo_capacity = (RoadVehInfo(engine_type)->capacity > 0);
+			new_cargo_type     = RoadVehInfo(engine_type)->cargo_type;
+			break;
+		case VEH_SHIP:
+			new_cargo_capacity = (ShipVehInfo(engine_type)->capacity > 0);
+			new_cargo_type     = ShipVehInfo(engine_type)->cargo_type;
+			break;
+
+		case VEH_AIRCRAFT:
+			/* all aircraft starts as passenger planes with cargo capacity
+			 * new_cargo_capacity is always true for aircraft, which is the init value. No need to set it here */
+			new_cargo_type     = CT_PASSENGERS;
+			break;
+
+		default: NOT_REACHED(); break;
+	}
+
+	if (!new_cargo_capacity) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity
+
+	if (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type)) {
+		if (VerifyAutoreplaceRefitForOrders(v, engine_type)) {
+			return v->cargo_type == new_cargo_type ? (CargoID)CT_NO_REFIT : v->cargo_type;
+		} else {
+			return CT_INVALID;
+		}
+	}
+	if (v->type != VEH_TRAIN) return CT_INVALID; // We can't refit the vehicle to carry the cargo we want
+
+	/* Below this line it's safe to assume that the vehicle in question is a train */
+
+	if (v->cargo_cap != 0) return CT_INVALID; // trying to replace a vehicle with cargo capacity into another one with incompatible cargo type
+
+	/* the old engine didn't have cargo capacity, but the new one does
+	 * now we will figure out what cargo the train is carrying and refit to fit this */
+	v = GetFirstVehicleInChain(v);
+	do {
+		if (v->cargo_cap == 0) continue;
+		/* Now we found a cargo type being carried on the train and we will see if it is possible to carry to this one */
+		if (v->cargo_type == new_cargo_type) return CT_NO_REFIT;
+		if (CanRefitTo(engine_type, v->cargo_type)) return v->cargo_type;
+	} while ((v=v->next) != NULL);
+	return CT_NO_REFIT; // We failed to find a cargo type on the old vehicle and we will not refit the new one
+}
+
+/* Replaces a vehicle (used to be called autorenew)
+ * This function is only called from MaybeReplaceVehicle()
+ * Must be called with _current_player set to the owner of the vehicle
+ * @param w Vehicle to replace
+ * @param flags is the flags to use when calling DoCommand(). Mainly DC_EXEC counts
+ * @return value is cost of the replacement or CMD_ERROR
+ */
+static int32 ReplaceVehicle(Vehicle **w, byte flags, int32 total_cost)
+{
+	int32 cost;
+	int32 sell_value;
+	Vehicle *old_v = *w;
+	const Player *p = GetPlayer(old_v->owner);
+	EngineID new_engine_type;
+	const UnitID cached_unitnumber = old_v->unitnumber;
+	bool new_front = false;
+	Vehicle *new_v = NULL;
+	char vehicle_name[32];
+	CargoID replacement_cargo_type;
+
+	new_engine_type = EngineReplacementForPlayer(p, old_v->engine_type);
+	if (new_engine_type == INVALID_ENGINE) new_engine_type = old_v->engine_type;
+
+	replacement_cargo_type = GetNewCargoTypeForReplace(old_v, new_engine_type);
+
+	/* check if we can't refit to the needed type, so no replace takes place to prevent the vehicle from altering cargo type */
+	if (replacement_cargo_type == CT_INVALID) return 0;
+
+	sell_value = DoCommand(0, old_v->index, 0, DC_QUERY_COST, GetCmdSellVeh(old_v));
+
+	/* We give the player a loan of the same amount as the sell value.
+	 * This is needed in case he needs the income from the sale to build the new vehicle.
+	 * We take it back if building fails or when we really sell the old engine */
+	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
+	SubtractMoneyFromPlayer(sell_value);
+
+	cost = DoCommand(old_v->tile, new_engine_type, 3, flags, GetCmdBuildVeh(old_v));
+	if (CmdFailed(cost)) {
+		SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
+		SubtractMoneyFromPlayer(-sell_value); // Take back the money we just gave the player
+		return cost;
+	}
+
+	if (replacement_cargo_type != CT_NO_REFIT) cost += GetRefitCost(new_engine_type); // add refit cost
+
+	if (flags & DC_EXEC) {
+		new_v = GetVehicle(_new_vehicle_id);
+		*w = new_v; //we changed the vehicle, so MaybeReplaceVehicle needs to work on the new one. Now we tell it what the new one is
+
+		/* refit if needed */
+		if (replacement_cargo_type != CT_NO_REFIT) {
+			if (CmdFailed(DoCommand(0, new_v->index, replacement_cargo_type, DC_EXEC, GetCmdRefitVeh(new_v)))) {
+				/* Being here shows a failure, which most likely is in GetNewCargoTypeForReplace() or incorrect estimation costs */
+				error("Autoreplace failed to refit. Replace engine %d to %d and refit to cargo %d", old_v->engine_type, new_v->engine_type, replacement_cargo_type);
+			}
+		}
+
+		if (new_v->type == VEH_TRAIN && HASBIT(old_v->u.rail.flags, VRF_REVERSE_DIRECTION) && !IsMultiheaded(new_v) && !(new_v->next != NULL && IsArticulatedPart(new_v->next))) {
+			// we are autorenewing to a single engine, so we will turn it as the old one was turned as well
+			SETBIT(new_v->u.rail.flags, VRF_REVERSE_DIRECTION);
+		}
+
+		if (old_v->type == VEH_TRAIN && !IsFrontEngine(old_v)) {
+			/* this is a railcar. We need to move the car into the train
+			 * We add the new engine after the old one instead of replacing it. It will give the same result anyway when we
+			 * sell the old engine in a moment
+			 */
+			DoCommand(0, (GetPrevVehicleInChain(old_v)->index << 16) | new_v->index, 1, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
+			/* Now we move the old one out of the train */
+			DoCommand(0, (INVALID_VEHICLE << 16) | old_v->index, 0, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
+		} else {
+			// copy/clone the orders
+			DoCommand(0, (old_v->index << 16) | new_v->index, IsOrderListShared(old_v) ? CO_SHARE : CO_COPY, DC_EXEC, CMD_CLONE_ORDER);
+			new_v->cur_order_index = old_v->cur_order_index;
+			ChangeVehicleViewWindow(old_v, new_v);
+			new_v->profit_this_year = old_v->profit_this_year;
+			new_v->profit_last_year = old_v->profit_last_year;
+			new_v->service_interval = old_v->service_interval;
+			new_front = true;
+			new_v->unitnumber = old_v->unitnumber; // use the same unit number
+
+			new_v->current_order = old_v->current_order;
+			if (old_v->type == VEH_TRAIN && GetNextVehicle(old_v) != NULL){
+				Vehicle *temp_v = GetNextVehicle(old_v);
+
+				// move the entire train to the new engine, excluding the old engine
+				if (IsMultiheaded(old_v) && temp_v == old_v->u.rail.other_multiheaded_part) {
+					// we got front and rear of a multiheaded engine right after each other. We should work with the next in line instead
+					temp_v = GetNextVehicle(temp_v);
+				}
+
+				if (temp_v != NULL) {
+					DoCommand(0, (new_v->index << 16) | temp_v->index, 1, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
+				}
+			}
+		}
+		/* We are done setting up the new vehicle. Now we move the cargo from the old one to the new one */
+		MoveVehicleCargo(new_v->type == VEH_TRAIN ? GetFirstVehicleInChain(new_v) : new_v, old_v);
+
+		// Get the name of the old vehicle if it has a custom name.
+		if (!IsCustomName(old_v->string_id)) {
+			vehicle_name[0] = '\0';
+		} else {
+			GetName(vehicle_name, old_v->string_id & 0x7FF, lastof(vehicle_name));
+		}
+	} else { // flags & DC_EXEC not set
+		/* Ensure that the player will not end up having negative money while autoreplacing
+		 * This is needed because the only other check is done after the income from selling the old vehicle is substracted from the cost */
+		if (p->money64 < (cost + total_cost)) {
+			SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
+			SubtractMoneyFromPlayer(-sell_value); // Pay back the loan
+			return CMD_ERROR;
+		}
+	}
+
+	/* Take back the money we just gave the player just before building the vehicle
+	 * The player will get the same amount now that the sale actually takes place */
+	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
+	SubtractMoneyFromPlayer(-sell_value);
+
+	/* sell the engine/ find out how much you get for the old engine (income is returned as negative cost) */
+	cost += DoCommand(0, old_v->index, 0, flags, GetCmdSellVeh(old_v));
+
+	if (new_front) {
+		/* now we assign the old unitnumber to the new vehicle */
+		new_v->unitnumber = cached_unitnumber;
+	}
+
+	/* Transfer the name of the old vehicle */
+	if ((flags & DC_EXEC) && vehicle_name[0] != '\0') {
+		_cmd_text = vehicle_name;
+		DoCommand(0, new_v->index, 0, DC_EXEC, CMD_NAME_VEHICLE);
+	}
+
+	return cost;
+}
+
+/** replaces a vehicle if it's set for autoreplace or is too old
+ * (used to be called autorenew)
+ * @param v The vehicle to replace
+ * if the vehicle is a train, v needs to be the front engine
+ * @param check Checks if the replace is valid. No action is done at all
+ * @param display_costs If set, a cost animation is shown (only if check is false)
+ * @return CMD_ERROR if something went wrong. Otherwise the price of the replace
+ */
+int32 MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs)
+{
+	Vehicle *w;
+	const Player *p = GetPlayer(v->owner);
+	byte flags = 0;
+	int32 cost, temp_cost = 0;
+	bool stopped;
+
+	/* Remember the length in case we need to trim train later on
+	 * If it's not a train, the value is unused
+	 * round up to the length of the tiles used for the train instead of the train length instead
+	 * Useful when newGRF uses custom length */
+	uint16 old_total_length = (v->type == VEH_TRAIN ?
+		(v->u.rail.cached_total_length + TILE_SIZE - 1) / TILE_SIZE * TILE_SIZE :
+		-1
+	);
+
+
+	_current_player = v->owner;
+
+	assert(IsPlayerBuildableVehicleType(v));
+
+	assert(v->vehstatus & VS_STOPPED); // the vehicle should have been stopped in VehicleEnteredDepotThisTick() if needed
+
+	/* Remember the flag v->leave_depot_instantly because if we replace the vehicle, the vehicle holding this flag will be sold
+	 * If it is set, then we only stopped the vehicle to replace it (if needed) and we will need to start it again.
+	 * We also need to reset the flag since it should remain false except from when the vehicle enters a depot until autoreplace is handled in the same tick */
+	stopped = v->leave_depot_instantly;
+	v->leave_depot_instantly = false;
+
+	for (;;) {
+		cost = 0;
+		w = v;
+		do {
+			if (w->type == VEH_TRAIN && IsMultiheaded(w) && !IsTrainEngine(w)) {
+				/* we build the rear ends of multiheaded trains with the front ones */
+				continue;
+			}
+
+			// check if the vehicle should be replaced
+			if (!p->engine_renew ||
+					w->age - w->max_age < (p->engine_renew_months * 30) || // replace if engine is too old
+					w->max_age == 0) { // rail cars got a max age of 0
+				if (!EngineHasReplacementForPlayer(p, w->engine_type)) // updates to a new model
+					continue;
+			}
+
+			/* Now replace the vehicle */
+			temp_cost = ReplaceVehicle(&w, flags, cost);
+
+			if (flags & DC_EXEC &&
+					(w->type != VEH_TRAIN || w->u.rail.first_engine == INVALID_ENGINE)) {
+				/* now we bought a new engine and sold the old one. We need to fix the
+				 * pointers in order to avoid pointing to the old one for trains: these
+				 * pointers should point to the front engine and not the cars
+				 */
+				v = w;
+			}
+
+			if (!CmdFailed(temp_cost)) {
+				cost += temp_cost;
+			}
+		} while (w->type == VEH_TRAIN && (w = GetNextVehicle(w)) != NULL);
+
+		if (!(flags & DC_EXEC) && (p->money64 < (int32)(cost + p->engine_renew_money) || cost == 0)) {
+			if (!check && p->money64 < (int32)(cost + p->engine_renew_money) && ( _local_player == v->owner ) && cost != 0) {
+				StringID message;
+				SetDParam(0, v->unitnumber);
+				switch (v->type) {
+					case VEH_TRAIN:    message = STR_TRAIN_AUTORENEW_FAILED;       break;
+					case VEH_ROAD:     message = STR_ROADVEHICLE_AUTORENEW_FAILED; break;
+					case VEH_SHIP:     message = STR_SHIP_AUTORENEW_FAILED;        break;
+					case VEH_AIRCRAFT: message = STR_AIRCRAFT_AUTORENEW_FAILED;    break;
+						// This should never happen
+					default: NOT_REACHED(); message = 0; break;
+				}
+
+				AddNewsItem(message, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0), v->index, 0);
+			}
+			if (stopped) v->vehstatus &= ~VS_STOPPED;
+			if (display_costs) _current_player = OWNER_NONE;
+			return CMD_ERROR;
+		}
+
+		if (flags & DC_EXEC) {
+			break; // we are done replacing since the loop ran once with DC_EXEC
+		} else if (check) {
+			/* It's a test only and we know that we can do this
+			 * NOTE: payment for wagon removal is NOT included in this price */
+			return cost;
+		}
+		// now we redo the loop, but this time we actually do stuff since we know that we can do it
+		flags |= DC_EXEC;
+	}
+
+	/* If setting is on to try not to exceed the old length of the train with the replacement */
+	if (v->type == VEH_TRAIN && p->renew_keep_length) {
+		Vehicle *temp;
+		w = v;
+
+		while (v->u.rail.cached_total_length > old_total_length) {
+			// the train is too long. We will remove cars one by one from the start of the train until it's short enough
+			while (w != NULL && RailVehInfo(w->engine_type)->railveh_type != RAILVEH_WAGON) {
+				w = GetNextVehicle(w);
+			}
+			if (w == NULL) {
+				// we failed to make the train short enough
+				SetDParam(0, v->unitnumber);
+				AddNewsItem(STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0), v->index, 0);
+				break;
+			}
+			temp = w;
+			w = GetNextVehicle(w);
+			DoCommand(0, (INVALID_VEHICLE << 16) | temp->index, 0, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
+			MoveVehicleCargo(v, temp);
+			cost += DoCommand(0, temp->index, 0, DC_EXEC, CMD_SELL_RAIL_WAGON);
+		}
+	}
+
+	if (stopped) v->vehstatus &= ~VS_STOPPED;
+	if (display_costs) {
+		if (IsLocalPlayer()) ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, cost);
+		_current_player = OWNER_NONE;
+	}
+	return cost;
+}
--- a/src/autoreplace_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/autoreplace_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -30,7 +30,7 @@
 };
 
 /* General Vehicle GUI based procedures that are independent of vehicle types */
-void InitializeVehiclesGuiList(void)
+void InitializeVehiclesGuiList()
 {
 	_railtype_selected_in_replace_gui = RAILTYPE_RAIL;
 }
@@ -80,12 +80,12 @@
 
 	switch (GetEngine(engine)->type) {
 		default: NOT_REACHED();
-		case VEH_Train:
+		case VEH_TRAIN:
 			if (RailVehInfo(engine)->capacity == 0) return CT_INVALID; // no capacity -> can't carry cargo
 			return RailVehInfo(engine)->cargo_type;
-		case VEH_Road:       return RoadVehInfo(engine)->cargo_type;
-		case VEH_Ship:       return ShipVehInfo(engine)->cargo_type;
-		case VEH_Aircraft:   return CT_PASSENGERS; // all planes are build with passengers by default
+		case VEH_ROAD:       return RoadVehInfo(engine)->cargo_type;
+		case VEH_SHIP:       return ShipVehInfo(engine)->cargo_type;
+		case VEH_AIRCRAFT:   return CT_PASSENGERS; // all planes are build with passengers by default
 	}
 }
 
@@ -147,7 +147,7 @@
 	EngList_RemoveAll(list);
 
 	FOR_ALL_ENGINEIDS_OF_TYPE(e, type) {
-		if (type == VEH_Train && !GenerateReplaceRailList(e, draw_left, WP(w, replaceveh_d).wagon_btnstate)) continue; // special rules for trains
+		if (type == VEH_TRAIN && !GenerateReplaceRailList(e, draw_left, WP(w, replaceveh_d).wagon_btnstate)) continue; // special rules for trains
 
 		if (draw_left) {
 			/* Skip drawing the engines we don't have any of and haven't set for replacement */
@@ -255,7 +255,7 @@
 			/* now the actual drawing of the window itself takes place */
 			SetDParam(0, _vehicle_type_names[w->window_number]);
 
-			if (w->window_number == VEH_Train) {
+			if (w->window_number == VEH_TRAIN) {
 				/* set on/off for renew_keep_length */
 				SetDParam(1, p->renew_keep_length ? STR_CONFIG_PATCHES_ON : STR_CONFIG_PATCHES_OFF);
 
@@ -269,7 +269,7 @@
 			DrawWindowWidgets(w);
 
 
-			if (w->window_number == VEH_Train) {
+			if (w->window_number == VEH_TRAIN) {
 				/* Draw the selected railtype in the pulldown menu */
 				RailType railtype = _railtype_selected_in_replace_gui;
 				DrawString(157, w->widget[14].top + 1, _rail_types_list[railtype], 0x10);
@@ -487,19 +487,19 @@
 	DeleteWindowById(WC_REPLACE_VEHICLE, vehicletype);
 
 	switch (vehicletype) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			w = AllocateWindowDescFront(&_replace_rail_vehicle_desc, vehicletype);
 			w->vscroll.cap  = 8;
 			w->resize.step_height = 14;
 			WP(w, replaceveh_d).wagon_btnstate = true;
 			break;
-		case VEH_Road:
+		case VEH_ROAD:
 			w = AllocateWindowDescFront(&_replace_road_vehicle_desc, vehicletype);
 			w->vscroll.cap  = 8;
 			w->resize.step_height = 14;
 			break;
-		case VEH_Ship:
-		case VEH_Aircraft:
+		case VEH_SHIP:
+		case VEH_AIRCRAFT:
 			w = AllocateWindowDescFront(&_replace_ship_aircraft_vehicle_desc, vehicletype);
 			w->vscroll.cap  = 4;
 			w->resize.step_height = 24;
--- a/src/aystar.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/aystar.h	Mon Mar 19 12:38:16 2007 +0000
@@ -27,7 +27,6 @@
 	AYSTAR_INVALID_NODE = -1,
 };
 
-typedef struct AyStarNode AyStarNode;
 struct AyStarNode {
 	TileIndex tile;
 	int direction;
@@ -35,7 +34,6 @@
 };
 
 // The resulting path has nodes looking like this.
-typedef struct PathNode PathNode;
 struct PathNode {
 	AyStarNode node;
 	// The parent of this item
@@ -45,13 +43,12 @@
 // For internal use only
 // We do not save the h-value, because it is only needed to calculate the f-value.
 //  h-value should _always_ be the distance left to the end-tile.
-typedef struct OpenListNode OpenListNode;
 struct OpenListNode {
 	int g;
 	PathNode path;
 };
 
-typedef struct AyStar AyStar;
+struct AyStar;
 /*
  * This function is called to check if the end-tile is found
  *  return values can be:
--- a/src/bmp.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/bmp.h	Mon Mar 19 12:38:16 2007 +0000
@@ -5,7 +5,7 @@
 #ifndef BMP_H
 #define BMP_H
 
-typedef struct {
+struct BmpInfo {
 	uint32 offset;       ///< offset of bitmap data from .bmp file begining
 	uint32 width;        ///< bitmap width
 	uint32 height;       ///< bitmap height
@@ -13,22 +13,22 @@
 	uint16 bpp;          ///< bits per pixel
 	uint32 compression;  ///< compression method (0 = none, 1 = 8-bit RLE, 2 = 4-bit RLE)
 	uint32 palette_size; ///< number of colors in palette
-} BmpInfo;
+};
 
-typedef struct {
+struct BmpData {
 	Colour *palette;
 	byte   *bitmap;
-} BmpData;
+};
 
 #define BMP_BUFFER_SIZE 1024
 
-typedef struct {
+struct BmpBuffer {
 	byte data[BMP_BUFFER_SIZE];
 	int pos;
 	int read;
 	FILE *file;
 	uint real_pos;
-} BmpBuffer;
+};
 
 void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file);
 bool BmpReadHeader(BmpBuffer *buffer, BmpInfo *info, BmpData *data);
--- a/src/bridge.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/bridge.h	Mon Mar 19 12:38:16 2007 +0000
@@ -11,7 +11,7 @@
 
 /** Struct containing information about a single bridge type
  */
-typedef struct Bridge {
+struct Bridge {
 	Year avail_year;     ///< the year in which the bridge becomes available
 	byte min_length;     ///< the minimum length of the bridge (not counting start and end tile)
 	byte max_length;     ///< the maximum length of the bridge (not counting start and end tile)
@@ -22,7 +22,7 @@
 	StringID material;   ///< the string that contains the bridge description
 	PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge
 	byte flags;          ///< bit 0 set: disable drawing of far pillars.
-} Bridge;
+};
 
 extern const Bridge orig_bridge[MAX_BRIDGES];
 extern Bridge _bridge[MAX_BRIDGES];
--- a/src/build_vehicle_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/build_vehicle_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -63,7 +63,7 @@
 static void SetupWindowStrings(Window *w, byte type)
 {
 	switch (type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data    = STR_JUST_STRING;
 			w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips   = STR_8843_TRAIN_VEHICLE_SELECTION;
 			w->widget[BUILD_VEHICLE_WIDGET_BUILD].data      = STR_881F_BUILD_VEHICLE;
@@ -71,7 +71,7 @@
 			w->widget[BUILD_VEHICLE_WIDGET_RENAME].data     = STR_8820_RENAME;
 			w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_8845_RENAME_TRAIN_VEHICLE_TYPE;
 			break;
-		case VEH_Road:
+		case VEH_ROAD:
 			w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data    = STR_9006_NEW_ROAD_VEHICLES;
 			w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips   = STR_9026_ROAD_VEHICLE_SELECTION;
 			w->widget[BUILD_VEHICLE_WIDGET_BUILD].data      = STR_9007_BUILD_VEHICLE;
@@ -79,7 +79,7 @@
 			w->widget[BUILD_VEHICLE_WIDGET_RENAME].data     = STR_9034_RENAME;
 			w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_9035_RENAME_ROAD_VEHICLE_TYPE;
 			break;
-		case VEH_Ship:
+		case VEH_SHIP:
 			w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data    = STR_9808_NEW_SHIPS;
 			w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips   = STR_9825_SHIP_SELECTION_LIST_CLICK;
 			w->widget[BUILD_VEHICLE_WIDGET_BUILD].data      = STR_9809_BUILD_SHIP;
@@ -87,7 +87,7 @@
 			w->widget[BUILD_VEHICLE_WIDGET_RENAME].data     = STR_9836_RENAME;
 			w->widget[BUILD_VEHICLE_WIDGET_RENAME].tooltips = STR_9837_RENAME_SHIP_TYPE;
 			break;
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			w->widget[BUILD_VEHICLE_WIDGET_CAPTION].data    = STR_A005_NEW_AIRCRAFT;
 			w->widget[BUILD_VEHICLE_WIDGET_LIST].tooltips   = STR_A025_AIRCRAFT_SELECTION_LIST;
 			w->widget[BUILD_VEHICLE_WIDGET_BUILD].data      = STR_A006_BUILD_AIRCRAFT;
@@ -536,7 +536,7 @@
 	bool refitable = false;
 
 	switch (e->type) {
-		case VEH_Train: {
+		case VEH_TRAIN: {
 			const RailVehicleInfo *rvi = RailVehInfo(engine_number);
 
 			refitable = (EngInfo(engine_number)->refit_mask != 0) && (rvi->capacity > 0);
@@ -562,23 +562,23 @@
 			y += 10;
 		}
 			break;
-		case VEH_Road:
+		case VEH_ROAD:
 			y = DrawRoadVehPurchaseInfo(x, y, engine_number, RoadVehInfo(engine_number));
 			refitable = true;
 			break;
-		case VEH_Ship: {
+		case VEH_SHIP: {
 			const ShipVehicleInfo *svi = ShipVehInfo(engine_number);
 			y = DrawShipPurchaseInfo(x, y, engine_number, svi);
 			refitable = svi->refittable;
 		} break;
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			y = DrawAircraftPurchaseInfo(x, y, engine_number, AircraftVehInfo(engine_number));
 			refitable = true;
 			break;
 	}
 
 	/* Draw details, that applies to all types except rail wagons */
-	if (e->type != VEH_Train || RailVehInfo(engine_number)->railveh_type != RAILVEH_WAGON) {
+	if (e->type != VEH_TRAIN || RailVehInfo(engine_number)->railveh_type != RAILVEH_WAGON) {
 		/* Design date - Life length */
 		SetDParam(0, ymd.year);
 		SetDParam(1, e->lifelength);
@@ -616,7 +616,7 @@
 		const RailVehicleInfo *rvi = RailVehInfo(eid);
 
 		if (bv->filter.railtype != RAILTYPE_END && !HasPowerOnRail(rvi->railtype, bv->filter.railtype)) continue;
-		if (!IsEngineBuildable(eid, VEH_Train, _local_player)) continue;
+		if (!IsEngineBuildable(eid, VEH_TRAIN, _local_player)) continue;
 
 		EngList_Add(&bv->eng_list, eid);
 		if (rvi->railveh_type != RAILVEH_WAGON) {
@@ -653,7 +653,7 @@
 	sel_id = INVALID_ENGINE;
 
 	for (eid = ROAD_ENGINES_INDEX; eid < ROAD_ENGINES_INDEX + NUM_ROAD_ENGINES; eid++) {
-		if (!IsEngineBuildable(eid, VEH_Road, _local_player)) continue;
+		if (!IsEngineBuildable(eid, VEH_ROAD, _local_player)) continue;
 		EngList_Add(&bv->eng_list, eid);
 
 		if (eid == bv->sel_engine) sel_id = eid;
@@ -672,7 +672,7 @@
 	sel_id = INVALID_ENGINE;
 
 	for (eid = SHIP_ENGINES_INDEX; eid < SHIP_ENGINES_INDEX + NUM_SHIP_ENGINES; eid++) {
-		if (!IsEngineBuildable(eid, VEH_Ship, _local_player)) continue;
+		if (!IsEngineBuildable(eid, VEH_SHIP, _local_player)) continue;
 		EngList_Add(&bv->eng_list, eid);
 
 		if (eid == bv->sel_engine) sel_id = eid;
@@ -694,26 +694,11 @@
 	 * when planes become obsolete and are removed */
 	sel_id = INVALID_ENGINE;
 	for (eid = AIRCRAFT_ENGINES_INDEX; eid < AIRCRAFT_ENGINES_INDEX + NUM_AIRCRAFT_ENGINES; eid++) {
-		if (IsEngineBuildable(eid, VEH_Aircraft, _local_player)) {
-			const AircraftVehicleInfo *avi = AircraftVehInfo(eid);
-			switch (bv->filter.flags & ~AirportFTAClass::SHORT_STRIP) { // we don't care about the length of the runway here
-				case AirportFTAClass::HELICOPTERS:
-					if (avi->subtype != AIR_HELI) continue;
-					break;
+		if (!IsEngineBuildable(eid, VEH_AIRCRAFT, _local_player)) continue;
+		if (w->window_number != 0 && !IsAircraftBuildableAtStation(eid, w->window_number)) continue;
 
-				case AirportFTAClass::AIRPLANES:
-					if (!(avi->subtype & AIR_CTOL)) continue;
-					break;
-
-				case AirportFTAClass::ALL: break;
-				default:
-					NOT_REACHED();
-			}
-
-			EngList_Add(&bv->eng_list, eid);
-
-			if (eid == bv->sel_engine) sel_id = eid;
-		}
+		EngList_Add(&bv->eng_list, eid);
+		if (eid == bv->sel_engine) sel_id = eid;
 	}
 
 	bv->sel_engine = sel_id;
@@ -725,16 +710,16 @@
 	buildvehicle_d *bv = &WP(w, buildvehicle_d);
 
 	switch (bv->vehicle_type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			GenerateBuildTrainList(w);
 			return; // trains should not reach the last sorting
-		case VEH_Road:
+		case VEH_ROAD:
 			GenerateBuildRoadVehList(w);
 			break;
-		case VEH_Ship:
+		case VEH_SHIP:
 			GenerateBuildShipList(w);
 			break;
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			GenerateBuildAircraftList(w);
 			break;
 	}
@@ -745,10 +730,10 @@
 static void DrawVehicleEngine(byte type, int x, int y, EngineID engine, SpriteID pal)
 {
 	switch (type) {
-		case VEH_Train:    DrawTrainEngine(   x, y, engine, pal); break;
-		case VEH_Road:     DrawRoadVehEngine( x, y, engine, pal); break;
-		case VEH_Ship:     DrawShipEngine(    x, y, engine, pal); break;
-		case VEH_Aircraft: DrawAircraftEngine(x, y, engine, pal); break;
+		case VEH_TRAIN:    DrawTrainEngine(   x, y, engine, pal); break;
+		case VEH_ROAD:     DrawRoadVehEngine( x, y, engine, pal); break;
+		case VEH_SHIP:     DrawShipEngine(    x, y, engine, pal); break;
+		case VEH_AIRCRAFT: DrawAircraftEngine(x, y, engine, pal); break;
 		default: NOT_REACHED();
 	}
 }
@@ -772,22 +757,22 @@
 	assert(max <= EngList_Count(&eng_list));
 
 	switch (type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			x++; // train and road vehicles use the same offset, except trains are one more pixel to the right
 			/* Fallthough */
-		case VEH_Road:
+		case VEH_ROAD:
 			x += 26;
 			x_offset = 30;
 			y += 2;
 			y_offset = 4;
 			break;
-		case VEH_Ship:
+		case VEH_SHIP:
 			x += 35;
 			x_offset = 40;
 			y += 7;
 			y_offset = 3;
 			break;
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			x += 27;
 			x_offset = 33;
 			y += 7;
@@ -858,17 +843,17 @@
 			EngineID sel_eng = bv->sel_engine;
 			if (sel_eng != INVALID_ENGINE) {
 				switch (bv->vehicle_type) {
-					case VEH_Train:
+					case VEH_TRAIN:
 						DoCommandP(w->window_number, sel_eng, 0, (RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) ? CcBuildWagon : CcBuildLoco,
 								   CMD_BUILD_RAIL_VEHICLE | CMD_MSG(STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE));
 						break;
-					case VEH_Road:
+					case VEH_ROAD:
 						DoCommandP(w->window_number, sel_eng, 0, CcBuildRoadVeh, CMD_BUILD_ROAD_VEH | CMD_MSG(STR_9009_CAN_T_BUILD_ROAD_VEHICLE));
 						break;
-					case VEH_Ship:
+					case VEH_SHIP:
 						DoCommandP(w->window_number, sel_eng, 0, CcBuildShip, CMD_BUILD_SHIP | CMD_MSG(STR_980D_CAN_T_BUILD_SHIP));
 						break;
-					case VEH_Aircraft:
+					case VEH_AIRCRAFT:
 						DoCommandP(w->window_number, sel_eng, 0, CcBuildAircraft, CMD_BUILD_AIRCRAFT | CMD_MSG(STR_A008_CAN_T_BUILD_AIRCRAFT));
 						break;
 				}
@@ -883,10 +868,10 @@
 
 				bv->rename_engine = sel_eng;
 				switch (bv->vehicle_type) {
-					case VEH_Train:    str = STR_886A_RENAME_TRAIN_VEHICLE_TYPE; break;
-					case VEH_Road:     str = STR_9036_RENAME_ROAD_VEHICLE_TYPE;  break;
-					case VEH_Ship:     str = STR_9838_RENAME_SHIP_TYPE;          break;
-					case VEH_Aircraft: str = STR_A039_RENAME_AIRCRAFT_TYPE;      break;
+					case VEH_TRAIN:    str = STR_886A_RENAME_TRAIN_VEHICLE_TYPE; break;
+					case VEH_ROAD:     str = STR_9036_RENAME_ROAD_VEHICLE_TYPE;  break;
+					case VEH_SHIP:     str = STR_9838_RENAME_SHIP_TYPE;          break;
+					case VEH_AIRCRAFT: str = STR_A039_RENAME_AIRCRAFT_TYPE;      break;
 				}
 				ShowQueryString(GetCustomEngineName(sel_eng), str, 31, 160, w, CS_ALPHANUMERAL);
 			}
@@ -926,10 +911,10 @@
 				StringID str = STR_NULL;
 				_cmd_text = e->we.edittext.str;
 				switch (bv->vehicle_type) {
-					case VEH_Train:    str = STR_886B_CAN_T_RENAME_TRAIN_VEHICLE; break;
-					case VEH_Road:     str = STR_9037_CAN_T_RENAME_ROAD_VEHICLE;  break;
-					case VEH_Ship:     str = STR_9839_CAN_T_RENAME_SHIP_TYPE;     break;
-					case VEH_Aircraft: str = STR_A03A_CAN_T_RENAME_AIRCRAFT_TYPE; break;
+					case VEH_TRAIN:    str = STR_886B_CAN_T_RENAME_TRAIN_VEHICLE; break;
+					case VEH_ROAD:     str = STR_9037_CAN_T_RENAME_ROAD_VEHICLE;  break;
+					case VEH_SHIP:     str = STR_9839_CAN_T_RENAME_SHIP_TYPE;     break;
+					case VEH_AIRCRAFT: str = STR_A03A_CAN_T_RENAME_AIRCRAFT_TYPE; break;
 				}
 				DoCommandP(0, bv->rename_engine, 0, NULL, CMD_RENAME_ENGINE | CMD_MSG(str));
 			}
@@ -992,16 +977,16 @@
 	bv->descending_sort_order = _last_sort_order[type];
 
 	switch (type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			WP(w,buildvehicle_d).filter.railtype = (tile == 0) ? RAILTYPE_END : GetRailType(tile);
 			ResizeWindow(w, 0, 16);
 			break;
-		case VEH_Road:
+		case VEH_ROAD:
 			ResizeWindow(w, 20, 16);
-		case VEH_Ship:
+		case VEH_SHIP:
 			ResizeWindow(w, 27, 0);
 			break;
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			bv->filter.flags =
 				tile == 0 ? AirportFTAClass::ALL : GetStationByTile(tile)->Airport()->flags;
 			ResizeWindow(w, 12, 0);
--- a/src/cargotype.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/cargotype.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,8 +8,17 @@
 
 typedef uint32 CargoLabel;
 
+enum TownEffect {
+	TE_NONE,
+	TE_PASSENGERS,
+	TE_MAIL,
+	TE_GOODS,
+	TE_WATER,
+	TE_FOOD,
+};
 
-typedef struct CargoSpec {
+
+struct CargoSpec {
 	uint8 bitnum;
 	CargoLabel label;
 	uint32 grfid;
@@ -20,7 +29,7 @@
 	uint8 transit_days[2];
 
 	bool is_freight;
-	uint8 substitutetowngrowth;
+	TownEffect town_effect; ///< The effect this cargo type has on towns
 	uint16 multipliertowngrowth;
 	uint8 callbackflags;
 
@@ -35,7 +44,7 @@
 	uint16 classes;
 
 	bool IsValid() const;
-} CargoSpec;
+};
 
 
 extern uint32 _cargo_mask;
@@ -48,5 +57,10 @@
 /* Get the cargo ID with the cargo label */
 CargoID GetCargoIDByLabel(CargoLabel cl);
 
+static inline bool IsCargoInClass(CargoID c, uint16 cc)
+{
+	return GetCargo(c)->classes & cc;
+}
+
 
 #endif /* CARGOTYPE_H */
--- a/src/clear_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/clear_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -22,12 +22,12 @@
 #include "genworld.h"
 #include "industry.h"
 
-typedef struct TerraformerHeightMod {
+struct TerraformerHeightMod {
 	TileIndex tile;
 	byte height;
-} TerraformerHeightMod;
+};
 
-typedef struct TerraformerState {
+struct TerraformerState {
 	int height[4];
 	uint32 flags;
 
@@ -40,7 +40,7 @@
 	TileIndex *tile_table;
 	TerraformerHeightMod *modheight;
 
-} TerraformerState;
+};
 
 static int TerraformAllowTileProcess(TerraformerState *ts, TileIndex tile)
 {
@@ -718,7 +718,7 @@
 	MarkTileDirtyByTile(tile);
 }
 
-void GenerateClearTile(void)
+void GenerateClearTile()
 {
 	uint i, gi;
 	TileIndex tile;
@@ -792,7 +792,7 @@
 	return;
 }
 
-void InitializeClearLand(void)
+void InitializeClearLand()
 {
 	_opt.snow_line = _patches.snow_line_height * TILE_HEIGHT;
 }
--- a/src/clear_map.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/clear_map.h	Mon Mar 19 12:38:16 2007 +0000
@@ -12,14 +12,14 @@
 /* ground type, m5 bits 2...4
  * valid densities (bits 0...1) in comments after the enum
  */
-typedef enum ClearGround {
+enum ClearGround {
 	CLEAR_GRASS  = 0, ///< 0-3
 	CLEAR_ROUGH  = 1, ///< 3
 	CLEAR_ROCKS  = 2, ///< 3
 	CLEAR_FIELDS = 3, ///< 3
 	CLEAR_SNOW   = 4, ///< 0-3
 	CLEAR_DESERT = 5  ///< 1,3
-} ClearGround;
+};
 
 
 static inline ClearGround GetClearGround(TileIndex t)
--- a/src/command.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/command.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -395,7 +395,7 @@
 	return res;
 }
 
-int32 GetAvailableMoneyForCommand(void)
+int32 GetAvailableMoneyForCommand()
 {
 	PlayerID pid = _current_player;
 	if (!IsValidPlayer(pid)) return 0x7FFFFFFF; // max int
--- a/src/command.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/command.h	Mon Mar 19 12:38:16 2007 +0000
@@ -176,10 +176,10 @@
 
 typedef int32 CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2);
 
-typedef struct Command {
+struct Command {
 	CommandProc *proc;
 	byte flags;
-} Command;
+};
 
 //#define return_cmd_error(errcode) do { _error_message=(errcode); return CMD_ERROR; } while(0)
 #define return_cmd_error(errcode) do { return CMD_ERROR | (errcode); } while (0)
@@ -209,6 +209,6 @@
 
 bool IsValidCommand(uint cmd);
 byte GetCommandFlags(uint cmd);
-int32 GetAvailableMoneyForCommand(void);
+int32 GetAvailableMoneyForCommand();
 
 #endif /* COMMAND_H */
--- a/src/console.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/console.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -46,7 +46,7 @@
  *  end of header  *
  * *************** */
 
-static void IConsoleClearCommand(void)
+static void IConsoleClearCommand()
 {
 	memset(_iconsole_cmdline.buf, 0, ICON_CMDLN_SIZE);
 	_iconsole_cmdline.length = 0;
@@ -56,7 +56,7 @@
 	SetWindowDirty(FindWindowById(WC_CONSOLE, 0));
 }
 
-static inline void IConsoleResetHistoryPos(void) {_iconsole_historypos = ICON_HISTORY_SIZE - 1;}
+static inline void IConsoleResetHistoryPos() {_iconsole_historypos = ICON_HISTORY_SIZE - 1;}
 
 
 static void IConsoleHistoryAdd(const char *cmd);
@@ -207,7 +207,7 @@
 	IConsoleWndProc,
 };
 
-void IConsoleInit(void)
+void IConsoleInit()
 {
 	extern const char _openttd_revision[];
 	_iconsole_output_file = NULL;
@@ -238,7 +238,7 @@
 	IConsoleHistoryAdd("");
 }
 
-void IConsoleClearBuffer(void)
+void IConsoleClearBuffer()
 {
 	uint i;
 	for (i = 0; i <= ICON_BUFFER; i++) {
@@ -247,7 +247,7 @@
 	}
 }
 
-static void IConsoleClear(void)
+static void IConsoleClear()
 {
 	free(_iconsole_cmdline.buf);
 	IConsoleClearBuffer();
@@ -262,7 +262,7 @@
 	}
 }
 
-bool CloseConsoleLogIfActive(void)
+bool CloseConsoleLogIfActive()
 {
 	if (_iconsole_output_file != NULL) {
 		IConsolePrintF(_icolour_def, "file output complete");
@@ -274,7 +274,7 @@
 	return false;
 }
 
-void IConsoleFree(void)
+void IConsoleFree()
 {
 	IConsoleClear();
 	CloseConsoleLogIfActive();
@@ -297,7 +297,7 @@
 	MarkWholeScreenDirty();
 }
 
-void IConsoleSwitch(void)
+void IConsoleSwitch()
 {
 	switch (_iconsole_mode) {
 		case ICONSOLE_CLOSED: {
@@ -317,8 +317,8 @@
 	MarkWholeScreenDirty();
 }
 
-void IConsoleClose(void) {if (_iconsole_mode == ICONSOLE_OPENED) IConsoleSwitch();}
-void IConsoleOpen(void)  {if (_iconsole_mode == ICONSOLE_CLOSED) IConsoleSwitch();}
+void IConsoleClose() {if (_iconsole_mode == ICONSOLE_OPENED) IConsoleSwitch();}
+void IConsoleOpen()  {if (_iconsole_mode == ICONSOLE_CLOSED) IConsoleSwitch();}
 
 /**
  * Add the entered line into the history so you can look it back
--- a/src/console.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/console.h	Mon Mar 19 12:38:16 2007 +0000
@@ -10,7 +10,7 @@
 /* maximum length of a totally expanded command */
 #define ICON_MAX_STREAMSIZE 1024
 
-typedef enum IConsoleVarTypes {
+enum IConsoleVarTypes {
 	ICONSOLE_VAR_BOOLEAN,
 	ICONSOLE_VAR_BYTE,
 	ICONSOLE_VAR_UINT16,
@@ -18,31 +18,31 @@
 	ICONSOLE_VAR_INT16,
 	ICONSOLE_VAR_INT32,
 	ICONSOLE_VAR_STRING
-} IConsoleVarTypes;
+};
 
-typedef enum IConsoleModes {
+enum IConsoleModes {
 	ICONSOLE_FULL,
 	ICONSOLE_OPENED,
 	ICONSOLE_CLOSED
-} IConsoleModes;
+};
 
-typedef enum IConsoleHookTypes {
+enum IConsoleHookTypes {
 	ICONSOLE_HOOK_ACCESS,
 	ICONSOLE_HOOK_PRE_ACTION,
 	ICONSOLE_HOOK_POST_ACTION
-} IConsoleHookTypes;
+};
 
 /** --Hooks--
  * Hooks are certain triggers get get accessed/executed on either
  * access, before execution/change or after execution/change. This allows
  * for general flow of permissions or special action needed in some cases
  */
-typedef bool IConsoleHook(void);
-typedef struct IConsoleHooks{
+typedef bool IConsoleHook();
+struct IConsoleHooks{
 	IConsoleHook *access; ///< trigger when accessing the variable/command
 	IConsoleHook *pre;    ///< trigger before the variable/command is changed/executed
 	IConsoleHook *post;   ///< trigger after the variable/command is changed/executed
-} IConsoleHooks;
+};
 
 /** --Commands--
  * Commands are commands, or functions. They get executed once and any
@@ -53,14 +53,13 @@
  */
 typedef bool (IConsoleCmdProc)(byte argc, char *argv[]);
 
-struct IConsoleCmd;
-typedef struct IConsoleCmd {
+struct IConsoleCmd {
 	char *name;               ///< name of command
-	struct IConsoleCmd *next; ///< next command in list
+	IConsoleCmd *next;        ///< next command in list
 
 	IConsoleCmdProc *proc;    ///< process executed when command is typed
 	IConsoleHooks hook;       ///< any special trigger action that needs executing
-} IConsoleCmd;
+};
 
 /** --Variables--
  * Variables are pointers to real ingame variables which allow for
@@ -71,10 +70,9 @@
  * - '++' to increase value by one
  * - '--' to decrease value by one
  */
-struct IConsoleVar;
-typedef struct IConsoleVar {
+struct IConsoleVar {
 	char *name;               ///< name of the variable
-	struct IConsoleVar *next; ///< next variable in list
+	IConsoleVar *next;        ///< next variable in list
 
 	void *addr;               ///< the address where the variable is pointing at
 	uint32 size;              ///< size of the variable, used for strings
@@ -82,7 +80,7 @@
 	IConsoleVarTypes type;    ///< type of variable (for correct assignment/output)
 	IConsoleCmdProc *proc;    ///< some variables need really special handling, use a callback function for that
 	IConsoleHooks hook;       ///< any special trigger action that needs executing
-} IConsoleVar;
+};
 
 /** --Aliases--
  * Aliases are like shortcuts for complex functions, variable assignments,
@@ -95,13 +93,12 @@
  * - "%!" also lists all parameters but presenting them to the aliased command as one argument
  * - ";" allows for combining commands (see example 'ng')
  */
-struct IConsoleAlias;
-typedef struct IConsoleAlias {
+struct IConsoleAlias {
 	char *name;                 ///< name of the alias
-	struct IConsoleAlias *next; ///< next alias in list
+	IConsoleAlias *next;        ///< next alias in list
 
 	char *cmdline;              ///< command(s) that is/are being aliased
-} IConsoleAlias;
+};
 
 /* console parser */
 VARDEF IConsoleCmd   *_iconsole_cmds;    ///< list of registred commands
@@ -117,13 +114,13 @@
 VARDEF IConsoleModes _iconsole_mode;
 
 /* console functions */
-void IConsoleInit(void);
-void IConsoleFree(void);
-void IConsoleClearBuffer(void);
+void IConsoleInit();
+void IConsoleFree();
+void IConsoleClearBuffer();
 void IConsoleResize(Window *w);
-void IConsoleSwitch(void);
-void IConsoleClose(void);
-void IConsoleOpen(void);
+void IConsoleSwitch();
+void IConsoleClose();
+void IConsoleOpen();
 
 /* console output */
 void IConsolePrint(uint16 color_code, const char *string);
@@ -150,7 +147,7 @@
 void IConsoleVarExec(const IConsoleVar *var, byte tokencount, char *token[]);
 
 /* console std lib (register ingame commands/aliases/variables) */
-void IConsoleStdLibRegister(void);
+void IConsoleStdLibRegister();
 
 /* Hooking code */
 void IConsoleCmdHookAdd(const char *name, IConsoleHookTypes type, IConsoleHook *proc);
--- a/src/console_cmds.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/console_cmds.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -32,7 +32,7 @@
 
 // ** console command / variable defines ** //
 #define DEF_CONSOLE_CMD(function) static bool function(byte argc, char *argv[])
-#define DEF_CONSOLE_HOOK(function) static bool function(void)
+#define DEF_CONSOLE_HOOK(function) static bool function()
 
 
 /* **************************** */
@@ -41,7 +41,7 @@
 
 #ifdef ENABLE_NETWORK
 
-static inline bool NetworkAvailable(void)
+static inline bool NetworkAvailable()
 {
 	if (!_network_available) {
 		IConsoleError("You cannot use this command because there is no network available.");
@@ -141,7 +141,7 @@
 	FOR_ALL_VEHICLES(v) {
 		/* Code ripped from CmdStartStopTrain. Can't call it, because of
 		 * ownership problems, so we'll duplicate some code, for now */
-		if (v->type == VEH_Train)
+		if (v->type == VEH_TRAIN)
 			v->u.rail.days_since_order_progr = 0;
 		v->vehstatus |= VS_STOPPED;
 		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
@@ -175,7 +175,7 @@
 }
 
 extern bool SafeSaveOrLoad(const char *filename, int mode, int newgm);
-extern void BuildFileList(void);
+extern void BuildFileList();
 extern void SetFiosType(const byte fiostype);
 
 /* Save the map to a file */
@@ -499,7 +499,7 @@
 		return true;
 	}
 
-	if (_pause == 0) {
+	if (_pause_game == 0) {
 		DoCommandP(0, 1, 0, NULL, CMD_PAUSE);
 		IConsolePrint(_icolour_def, "Game paused.");
 	} else {
@@ -516,7 +516,7 @@
 		return true;
 	}
 
-	if (_pause != 0) {
+	if (_pause_game != 0) {
 		DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
 		IConsolePrint(_icolour_def, "Game unpaused.");
 	} else {
@@ -544,6 +544,7 @@
 {
 	static const char* const stat_str[] = {
 		"inactive",
+		"authorizing",
 		"authorized",
 		"waiting",
 		"loading map",
@@ -852,7 +853,7 @@
 /* **************************** */
 /*   default console commands   */
 /* **************************** */
-extern bool CloseConsoleLogIfActive(void);
+extern bool CloseConsoleLogIfActive();
 
 DEF_CONSOLE_CMD(ConScript)
 {
@@ -1441,7 +1442,7 @@
 /*  debug commands and variables */
 /* ****************************************** */
 
-static void IConsoleDebugLibRegister(void)
+static void IConsoleDebugLibRegister()
 {
 	/* debugging variables and functions */
 	extern bool _stdlib_con_developer; // XXX extern in .cpp
@@ -1458,7 +1459,7 @@
 /*  console command and variable registration */
 /* ****************************************** */
 
-void IConsoleStdLibRegister(void)
+void IConsoleStdLibRegister()
 {
 	/* stdlib */
 	extern byte _stdlib_developer; // XXX extern in .cpp
--- a/src/currency.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/currency.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -128,7 +128,7 @@
  * get a mask of the allowed currencies depending on the year
  * @return mask of currencies
  */
-uint GetMaskOfAllowedCurrencies(void)
+uint GetMaskOfAllowedCurrencies()
 {
 	uint mask = 0;
 	uint i;
@@ -147,7 +147,7 @@
 /**
  * Verify if the currency chosen by the user is about to be converted to Euro
  **/
-void CheckSwitchToEuro(void)
+void CheckSwitchToEuro()
 {
 	if (_currency_specs[_opt.currency].to_euro != CF_NOEURO &&
 			_currency_specs[_opt.currency].to_euro != CF_ISEURO &&
@@ -161,7 +161,7 @@
  * Called only from newgrf.c.  Will fill _currency_specs array with
  * default values from origin_currency_specs
  **/
-void ResetCurrencies(void)
+void ResetCurrencies()
 {
 	memcpy(&_currency_specs, &origin_currency_specs, sizeof(origin_currency_specs));
 }
@@ -170,10 +170,10 @@
  * Build a list of currency names StringIDs to use in a dropdown list
  * @return Pointer to a (static) array of StringIDs
  */
-StringID* BuildCurrencyDropdown(void)
+StringID* BuildCurrencyDropdown()
 {
 	/* Allow room for all currencies, plus a terminator entry */
-	static StringID names[CUSTOM_CURRENCY_ID];
+	static StringID names[NUM_CURRENCY + 1];
 	uint i;
 
 	/* Add each name */
--- a/src/currency.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/currency.h	Mon Mar 19 12:38:16 2007 +0000
@@ -12,7 +12,7 @@
 	CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1
 };
 
-typedef struct {
+struct CurrencySpec {
 	uint16 rate;
 	char separator;
 	Year to_euro;
@@ -29,7 +29,7 @@
 	 */
 	byte symbol_pos;
 	StringID name;
-} CurrencySpec;
+};
 
 
 extern CurrencySpec _currency_specs[NUM_CURRENCY];
@@ -38,10 +38,10 @@
 #define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID])
 #define _currency ((const CurrencySpec*)&_currency_specs[_opt_ptr->currency])
 
-uint GetMaskOfAllowedCurrencies(void);
-void CheckSwitchToEuro(void);
-void ResetCurrencies(void);
-StringID* BuildCurrencyDropdown(void);
+uint GetMaskOfAllowedCurrencies();
+void CheckSwitchToEuro();
+void ResetCurrencies();
+StringID* BuildCurrencyDropdown();
 byte GetNewgrfCurrencyIdConverted(byte grfcurr_id);
 
 #endif /* CURRENCY_H */
--- a/src/date.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/date.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -179,24 +179,24 @@
 	OnNewDay_DisasterVehicle,
 };
 
-extern void WaypointsDailyLoop(void);
-extern void TextMessageDailyLoop(void);
-extern void EnginesDailyLoop(void);
-extern void DisasterDailyLoop(void);
+extern void WaypointsDailyLoop();
+extern void TextMessageDailyLoop();
+extern void EnginesDailyLoop();
+extern void DisasterDailyLoop();
 
-extern void PlayersMonthlyLoop(void);
-extern void EnginesMonthlyLoop(void);
-extern void TownsMonthlyLoop(void);
-extern void IndustryMonthlyLoop(void);
-extern void StationMonthlyLoop(void);
+extern void PlayersMonthlyLoop();
+extern void EnginesMonthlyLoop();
+extern void TownsMonthlyLoop();
+extern void IndustryMonthlyLoop();
+extern void StationMonthlyLoop();
 
-extern void PlayersYearlyLoop(void);
-extern void TrainsYearlyLoop(void);
-extern void RoadVehiclesYearlyLoop(void);
-extern void AircraftYearlyLoop(void);
-extern void ShipsYearlyLoop(void);
+extern void PlayersYearlyLoop();
+extern void TrainsYearlyLoop();
+extern void RoadVehiclesYearlyLoop();
+extern void AircraftYearlyLoop();
+extern void ShipsYearlyLoop();
 
-extern void ShowEndGameChart(void);
+extern void ShowEndGameChart();
 
 
 static const Month _autosave_months[] = {
@@ -222,7 +222,7 @@
 	}
 }
 
-void IncreaseDate(void)
+void IncreaseDate()
 {
 	YearMonthDay ymd;
 
--- a/src/date.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/date.h	Mon Mar 19 12:38:16 2007 +0000
@@ -44,11 +44,11 @@
 typedef uint8  Day;
 typedef uint16 DateFract;
 
-typedef struct YearMonthDay {
+struct YearMonthDay {
 	Year  year;
 	Month month;
 	Day   day;
-} YearMonthDay;
+};
 
 extern Year      _cur_year;
 extern Month     _cur_month;
--- a/src/debug.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/debug.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -34,10 +34,10 @@
 int _debug_eco_level;
 
 
-typedef struct DebugLevel {
+struct DebugLevel {
 	const char *name;
 	int *level;
-} DebugLevel;
+};
 
 #define DEBUG_LEVEL(x) { #x, &_debug_##x##_level }
 	static const DebugLevel debug_level[] = {
@@ -155,7 +155,7 @@
  * Just return a string with the values of all the debug categorites
  * @return string with debug-levels
  */
-const char *GetDebugString(void)
+const char *GetDebugString()
 {
 	const DebugLevel *i;
 	static char dbgstr[100];
--- a/src/debug.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/debug.h	Mon Mar 19 12:38:16 2007 +0000
@@ -88,7 +88,7 @@
 #endif /* NO_DEBUG_MESSAGES */
 
 void SetDebugString(const char *s);
-const char *GetDebugString(void);
+const char *GetDebugString();
 
 /* MSVCRT of course has to have a different syntax for long long *sigh* */
 #if defined(_MSC_VER) || defined(__MINGW32__)
@@ -99,7 +99,7 @@
 
 /* Used for profiling */
 #define TIC() {\
-	extern uint64 _rdtsc(void);\
+	extern uint64 _rdtsc();\
 	uint64 _xxx_ = _rdtsc();\
 	static uint64 __sum__ = 0;\
 	static uint32 __i__ = 0;
--- a/src/dedicated.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/dedicated.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -14,7 +14,15 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-void DedicatedFork(void)
+#if defined(SUNOS) && !defined(_LP64) && !defined(_I32LPx)
+/* Solaris has, in certain situation, pid_t defined as long, while in other
+ *  cases it has it defined as int... this handles all cases nicely. */
+# define PRINTF_PID_T "%ld"
+#else
+# define PRINTF_PID_T "%d"
+#endif
+
+void DedicatedFork()
 {
 	/* Fork the program */
 	pid_t pid = fork();
@@ -47,7 +55,7 @@
 		default:
 			/* We're the parent */
 			printf("Loading dedicated server...\n");
-			printf("  - Forked to background with pid %d\n", pid);
+			printf("  - Forked to background with pid " PRINTF_PID_T "\n", pid);
 			exit(0);
 	}
 }
@@ -55,6 +63,6 @@
 
 #else
 
-void DedicatedFork(void) {}
+void DedicatedFork() {}
 
 #endif /* ENABLE_NETWORK */
--- a/src/depot.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/depot.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -47,7 +47,7 @@
 /**
  * Allocate a new depot
  */
-Depot *AllocateDepot(void)
+Depot *AllocateDepot()
 {
 	Depot *d;
 
@@ -85,7 +85,7 @@
 	DeleteWindowById(WC_VEHICLE_DEPOT, depot->xy);
 }
 
-void InitializeDepots(void)
+void InitializeDepots()
 {
 	CleanPool(&_Depot_pool);
 	AddBlockToPool(&_Depot_pool);
@@ -99,7 +99,7 @@
 	SLE_END()
 };
 
-static void Save_DEPT(void)
+static void Save_DEPT()
 {
 	Depot *depot;
 
@@ -109,7 +109,7 @@
 	}
 }
 
-static void Load_DEPT(void)
+static void Load_DEPT()
 {
 	int index;
 
--- a/src/depot.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/depot.h	Mon Mar 19 12:38:16 2007 +0000
@@ -107,8 +107,8 @@
 }
 
 Depot *GetDepotByTile(TileIndex tile);
-void InitializeDepots(void);
-Depot *AllocateDepot(void);
+void InitializeDepots();
+Depot *AllocateDepot();
 
 void DeleteDepotHighlightOfVehicle(const Vehicle *v);
 
--- a/src/depot_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/depot_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -133,20 +133,20 @@
 {
 	if (!success) return;
 	switch(GetVehicle(p1)->type) {
-		case VEH_Train:    CcCloneTrain(   true, tile, p1, p2); break;
-		case VEH_Road:     CcCloneRoadVeh( true, tile, p1, p2); break;
-		case VEH_Ship:     CcCloneShip(    true, tile, p1, p2); break;
-		case VEH_Aircraft: CcCloneAircraft(true, tile, p1, p2); break;
+		case VEH_TRAIN:    CcCloneTrain(   true, tile, p1, p2); break;
+		case VEH_ROAD:     CcCloneRoadVeh( true, tile, p1, p2); break;
+		case VEH_SHIP:     CcCloneShip(    true, tile, p1, p2); break;
+		case VEH_AIRCRAFT: CcCloneAircraft(true, tile, p1, p2); break;
 	}
 }
 
 static inline void ShowVehicleViewWindow(const Vehicle *v)
 {
 	switch (v->type) {
-		case VEH_Train:    ShowTrainViewWindow(v);    break;
-		case VEH_Road:     ShowRoadVehViewWindow(v);  break;
-		case VEH_Ship:     ShowShipViewWindow(v);     break;
-		case VEH_Aircraft: ShowAircraftViewWindow(v); break;
+		case VEH_TRAIN:    ShowTrainViewWindow(v);    break;
+		case VEH_ROAD:     ShowRoadVehViewWindow(v);  break;
+		case VEH_SHIP:     ShowShipViewWindow(v);     break;
+		case VEH_AIRCRAFT: ShowAircraftViewWindow(v); break;
 		default: NOT_REACHED();
 	}
 }
@@ -175,7 +175,7 @@
 	int sprite_y = y + w->resize.step_height - GetVehicleListHeight(v->type);
 
 	switch (v->type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			DrawTrainImage(v, x + 21, sprite_y, w->widget[DEPOT_WIDGET_MATRIX].right - 32, w->hscroll.pos, WP(w,depot_d).sel);
 
 			/* Number of wagons relative to a standard length wagon (rounded up) */
@@ -183,9 +183,9 @@
 			DrawStringRightAligned(w->widget[DEPOT_WIDGET_MATRIX].right - 1, y + 4, STR_TINY_BLACK, 0); // Draw the counter
 			break;
 
-		case VEH_Road:     DrawRoadVehImage( v, x + 24, sprite_y, WP(w, depot_d).sel); break;
-		case VEH_Ship:     DrawShipImage(    v, x + 19, sprite_y - 1, WP(w, depot_d).sel); break;
-		case VEH_Aircraft: {
+		case VEH_ROAD:     DrawRoadVehImage( v, x + 24, sprite_y, WP(w, depot_d).sel); break;
+		case VEH_SHIP:     DrawShipImage(    v, x + 19, sprite_y - 1, WP(w, depot_d).sel); break;
+		case VEH_AIRCRAFT: {
 			const Sprite *spr = GetSprite(GetAircraftImage(v, DIR_W));
 			DrawAircraftImage(v, x + 12,
 							  y + max(spr->height + spr->y_offs - 14, 0), // tall sprites needs an y offset
@@ -195,10 +195,10 @@
 	}
 
 	if (w->resize.step_height == 14) {
-		/* VEH_Train and VEH_Road, which are low */
+		/* VEH_TRAIN and VEH_ROAD, which are low */
 		diff_x = 15;
 	} else {
-		/* VEH_Ship and VEH_Aircraft, which are tall */
+		/* VEH_SHIP and VEH_AIRCRAFT, which are tall */
 		diff_y = 12;
 	}
 
@@ -233,7 +233,7 @@
 		WIDGET_LIST_END);
 
 	/* determine amount of items for scroller */
-	if (WP(w, depot_d).type == VEH_Train) {
+	if (WP(w, depot_d).type == VEH_TRAIN) {
 		hnum = 8;
 		for (num = 0; num < WP(w, depot_d).engine_count; num++) {
 			const Vehicle *v = vl[num];
@@ -247,7 +247,7 @@
 	}
 
 	/* locate the depot struct */
-	if (WP(w, depot_d).type == VEH_Aircraft) {
+	if (WP(w, depot_d).type == VEH_AIRCRAFT) {
 		SetDParam(0, GetStationIndex(tile)); // Airport name
 	} else {
 		Depot *depot = GetDepotByTile(tile);
@@ -290,10 +290,10 @@
 	}
 }
 
-typedef struct GetDepotVehiclePtData {
+struct GetDepotVehiclePtData {
 	Vehicle *head;
 	Vehicle *wagon;
-} GetDepotVehiclePtData;
+};
 
 enum {
 	MODE_ERROR        =  1,
@@ -309,7 +309,7 @@
 	int pos, skip = 0;
 	uint16 boxes_in_each_row = w->widget[DEPOT_WIDGET_MATRIX].data & 0xFF;
 
-	if (WP(w, depot_d).type == VEH_Train) {
+	if (WP(w, depot_d).type == VEH_TRAIN) {
 		xt = 0;
 		x -= 23;
 	} else {
@@ -326,7 +326,7 @@
 	pos = ((row + w->vscroll.pos) * boxes_in_each_row) + xt;
 
 	if (WP(w, depot_d).engine_count + WP(w, depot_d).wagon_count <= pos) {
-		if (WP(w, depot_d).type == VEH_Train) {
+		if (WP(w, depot_d).type == VEH_TRAIN) {
 			d->head  = NULL;
 			d->wagon = NULL;
 			return MODE_DRAG_VEHICLE;
@@ -347,7 +347,7 @@
 	}
 
 	switch (WP(w, depot_d).type) {
-		case VEH_Train: {
+		case VEH_TRAIN: {
 			Vehicle *v = *veh;
 			d->head = d->wagon = v;
 
@@ -372,17 +372,17 @@
 			}
 			break;
 
-		case VEH_Road:
+		case VEH_ROAD:
 			if (xm >= 24) return MODE_DRAG_VEHICLE;
 			if (xm <= 16) return MODE_SHOW_VEHICLE;
 			break;
 
-		case VEH_Ship:
+		case VEH_SHIP:
 			if (xm >= 19) return MODE_DRAG_VEHICLE;
 			if (ym <= 10) return MODE_SHOW_VEHICLE;
 			break;
 
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			if (xm >= 12) return MODE_DRAG_VEHICLE;
 			if (ym <= 12) return MODE_SHOW_VEHICLE;
 			break;
@@ -420,11 +420,11 @@
 
 	/* share / copy orders */
 	if (_thd.place_mode && mode <= 0) {
-		_place_clicked_vehicle = (WP(w, depot_d).type == VEH_Train ? gdvp.head : v);
+		_place_clicked_vehicle = (WP(w, depot_d).type == VEH_TRAIN ? gdvp.head : v);
 		return;
 	}
 
-	if (WP(w, depot_d).type == VEH_Train) v = gdvp.wagon;
+	if (WP(w, depot_d).type == VEH_TRAIN) v = gdvp.wagon;
 
 	switch (mode) {
 		case MODE_ERROR: // invalid
@@ -433,17 +433,17 @@
 		case MODE_DRAG_VEHICLE: { // start dragging of vehicle
 			VehicleID sel = WP(w, depot_d).sel;
 
-			if (WP(w, depot_d).type == VEH_Train && sel != INVALID_VEHICLE) {
+			if (WP(w, depot_d).type == VEH_TRAIN && sel != INVALID_VEHICLE) {
 				WP(w,depot_d).sel = INVALID_VEHICLE;
 				TrainDepotMoveVehicle(v, sel, gdvp.head);
 			} else if (v != NULL) {
 				int image;
 
 				switch (WP(w, depot_d).type) {
-					case VEH_Train:    image = GetTrainImage(v, DIR_W);    break;
-					case VEH_Road:     image = GetRoadVehImage(v, DIR_W);  break;
-					case VEH_Ship:     image = GetShipImage(v, DIR_W);     break;
-					case VEH_Aircraft: image = GetAircraftImage(v, DIR_W); break;
+					case VEH_TRAIN:    image = GetTrainImage(v, DIR_W);    break;
+					case VEH_ROAD:     image = GetRoadVehImage(v, DIR_W);  break;
+					case VEH_SHIP:     image = GetShipImage(v, DIR_W);     break;
+					case VEH_AIRCRAFT: image = GetAircraftImage(v, DIR_W); break;
 					default: NOT_REACHED(); image = 0;
 				}
 
@@ -462,10 +462,10 @@
 			uint command;
 
 			switch (WP(w, depot_d).type) {
-				case VEH_Train:    command = CMD_START_STOP_TRAIN | CMD_MSG(STR_883B_CAN_T_STOP_START_TRAIN);          break;
-				case VEH_Road:     command = CMD_START_STOP_ROADVEH | CMD_MSG(STR_9015_CAN_T_STOP_START_ROAD_VEHICLE); break;
-				case VEH_Ship:     command = CMD_START_STOP_SHIP | CMD_MSG(STR_9818_CAN_T_STOP_START_SHIP);            break;
-				case VEH_Aircraft: command = CMD_START_STOP_AIRCRAFT | CMD_MSG(STR_A016_CAN_T_STOP_START_AIRCRAFT);    break;
+				case VEH_TRAIN:    command = CMD_START_STOP_TRAIN | CMD_MSG(STR_883B_CAN_T_STOP_START_TRAIN);          break;
+				case VEH_ROAD:     command = CMD_START_STOP_ROADVEH | CMD_MSG(STR_9015_CAN_T_STOP_START_ROAD_VEHICLE); break;
+				case VEH_SHIP:     command = CMD_START_STOP_SHIP | CMD_MSG(STR_9818_CAN_T_STOP_START_SHIP);            break;
+				case VEH_AIRCRAFT: command = CMD_START_STOP_AIRCRAFT | CMD_MSG(STR_A016_CAN_T_STOP_START_AIRCRAFT);    break;
 				default: NOT_REACHED(); command = 0;
 			}
 			DoCommandP(v->tile, v->index, 0, NULL, command);
@@ -487,17 +487,17 @@
 
 	if (v == NULL) return;
 
-	if (v->type == VEH_Train && !IsFrontEngine(v)) {
+	if (v->type == VEH_TRAIN && !IsFrontEngine(v)) {
 		v = GetFirstVehicleInChain(v);
 		/* Do nothing when clicking on a train in depot with no loc attached */
 		if (!IsFrontEngine(v)) return;
 	}
 
 	switch (v->type) {
-		case VEH_Train:    error_str = CMD_MSG(STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE); break;
-		case VEH_Road:     error_str = CMD_MSG(STR_9009_CAN_T_BUILD_ROAD_VEHICLE);     break;
-		case VEH_Ship:     error_str = CMD_MSG(STR_980D_CAN_T_BUILD_SHIP);             break;
-		case VEH_Aircraft: error_str = CMD_MSG(STR_A008_CAN_T_BUILD_AIRCRAFT);         break;
+		case VEH_TRAIN:    error_str = CMD_MSG(STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE); break;
+		case VEH_ROAD:     error_str = CMD_MSG(STR_9009_CAN_T_BUILD_ROAD_VEHICLE);     break;
+		case VEH_SHIP:     error_str = CMD_MSG(STR_980D_CAN_T_BUILD_SHIP);             break;
+		case VEH_AIRCRAFT: error_str = CMD_MSG(STR_A008_CAN_T_BUILD_AIRCRAFT);         break;
 		default: return;
 	}
 
@@ -517,7 +517,7 @@
 {
 	ResizeButtons(w, DEPOT_WIDGET_BUILD, DEPOT_WIDGET_LOCATION);
 
-	if (WP(w, depot_d).type == VEH_Train) {
+	if (WP(w, depot_d).type == VEH_TRAIN) {
 		/* Divide the size of DEPOT_WIDGET_SELL into two equally big buttons so DEPOT_WIDGET_SELL and DEPOT_WIDGET_SELL_CHAIN will get the same size.
 		* This way it will stay the same even if DEPOT_WIDGET_SELL_CHAIN is resized for some reason                                                  */
 		w->widget[DEPOT_WIDGET_SELL_CHAIN].top    = ((w->widget[DEPOT_WIDGET_SELL_CHAIN].bottom - w->widget[DEPOT_WIDGET_SELL].top) / 2) + w->widget[DEPOT_WIDGET_SELL].top;
@@ -532,7 +532,7 @@
 static void SetupStringsForDepotWindow(Window *w, byte type)
 {
 	switch (type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			w->widget[DEPOT_WIDGET_CAPTION].data      = STR_8800_TRAIN_DEPOT;
 			w->widget[DEPOT_WIDGET_STOP_ALL].tooltips = STR_MASS_STOP_DEPOT_TRAIN_TIP;
 			w->widget[DEPOT_WIDGET_START_ALL].tooltips=	STR_MASS_START_DEPOT_TRAIN_TIP;
@@ -556,7 +556,7 @@
 			w->widget[DEPOT_WIDGET_AUTOREPLACE].data = SPR_REPLACE_TRAIN;
 			break;
 
-		case VEH_Road:
+		case VEH_ROAD:
 			w->widget[DEPOT_WIDGET_CAPTION].data      = STR_9003_ROAD_VEHICLE_DEPOT;
 			w->widget[DEPOT_WIDGET_STOP_ALL].tooltips = STR_MASS_STOP_DEPOT_ROADVEH_TIP;
 			w->widget[DEPOT_WIDGET_START_ALL].tooltips=	STR_MASS_START_DEPOT_ROADVEH_TIP;
@@ -580,7 +580,7 @@
 			w->widget[DEPOT_WIDGET_AUTOREPLACE].data = SPR_REPLACE_ROADVEH;
 			break;
 
-		case VEH_Ship:
+		case VEH_SHIP:
 			w->widget[DEPOT_WIDGET_CAPTION].data      = STR_9803_SHIP_DEPOT;
 			w->widget[DEPOT_WIDGET_STOP_ALL].tooltips = STR_MASS_STOP_DEPOT_SHIP_TIP;
 			w->widget[DEPOT_WIDGET_START_ALL].tooltips=	STR_MASS_START_DEPOT_SHIP_TIP;
@@ -604,7 +604,7 @@
 			w->widget[DEPOT_WIDGET_AUTOREPLACE].data = SPR_REPLACE_SHIP;
 			break;
 
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			w->widget[DEPOT_WIDGET_CAPTION].data      = STR_A002_AIRCRAFT_HANGAR;
 			w->widget[DEPOT_WIDGET_STOP_ALL].tooltips = STR_MASS_STOP_HANGAR_TIP;
 			w->widget[DEPOT_WIDGET_START_ALL].tooltips=	STR_MASS_START_HANGAR_TIP;
@@ -638,22 +638,22 @@
 /* Array to hold the default resize capacities
 * First part is the vehicle type, while the last is 0 = x, 1 = y */
 const uint _resize_cap[][2] = {
-/* VEH_Train */    {6, 10 * 29 + 36}, ///< flags, unitnumber and unit count uses a total of 36 pixels and we set default to 10 units
-/* VEH_Road */     {5, 5},
-/* VEH_Ship */     {3, 3},
-/* VEH_Aircraft */ {3, 4},
+/* VEH_TRAIN */    {6, 10 * 29 + 36}, ///< flags, unitnumber and unit count uses a total of 36 pixels and we set default to 10 units
+/* VEH_ROAD */     {5, 5},
+/* VEH_SHIP */     {3, 3},
+/* VEH_AIRCRAFT */ {3, 4},
 };
 
 static void ResizeDefaultWindowSizeForTrains()
 {
-	_block_sizes[VEH_Train][0] = 1;
-	_block_sizes[VEH_Train][1] = GetVehicleListHeight(VEH_Train);
+	_block_sizes[VEH_TRAIN][0] = 1;
+	_block_sizes[VEH_TRAIN][1] = GetVehicleListHeight(VEH_TRAIN);
 }
 
 static void ResizeDefaultWindowSizeForRoadVehicles()
 {
-	_block_sizes[VEH_Road][0] = 56;
-	_block_sizes[VEH_Road][1] = GetVehicleListHeight(VEH_Road);
+	_block_sizes[VEH_ROAD][0] = 56;
+	_block_sizes[VEH_ROAD][1] = GetVehicleListHeight(VEH_ROAD);
 }
 
 static void ResizeDefaultWindowSize(byte type)
@@ -667,8 +667,8 @@
 
 		switch (type) {
 			default: NOT_REACHED();
-			case VEH_Ship:     GetShipSpriteSize(    engine, x, y); break;
-			case VEH_Aircraft: GetAircraftSpriteSize(engine, x, y); break;
+			case VEH_SHIP:     GetShipSpriteSize(    engine, x, y); break;
+			case VEH_AIRCRAFT: GetAircraftSpriteSize(engine, x, y); break;
 		}
 		if (x > max_width)  max_width  = x;
 		if (y > max_height) max_height = y;
@@ -676,11 +676,11 @@
 
 	switch (type) {
 		default: NOT_REACHED();
-		case VEH_Ship:
-			_block_sizes[VEH_Ship][0] = max(90U, max_width + 20); // we need 20 pixels from the right edge to the sprite
+		case VEH_SHIP:
+			_block_sizes[VEH_SHIP][0] = max(90U, max_width + 20); // we need 20 pixels from the right edge to the sprite
 			break;
-		case VEH_Aircraft:
-			_block_sizes[VEH_Aircraft][0] = max(74U, max_width);
+		case VEH_AIRCRAFT:
+			_block_sizes[VEH_AIRCRAFT][0] = max(74U, max_width);
 			break;
 	}
 	_block_sizes[type][1] = max(GetVehicleListHeight(type), max_height);
@@ -692,8 +692,8 @@
 {
 	ResizeDefaultWindowSizeForTrains();
 	ResizeDefaultWindowSizeForRoadVehicles();
-	ResizeDefaultWindowSize(VEH_Ship);
-	ResizeDefaultWindowSize(VEH_Aircraft);
+	ResizeDefaultWindowSize(VEH_SHIP);
+	ResizeDefaultWindowSize(VEH_AIRCRAFT);
 }
 
 static void CreateDepotListWindow(Window *w, byte type)
@@ -718,7 +718,7 @@
 				 _block_sizes[type][0] * w->hscroll.cap,
 				 _block_sizes[type][1] * w->vscroll.cap);
 
-	if (type == VEH_Train) {
+	if (type == VEH_TRAIN) {
 		/* The train depot has a horizontal scroller so we should make room for it */
 		ResizeWindow(w, 0, 12);
 		/* substract the newly added space from the matrix since it was meant for the scrollbar */
@@ -733,10 +733,10 @@
 
 	w->widget[DEPOT_WIDGET_MATRIX].data =
 		(w->vscroll.cap * 0x100) // number of rows to draw on the background
-		+ (type == VEH_Train ? 1 : w->hscroll.cap); // number of boxes in each row. Trains always have just one
+		+ (type == VEH_TRAIN ? 1 : w->hscroll.cap); // number of boxes in each row. Trains always have just one
 
 
-	SetWindowWidgetsHiddenState(w, type != VEH_Train,
+	SetWindowWidgetsHiddenState(w, type != VEH_TRAIN,
 		DEPOT_WIDGET_H_SCROLL,
 		DEPOT_WIDGET_SELL_CHAIN,
 		WIDGET_LIST_END);
@@ -841,7 +841,7 @@
 						TileIndex tile = w->window_number;
 						byte vehtype = WP(w, depot_d).type;
 
-						SetDParam(0, (vehtype == VEH_Aircraft) ? GetStationIndex(tile) : GetDepotByTile(tile)->town_index);
+						SetDParam(0, (vehtype == VEH_AIRCRAFT) ? GetStationIndex(tile) : GetDepotByTile(tile)->town_index);
 						ShowQuery(
 							confirm_captions[vehtype],
 							STR_DEPOT_SELL_CONFIRMATION_TEXT,
@@ -897,7 +897,7 @@
 					WP(w, depot_d).sel = INVALID_VEHICLE;
 					SetWindowDirty(w);
 
-					if (WP(w, depot_d).type == VEH_Train) {
+					if (WP(w, depot_d).type == VEH_TRAIN) {
 						GetDepotVehiclePtData gdvp;
 
 						if (GetVehicleFromDepotWndPt(w, e->we.dragdrop.pt.x, e->we.dragdrop.pt.y, &v, &gdvp) == MODE_DRAG_VEHICLE &&
@@ -934,9 +934,9 @@
 						WP(w, depot_d).sel = INVALID_VEHICLE;
 						SetWindowDirty(w);
 
-						sell_cmd = (v->type == VEH_Train && (e->we.click.widget == DEPOT_WIDGET_SELL_CHAIN || _ctrl_pressed)) ? 1 : 0;
+						sell_cmd = (v->type == VEH_TRAIN && (e->we.click.widget == DEPOT_WIDGET_SELL_CHAIN || _ctrl_pressed)) ? 1 : 0;
 
-						is_engine = (!(v->type == VEH_Train && !IsFrontEngine(v)));
+						is_engine = (!(v->type == VEH_TRAIN && !IsFrontEngine(v)));
 
 						if (is_engine) {
 							_backup_orders_tile = v->tile;
@@ -944,10 +944,10 @@
 						}
 
 						switch (v->type) {
-							case VEH_Train:    command = CMD_SELL_RAIL_WAGON | CMD_MSG(STR_8839_CAN_T_SELL_RAILROAD_VEHICLE); break;
-							case VEH_Road:     command = CMD_SELL_ROAD_VEH | CMD_MSG(STR_9014_CAN_T_SELL_ROAD_VEHICLE);       break;
-							case VEH_Ship:     command = CMD_SELL_SHIP | CMD_MSG(STR_980C_CAN_T_SELL_SHIP);                   break;
-							case VEH_Aircraft: command = CMD_SELL_AIRCRAFT | CMD_MSG(STR_A01C_CAN_T_SELL_AIRCRAFT);           break;
+							case VEH_TRAIN:    command = CMD_SELL_RAIL_WAGON | CMD_MSG(STR_8839_CAN_T_SELL_RAILROAD_VEHICLE); break;
+							case VEH_ROAD:     command = CMD_SELL_ROAD_VEH | CMD_MSG(STR_9014_CAN_T_SELL_ROAD_VEHICLE);       break;
+							case VEH_SHIP:     command = CMD_SELL_SHIP | CMD_MSG(STR_980C_CAN_T_SELL_SHIP);                   break;
+							case VEH_AIRCRAFT: command = CMD_SELL_AIRCRAFT | CMD_MSG(STR_A01C_CAN_T_SELL_AIRCRAFT);           break;
 							default: NOT_REACHED(); command = 0;
 						}
 
@@ -963,7 +963,7 @@
 		case WE_RESIZE:
 			w->vscroll.cap += e->we.sizing.diff.y / (int)w->resize.step_height;
 			w->hscroll.cap += e->we.sizing.diff.x / (int)w->resize.step_width;
-			w->widget[DEPOT_WIDGET_MATRIX].data = (w->vscroll.cap << 8) + (WP(w, depot_d).type == VEH_Train ? 1 : w->hscroll.cap);
+			w->widget[DEPOT_WIDGET_MATRIX].data = (w->vscroll.cap << 8) + (WP(w, depot_d).type == VEH_TRAIN ? 1 : w->hscroll.cap);
 			ResizeDepotButtons(w);
 			break;
 	}
@@ -979,13 +979,13 @@
 
 	switch (type) {
 		default: NOT_REACHED();
-		case VEH_Train:
+		case VEH_TRAIN:
 			w = AllocateWindowDescFront(&_train_depot_desc, tile); break;
-		case VEH_Road:
+		case VEH_ROAD:
 			w = AllocateWindowDescFront(&_road_depot_desc, tile); break;
-		case VEH_Ship:
+		case VEH_SHIP:
 			w = AllocateWindowDescFront(&_ship_depot_desc, tile); break;
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			w = AllocateWindowDescFront(&_aircraft_depot_desc, tile); break;
 	}
 
--- a/src/direction.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/direction.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,7 +8,7 @@
 #include "helpers.hpp"
 
 /* Direction as commonly used in v->direction, 8 way. */
-typedef enum Direction {
+enum Direction {
 	DIR_BEGIN = 0,
 	DIR_N   = 0,
 	DIR_NE  = 1,      ///< Northeast, upper right on your monitor
@@ -20,7 +20,7 @@
 	DIR_NW  = 7,
 	DIR_END,
 	INVALID_DIR = 0xFF,
-} Direction;
+};
 
 /** Define basic enum properties */
 template <> struct EnumPropsT<Direction> : MakeEnumPropsT<Direction, byte, DIR_BEGIN, DIR_END, INVALID_DIR> {};
@@ -32,14 +32,14 @@
 }
 
 
-typedef enum DirDiff {
+enum DirDiff {
 	DIRDIFF_SAME    = 0,
 	DIRDIFF_45RIGHT = 1,
 	DIRDIFF_90RIGHT = 2,
 	DIRDIFF_REVERSE = 4,
 	DIRDIFF_90LEFT  = 6,
 	DIRDIFF_45LEFT  = 7
-} DirDiff;
+};
 
 static inline DirDiff DirDifference(Direction d0, Direction d1)
 {
@@ -59,7 +59,7 @@
 
 
 /* Direction commonly used as the direction of entering and leaving tiles, 4-way */
-typedef enum DiagDirection {
+enum DiagDirection {
 	DIAGDIR_BEGIN = 0,
 	DIAGDIR_NE  = 0,      ///< Northeast, upper right on your monitor
 	DIAGDIR_SE  = 1,
@@ -67,7 +67,7 @@
 	DIAGDIR_NW  = 3,
 	DIAGDIR_END,
 	INVALID_DIAGDIR = 0xFF,
-} DiagDirection;
+};
 
 DECLARE_POSTFIX_INCREMENT(DiagDirection);
 
@@ -81,12 +81,12 @@
 }
 
 
-typedef enum DiagDirDiff {
+enum DiagDirDiff {
 	DIAGDIRDIFF_SAME    = 0,
 	DIAGDIRDIFF_90RIGHT = 1,
 	DIAGDIRDIFF_REVERSE = 2,
 	DIAGDIRDIFF_90LEFT  = 3
-} DiagDirDiff;
+};
 
 static inline DiagDirection ChangeDiagDir(DiagDirection d, DiagDirDiff delta)
 {
@@ -107,11 +107,11 @@
 
 
 /* the 2 axis */
-typedef enum Axis {
+enum Axis {
 	AXIS_X = 0,
 	AXIS_Y = 1,
 	AXIS_END
-} Axis;
+};
 
 
 static inline Axis OtherAxis(Axis a)
--- a/src/disaster_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/disaster_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -116,11 +116,11 @@
 }
 
 
-/** Initialize a disaster vehicle. These vehicles are of type VEH_Disaster, are unclickable
+/** Initialize a disaster vehicle. These vehicles are of type VEH_DISASTER, are unclickable
  * and owned by nobody */
 static void InitializeDisasterVehicle(Vehicle *v, int x, int y, byte z, Direction direction, byte subtype)
 {
-	v->type = VEH_Disaster;
+	v->type = VEH_DISASTER;
 	v->x_pos = x;
 	v->y_pos = y;
 	v->z_pos = z;
@@ -135,9 +135,7 @@
 	v->owner = OWNER_NONE;
 	v->vehstatus = VS_UNCLICKABLE;
 	v->u.disaster.image_override = 0;
-	v->current_order.type = OT_NOTHING;
-	v->current_order.flags = 0;
-	v->current_order.dest = 0;
+	v->current_order.Free();
 
 	DisasterVehicleUpdateImage(v);
 	VehiclePositionChanged(v);
@@ -330,7 +328,7 @@
 		v->current_order.dest = 1;
 
 		FOR_ALL_VEHICLES(u) {
-			if (u->type == VEH_Road && IsHumanPlayer(u->owner)) {
+			if (u->type == VEH_ROAD && IsHumanPlayer(u->owner)) {
 				v->dest_tile = u->index;
 				v->age = 0;
 				return;
@@ -341,7 +339,7 @@
 	} else {
 		/* Target a vehicle */
 		u = GetVehicle(v->dest_tile);
-		if (u->type != VEH_Road) {
+		if (u->type != VEH_ROAD) {
 			DeleteDisasterVeh(v);
 			return;
 		}
@@ -590,7 +588,7 @@
 		v->current_order.dest = 2;
 
 		FOR_ALL_VEHICLES(u) {
-			if (u->type == VEH_Train || u->type == VEH_Road) {
+			if (u->type == VEH_TRAIN || u->type == VEH_ROAD) {
 				if (delta(u->x_pos, v->x_pos) + delta(u->y_pos, v->y_pos) <= 12 * TILE_SIZE) {
 					u->breakdown_ctr = 5;
 					u->breakdown_delay = 0xF0;
@@ -758,12 +756,12 @@
 	// not used
 }
 
-typedef void DisasterInitProc(void);
+typedef void DisasterInitProc();
 
 
 /** Zeppeliner which crashes on a small airport if one found,
  * otherwise crashes on a random tile */
-static void Disaster_Zeppeliner_Init(void)
+static void Disaster_Zeppeliner_Init()
 {
 	Vehicle *v = ForceAllocateSpecialVehicle(), *u;
 	Station *st;
@@ -797,7 +795,7 @@
 
 /** Ufo which flies around aimlessly from the middle of the map a bit
  * until it locates a road vehicle which it targets and then destroys */
-static void Disaster_Small_Ufo_Init(void)
+static void Disaster_Small_Ufo_Init()
 {
 	Vehicle *v = ForceAllocateSpecialVehicle(), *u;
 	int x;
@@ -821,7 +819,7 @@
 
 
 /* Combat airplane which destroys an oil refinery */
-static void Disaster_Airplane_Init(void)
+static void Disaster_Airplane_Init()
 {
 	Industry *i, *found;
 	Vehicle *v, *u;
@@ -857,7 +855,7 @@
 
 
 /** Combat helicopter that destroys a factory */
-static void Disaster_Helicopter_Init(void)
+static void Disaster_Helicopter_Init()
 {
 	Industry *i, *found;
 	Vehicle *v, *u, *w;
@@ -899,7 +897,7 @@
 
 /* Big Ufo which lands on a piece of rail and will consequently be shot
  * down by a combat airplane, destroying the surroundings */
-static void Disaster_Big_Ufo_Init(void)
+static void Disaster_Big_Ufo_Init()
 {
 	Vehicle *v = ForceAllocateSpecialVehicle(), *u;
 	int x, y;
@@ -924,7 +922,7 @@
 
 
 /* Curious submarine #1, just floats around */
-static void Disaster_Small_Submarine_Init(void)
+static void Disaster_Small_Submarine_Init()
 {
 	Vehicle *v = ForceAllocateSpecialVehicle();
 	int x, y;
@@ -949,7 +947,7 @@
 
 
 /* Curious submarine #2, just floats around */
-static void Disaster_Big_Submarine_Init(void)
+static void Disaster_Big_Submarine_Init()
 {
 	Vehicle *v = ForceAllocateSpecialVehicle();
 	int x,y;
@@ -975,7 +973,7 @@
 
 /** Coal mine catastrophe, destroys a stretch of 30 tiles of
  * land in a certain direction */
-static void Disaster_CoalMine_Init(void)
+static void Disaster_CoalMine_Init()
 {
 	int index = GB(Random(), 0, 4);
 	uint m;
@@ -1031,7 +1029,7 @@
 };
 
 
-static void DoDisaster(void)
+static void DoDisaster()
 {
 	byte buf[lengthof(_dis_years)];
 	uint i;
@@ -1048,12 +1046,12 @@
 }
 
 
-static void ResetDisasterDelay(void)
+static void ResetDisasterDelay()
 {
 	_disaster_delay = GB(Random(), 0, 9) + 730;
 }
 
-void DisasterDailyLoop(void)
+void DisasterDailyLoop()
 {
 	if (--_disaster_delay != 0) return;
 
@@ -1062,7 +1060,7 @@
 	if (_opt.diff.disasters != 0) DoDisaster();
 }
 
-void StartupDisasters(void)
+void StartupDisasters()
 {
 	ResetDisasterDelay();
 }
--- a/src/dock_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/dock_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -17,8 +17,8 @@
 #include "command.h"
 #include "variables.h"
 
-static void ShowBuildDockStationPicker(void);
-static void ShowBuildDocksDepotPicker(void);
+static void ShowBuildDockStationPicker();
+static void ShowBuildDocksDepotPicker();
 
 static Axis _ship_depot_direction;
 
@@ -156,7 +156,7 @@
 			if ((e->we.place.userdata & 0xF) == VPM_X_AND_Y) { // dragged actions
 				GUIPlaceProcDragXY(e);
 			} else if (e->we.place.userdata == VPM_X_OR_Y) {
-				DoCommandP(e->we.place.tile, e->we.place.starttile, _ctrl_pressed, CcBuildCanal, CMD_BUILD_CANAL | CMD_AUTO | CMD_MSG(STR_CANT_BUILD_CANALS));
+				DoCommandP(e->we.place.tile, e->we.place.starttile, 0, CcBuildCanal, CMD_BUILD_CANAL | CMD_AUTO | CMD_MSG(STR_CANT_BUILD_CANALS));
 			}
 		}
 		break;
@@ -216,7 +216,7 @@
 	BuildDocksToolbWndProc
 };
 
-void ShowBuildDocksToolbar(void)
+void ShowBuildDocksToolbar()
 {
 	if (!IsValidPlayer(_current_player)) return;
 
@@ -290,12 +290,12 @@
 	BuildDockStationWndProc
 };
 
-static void ShowBuildDockStationPicker(void)
+static void ShowBuildDockStationPicker()
 {
 	AllocateWindowDesc(&_build_dock_station_desc);
 }
 
-static void UpdateDocksDirection(void)
+static void UpdateDocksDirection()
 {
 	if (_ship_depot_direction != AXIS_X) {
 		SetTileSelectSize(1, 2);
@@ -360,14 +360,14 @@
 };
 
 
-static void ShowBuildDocksDepotPicker(void)
+static void ShowBuildDocksDepotPicker()
 {
 	AllocateWindowDesc(&_build_docks_depot_desc);
 	UpdateDocksDirection();
 }
 
 
-void InitializeDockGui(void)
+void InitializeDockGui()
 {
 	_ship_depot_direction = AXIS_X;
 }
--- a/src/driver.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/driver.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -30,17 +30,17 @@
 #include "video/cocoa_v.h"
 #include "video/win32_v.h"
 
-typedef struct DriverDesc {
+struct DriverDesc {
 	const char* name;
 	const char* longname;
 	const HalCommonDriver* drv;
-} DriverDesc;
+};
 
-typedef struct DriverClass {
+struct DriverClass {
 	const DriverDesc *descs;
 	const char *name;
 	const HalCommonDriver** drv;
-} DriverClass;
+};
 
 
 #define M(x, y, z) { x, y, (const HalCommonDriver *)(void *)z }
--- a/src/economy.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/economy.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -79,10 +79,10 @@
 		FOR_ALL_VEHICLES(v) {
 			if (v->owner != owner) continue;
 
-			if (v->type == VEH_Train ||
-					v->type == VEH_Road ||
-					(v->type == VEH_Aircraft && IsNormalAircraft(v)) ||
-					v->type == VEH_Ship) {
+			if (v->type == VEH_TRAIN ||
+					v->type == VEH_ROAD ||
+					(v->type == VEH_AIRCRAFT && IsNormalAircraft(v)) ||
+					v->type == VEH_SHIP) {
 				value += v->value * 3 >> 1;
 			}
 		}
@@ -115,10 +115,10 @@
 
 		FOR_ALL_VEHICLES(v) {
 			if (v->owner != owner) continue;
-			if ((v->type == VEH_Train && IsFrontEngine(v)) ||
-					 v->type == VEH_Road ||
-					(v->type == VEH_Aircraft && IsNormalAircraft(v)) ||
-					 v->type == VEH_Ship) {
+			if ((v->type == VEH_TRAIN && IsFrontEngine(v)) ||
+					 v->type == VEH_ROAD ||
+					(v->type == VEH_AIRCRAFT && IsNormalAircraft(v)) ||
+					 v->type == VEH_SHIP) {
 				num++;
 				if (v->age > 730) {
 					/* Find the vehicle with the lowest amount of profit */
@@ -305,17 +305,17 @@
 		FOR_ALL_VEHICLES(v) {
 			if (v->owner == new_player) {
 				switch (v->type) {
-					case VEH_Train:    if (IsFrontEngine(v)) num_train++; break;
-					case VEH_Road:     num_road++; break;
-					case VEH_Ship:     num_ship++; break;
-					case VEH_Aircraft: if (IsNormalAircraft(v)) num_aircraft++; break;
+					case VEH_TRAIN:    if (IsFrontEngine(v)) num_train++; break;
+					case VEH_ROAD:     num_road++; break;
+					case VEH_SHIP:     num_ship++; break;
+					case VEH_AIRCRAFT: if (IsNormalAircraft(v)) num_aircraft++; break;
 					default: break;
 				}
 			}
 		}
 
 		FOR_ALL_VEHICLES(v) {
-			if (v->owner == old_player && IS_BYTE_INSIDE(v->type, VEH_Train, VEH_Aircraft + 1)) {
+			if (v->owner == old_player && IS_BYTE_INSIDE(v->type, VEH_TRAIN, VEH_AIRCRAFT + 1)) {
 				if (new_player == PLAYER_SPECTATOR) {
 					DeleteWindowById(WC_VEHICLE_VIEW, v->index);
 					DeleteWindowById(WC_VEHICLE_DETAILS, v->index);
@@ -325,10 +325,10 @@
 					v->owner = new_player;
 					if (IsEngineCountable(v)) GetPlayer(new_player)->num_engines[v->engine_type]++;
 					switch (v->type) {
-						case VEH_Train:    if (IsFrontEngine(v)) v->unitnumber = ++num_train; break;
-						case VEH_Road:     v->unitnumber = ++num_road; break;
-						case VEH_Ship:     v->unitnumber = ++num_ship; break;
-						case VEH_Aircraft: if (IsNormalAircraft(v)) v->unitnumber = ++num_aircraft; break;
+						case VEH_TRAIN:    if (IsFrontEngine(v)) v->unitnumber = ++num_train; break;
+						case VEH_ROAD:     v->unitnumber = ++num_road; break;
+						case VEH_SHIP:     v->unitnumber = ++num_ship; break;
+						case VEH_AIRCRAFT: if (IsNormalAircraft(v)) v->unitnumber = ++num_aircraft; break;
 					}
 				}
 			}
@@ -370,6 +370,40 @@
 	MarkWholeScreenDirty();
 }
 
+static void ChangeNetworkOwner(PlayerID current_player, PlayerID new_player)
+{
+#ifdef ENABLE_NETWORK
+	if (!_networking) return;
+
+	if (current_player == _local_player) {
+		_network_playas = new_player;
+		SetLocalPlayer(new_player);
+	}
+
+	if (!_network_server) return;
+
+	/* The server has to handle all administrative issues, for example
+	* updating and notifying all clients of what has happened */
+	NetworkTCPSocketHandler *cs;
+	NetworkClientInfo *ci = NetworkFindClientInfoFromIndex(NETWORK_SERVER_INDEX);
+
+	/* The server has just changed from player */
+	if (current_player == ci->client_playas) {
+		ci->client_playas = new_player;
+		NetworkUpdateClientInfo(NETWORK_SERVER_INDEX);
+	}
+
+	/* Find all clients that were in control of this company, and mark them as new_player */
+	FOR_ALL_CLIENTS(cs) {
+		ci = DEREF_CLIENT_INFO(cs);
+		if (current_player == ci->client_playas) {
+			ci->client_playas = new_player;
+			NetworkUpdateClientInfo(ci->client_index);
+		}
+	}
+#endif /* ENABLE_NETWORK */
+}
+
 static void PlayersCheckBankrupt(Player *p)
 {
 	PlayerID owner;
@@ -427,35 +461,9 @@
 					p->bankrupt_asked = 0xFF;
 					p->bankrupt_timeout = 0x456;
 					break;
-				} else if (owner == _local_player) {
-					_network_playas = PLAYER_SPECTATOR;
-					SetLocalPlayer(PLAYER_SPECTATOR);
 				}
 
-#ifdef ENABLE_NETWORK
-				/* The server has to handle all administrative issues, for example
-				 * updating and notifying all clients of what has happened */
-				if (_network_server) {
-					NetworkTCPSocketHandler *cs;
-					NetworkClientInfo *ci = NetworkFindClientInfoFromIndex(NETWORK_SERVER_INDEX);
-
-					/* The server has just gone belly-up, mark it as spectator */
-					if (owner == ci->client_playas) {
-						ci->client_playas = PLAYER_SPECTATOR;
-						NetworkUpdateClientInfo(NETWORK_SERVER_INDEX);
-					}
-
-					/* Find all clients that were in control of this company,
-					 * and mark them as spectator; broadcast this message to everyone */
-					FOR_ALL_CLIENTS(cs) {
-						ci = DEREF_CLIENT_INFO(cs);
-						if (ci->client_playas == owner) {
-							ci->client_playas = PLAYER_SPECTATOR;
-							NetworkUpdateClientInfo(ci->client_index);
-						}
-					}
-				}
-#endif /* ENABLE_NETWORK */
+				ChangeNetworkOwner(owner, PLAYER_SPECTATOR);
 			}
 
 			/* Remove the player */
@@ -581,7 +589,7 @@
 	return 0;
 }
 
-static void PlayersGenStatistics(void)
+static void PlayersGenStatistics()
 {
 	Station *st;
 	Player *p;
@@ -625,7 +633,7 @@
 	*value += tmp >> 16;
 }
 
-static void AddInflation(void)
+static void AddInflation()
 {
 	/* Approximation for (100 + infl_amount)% ** (1 / 12) - 100%
 	 * scaled by 65536
@@ -658,7 +666,7 @@
 	InvalidateWindow(WC_PAYMENT_RATES, 0);
 }
 
-static void PlayersPayInterest(void)
+static void PlayersPayInterest()
 {
 	const Player* p;
 	int interest = _economy.interest_rate * 54;
@@ -676,7 +684,7 @@
 	}
 }
 
-static void HandleEconomyFluctuations(void)
+static void HandleEconomyFluctuations()
 {
 	if (_opt.diff.economy == 0) return;
 
@@ -756,7 +764,7 @@
 /**
  * Reset changes to the price base multipliers.
  */
-void ResetPriceBaseMultipliers(void)
+void ResetPriceBaseMultipliers()
 {
 	uint i;
 
@@ -778,7 +786,7 @@
 	price_base_multiplier[price] = factor;
 }
 
-void StartupEconomy(void)
+void StartupEconomy()
 {
 	int i;
 
@@ -821,12 +829,12 @@
 	SetDParam(0, mode ? cs->name_plural : cs->name);
 
 	if (s->age < 12) {
-		if (s->cargo_type != CT_PASSENGERS && s->cargo_type != CT_MAIL) {
+		if (cs->town_effect != TE_PASSENGERS && cs->town_effect != TE_MAIL) {
 			SetDParam(1, STR_INDUSTRY);
 			SetDParam(2, s->from);
 			tile = GetIndustry(s->from)->xy;
 
-			if (s->cargo_type != CT_GOODS && s->cargo_type != CT_FOOD) {
+			if (cs->town_effect != TE_GOODS && cs->town_effect != TE_FOOD) {
 				SetDParam(4, STR_INDUSTRY);
 				SetDParam(5, s->to);
 				tile2 = GetIndustry(s->to)->xy;
@@ -863,10 +871,12 @@
 	Subsidy *s;
 
 	for (s = _subsidies; s != endof(_subsidies); s++) {
-		if (s->cargo_type != CT_INVALID && s->age < 12 &&
-				(((s->cargo_type == CT_PASSENGERS || s->cargo_type == CT_MAIL) && (index == s->from || index == s->to)) ||
-				((s->cargo_type == CT_GOODS || s->cargo_type == CT_FOOD) && index == s->to))) {
-			s->cargo_type = CT_INVALID;
+		if (s->cargo_type != CT_INVALID && s->age < 12) {
+			const CargoSpec *cs = GetCargo(s->cargo_type);
+			if (((cs->town_effect == TE_PASSENGERS || cs->town_effect == TE_MAIL) && (index == s->from || index == s->to)) ||
+				((cs->town_effect == TE_GOODS || cs->town_effect == TE_FOOD) && index == s->to)) {
+				s->cargo_type = CT_INVALID;
+			}
 		}
 	}
 }
@@ -876,10 +886,12 @@
 	Subsidy *s;
 
 	for (s = _subsidies; s != endof(_subsidies); s++) {
-		if (s->cargo_type != CT_INVALID && s->age < 12 &&
-				s->cargo_type != CT_PASSENGERS && s->cargo_type != CT_MAIL &&
-				(index == s->from || (s->cargo_type != CT_GOODS && s->cargo_type != CT_FOOD && index == s->to))) {
-			s->cargo_type = CT_INVALID;
+		if (s->cargo_type != CT_INVALID && s->age < 12) {
+			const CargoSpec *cs = GetCargo(s->cargo_type);
+			if (cs->town_effect != TE_PASSENGERS && cs->town_effect != TE_MAIL &&
+				(index == s->from || (cs->town_effect != TE_GOODS && cs->town_effect != TE_FOOD && index == s->to))) {
+				s->cargo_type = CT_INVALID;
+			}
 		}
 	}
 }
@@ -901,12 +913,12 @@
 		InvalidateWindow(WC_SUBSIDIES_LIST, 0);
 }
 
-typedef struct FoundRoute {
+struct FoundRoute {
 	uint distance;
 	CargoID cargo;
 	void *from;
 	void *to;
-} FoundRoute;
+};
 
 static void FindSubsidyPassengerRoute(FoundRoute *fr)
 {
@@ -949,12 +961,14 @@
 	/* Quit if no production in this industry
 	 * or if the cargo type is passengers
 	 * or if the pct transported is already large enough */
-	if (total == 0 || trans > 42 || cargo == CT_INVALID || cargo == CT_PASSENGERS)
-		return;
+	if (total == 0 || trans > 42 || cargo == CT_INVALID) return;
+
+	const CargoSpec *cs = GetCargo(cargo);
+	if (cs->town_effect == TE_PASSENGERS) return;
 
 	fr->cargo = cargo;
 
-	if (cargo == CT_GOODS || cargo == CT_FOOD) {
+	if (cs->town_effect == TE_GOODS || cs->town_effect == TE_FOOD) {
 		/*  The destination is a town */
 		Town *t = GetRandomTown();
 
@@ -995,7 +1009,7 @@
 }
 
 
-static void SubsidyMonthlyHandler(void)
+static void SubsidyMonthlyHandler()
 {
 	Subsidy *s;
 	Pair pair;
@@ -1047,7 +1061,10 @@
 			if (fr.distance <= 70) {
 				s->cargo_type = fr.cargo;
 				s->from = ((Industry*)fr.from)->index;
-				s->to = (fr.cargo == CT_GOODS || fr.cargo == CT_FOOD) ? ((Town*)fr.to)->index : ((Industry*)fr.to)->index;
+				{
+					const CargoSpec *cs = GetCargo(fr.cargo);
+					s->to = (cs->town_effect == TE_GOODS || cs->town_effect == TE_FOOD) ? ((Town*)fr.to)->index : ((Industry*)fr.to)->index;
+				}
 	add_subsidy:
 				if (!CheckSubsidyDuplicate(s)) {
 					s->age = 0;
@@ -1074,7 +1091,7 @@
 	SLE_END()
 };
 
-static void Save_SUBS(void)
+static void Save_SUBS()
 {
 	int i;
 	Subsidy *s;
@@ -1088,7 +1105,7 @@
 	}
 }
 
-static void Load_SUBS(void)
+static void Load_SUBS()
 {
 	int index;
 	while ((index = SlIterateArray()) != -1)
@@ -1102,7 +1119,7 @@
 	byte f;
 
 	/* zero the distance if it's the bank and very short transport. */
-	if (_opt.landscape == LT_NORMAL && cargo == CT_VALUABLES && dist < 10)
+	if (_opt.landscape == LT_NORMAL && cs->label == 'VALU' && dist < 10)
 		dist = 0;
 
 	f = 255;
@@ -1179,7 +1196,8 @@
 	for (s = _subsidies; s != endof(_subsidies); s++) {
 		if (s->cargo_type == cargo_type && s->age < 12) {
 			/* Check distance from source */
-			if (cargo_type == CT_PASSENGERS || cargo_type == CT_MAIL) {
+			const CargoSpec *cs = GetCargo(cargo_type);
+			if (cs->town_effect == TE_PASSENGERS || cs->town_effect == TE_MAIL) {
 				xy = GetTown(s->from)->xy;
 			} else {
 				xy = (GetIndustry(s->from))->xy;
@@ -1187,11 +1205,11 @@
 			if (DistanceMax(xy, from->xy) > 9) continue;
 
 			/* Check distance from dest */
-			switch (cargo_type) {
-				case CT_PASSENGERS:
-				case CT_MAIL:
-				case CT_GOODS:
-				case CT_FOOD:
+			switch (cs->town_effect) {
+				case TE_PASSENGERS:
+				case TE_MAIL:
+				case TE_GOODS:
+				case TE_FOOD:
 					xy = GetTown(s->to)->xy;
 					break;
 
@@ -1249,8 +1267,9 @@
 	subsidised = CheckSubsidised(s_from, s_to, cargo_type);
 
 	/* Increase town's counter for some special goods types */
-	if (cargo_type == CT_FOOD) s_to->town->new_act_food += num_pieces;
-	if (cargo_type == CT_WATER)  s_to->town->new_act_water += num_pieces;
+	const CargoSpec *cs = GetCargo(cargo_type);
+	if (cs->town_effect == TE_FOOD) s_to->town->new_act_food += num_pieces;
+	if (cs->town_effect == TE_WATER) s_to->town->new_act_water += num_pieces;
 
 	/* Give the goods to the industry. */
 	DeliverGoodsToIndustry(s_to->xy, cargo_type, num_pieces);
@@ -1295,7 +1314,7 @@
 	}
 
 	FOR_ALL_VEHICLES(x) {
-		if ((x->type != VEH_Train || IsFrontEngine(x)) && // for all locs
+		if ((x->type != VEH_TRAIN || IsFrontEngine(x)) && // for all locs
 				u->last_station_visited == x->last_station_visited && // at the same station
 				!(x->vehstatus & (VS_STOPPED | VS_CRASHED)) && // not stopped or crashed
 				x->current_order.type == OT_LOADING && // loading
@@ -1368,7 +1387,7 @@
 	for (; v != NULL; v = v->next) {
 		GoodsEntry* ge;
 		load_amount = EngInfo(v->engine_type)->load_amount;
-		if (_patches.gradual_loading) {
+		if (_patches.gradual_loading && HASBIT(EngInfo(v->engine_type)->callbackmask, CBM_LOAD_AMOUNT)) {
 			uint16 cb_load_amount = GetVehicleCallback(CBID_VEHICLE_LOAD_AMOUNT, 0, 0, v->engine_type, v);
 			if (cb_load_amount != CALLBACK_FAILED) load_amount = cb_load_amount & 0xFF;
 		}
@@ -1481,8 +1500,8 @@
 		/* update stats */
 		ge->days_since_pickup = 0;
 		switch (u->type) {
-			case VEH_Train: t = u->u.rail.cached_max_speed; break;
-			case VEH_Road:  t = u->max_speed / 2;           break;
+			case VEH_TRAIN: t = u->u.rail.cached_max_speed; break;
+			case VEH_ROAD:  t = u->max_speed / 2;           break;
 			default:        t = u->max_speed;               break;
 		}
 
@@ -1566,7 +1585,7 @@
 		ShowFeederIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, virtual_profit_total);
 	}
 
-	if (v->type == VEH_Train) {
+	if (v->type == VEH_TRAIN) {
 		/* Each platform tile is worth 2 rail vehicles. */
 		int overhang = v->u.rail.cached_total_length - st->GetPlatformLength(v->tile) * TILE_SIZE;
 		if (overhang > 0) {
@@ -1603,7 +1622,7 @@
 	return result;
 }
 
-void PlayersMonthlyLoop(void)
+void PlayersMonthlyLoop()
 {
 	PlayersGenStatistics();
 	if (_patches.inflation && _cur_year < MAX_YEAR)
@@ -1628,6 +1647,7 @@
 
 	/* original code does this a little bit differently */
 	PlayerID pi = p->index;
+	ChangeNetworkOwner(pi, _current_player);
 	ChangeOwnershipOfPlayerItems(pi, _current_player);
 
 	if (p->bankrupt_value == 0) {
@@ -1757,14 +1777,14 @@
 }
 
 /** Prices */
-static void SaveLoad_PRIC(void)
+static void SaveLoad_PRIC()
 {
 	SlArray(&_price,      NUM_PRICES, SLE_INT32);
 	SlArray(&_price_frac, NUM_PRICES, SLE_UINT16);
 }
 
 /** Cargo payment rates */
-static void SaveLoad_CAPR(void)
+static void SaveLoad_CAPR()
 {
 	SlArray(&_cargo_payment_rates,      NUM_CARGO, SLE_INT32);
 	SlArray(&_cargo_payment_rates_frac, NUM_CARGO, SLE_UINT16);
@@ -1781,7 +1801,7 @@
 };
 
 /** Economy variables */
-static void SaveLoad_ECMY(void)
+static void SaveLoad_ECMY()
 {
 	SlObject(&_economy, _economy_desc);
 }
--- a/src/economy.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/economy.h	Mon Mar 19 12:38:16 2007 +0000
@@ -5,27 +5,27 @@
 #ifndef ECONOMY_H
 #define ECONOMY_H
 
-void ResetPriceBaseMultipliers(void);
+void ResetPriceBaseMultipliers();
 void SetPriceBaseMultiplier(uint price, byte factor);
 
-typedef struct {
+struct Economy {
 	int32 max_loan;         ///< Maximum possible loan
 	int32 max_loan_unround; ///< Economy fluctuation status
 	int fluct;
 	byte interest_rate;     ///< Interest
 	byte infl_amount;       ///< inflation amount
 	byte infl_amount_pr;    ///< "floating" portion of inflation
-} Economy;
+};
 
 VARDEF Economy _economy;
 
-typedef struct Subsidy {
+struct Subsidy {
 	CargoID cargo_type;
 	byte age;
 	/* from and to can either be TownID, StationID or IndustryID */
 	uint16 from;
 	uint16 to;
-} Subsidy;
+};
 
 
 enum ScoreID {
@@ -48,11 +48,11 @@
 
 DECLARE_POSTFIX_INCREMENT(ScoreID);
 
-typedef struct ScoreInfo {
+struct ScoreInfo {
 	byte id;    ///< Unique ID of the score
 	int needed; ///< How much you need to get the perfect score
 	int score;  ///< How much score it will give
-} ScoreInfo;
+};
 
 extern const ScoreInfo _score_info[];
 extern int _score_part[MAX_PLAYERS][SCORE_END];
--- a/src/elrail.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/elrail.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -125,18 +125,16 @@
 {
 	if (IsTileType(tile, MP_TUNNELBRIDGE)) {
 		if (IsTunnel(tile)) {
+			*tileh = SLOPE_STEEP; // XXX - Hack to make tunnel entrances to always have a pylon
+		} else if (*tileh != SLOPE_FLAT) {
 			*tileh = SLOPE_FLAT;
 		} else {
-			if (*tileh != SLOPE_FLAT) {
-				*tileh = SLOPE_FLAT;
-			} else {
-				switch (GetBridgeRampDirection(tile)) {
-					case DIAGDIR_NE: *tileh = SLOPE_NE; break;
-					case DIAGDIR_SE: *tileh = SLOPE_SE; break;
-					case DIAGDIR_SW: *tileh = SLOPE_SW; break;
-					case DIAGDIR_NW: *tileh = SLOPE_NW; break;
-					default: NOT_REACHED();
-				}
+			switch (GetBridgeRampDirection(tile)) {
+				case DIAGDIR_NE: *tileh = SLOPE_NE; break;
+				case DIAGDIR_SE: *tileh = SLOPE_SE; break;
+				case DIAGDIR_SW: *tileh = SLOPE_SW; break;
+				case DIAGDIR_NW: *tileh = SLOPE_NW; break;
+				default: NOT_REACHED();
 			}
 		}
 	}
@@ -187,7 +185,7 @@
 		if (IsTunnelTile(neighbour) && i != GetTunnelDirection(neighbour)) trackconfig[TS_NEIGHBOUR] = TRACK_BIT_NONE;
 		isflat[TS_NEIGHBOUR] = ((trackconfig[TS_NEIGHBOUR] & (TRACK_BIT_HORZ | TRACK_BIT_VERT)) != 0);
 
-		PPPpreferred[i] = 0xFF; /* We start with preferring everything (end-of-line in any direction) */
+		PPPpreferred[i] = 0xFF; // We start with preferring everything (end-of-line in any direction)
 		PPPallowed[i] = AllowedPPPonPCP[i];
 
 		/* We cycle through all the existing tracks at a PCP and see what
@@ -206,7 +204,7 @@
 				/* track found, if track is in the neighbour tile, adjust the number
 				 * of the PCP for preferred/allowed determination*/
 				DiagDirection PCPpos = (TrackSourceTile[i][k] == TS_HOME) ? i : ReverseDiagDir(i);
-				SETBIT(PCPstatus, i); /* This PCP is in use */
+				SETBIT(PCPstatus, i); // This PCP is in use
 
 				PPPpreferred[i] &= PreferredPPPofTrackAtPCP[TracksAtPCP[i][k]][PCPpos];
 				PPPallowed[i] &= ~DisallowedPPPofTrackAtPCP[TracksAtPCP[i][k]][PCPpos];
@@ -227,11 +225,7 @@
 		}
 
 		if (foundation != 0) {
-			if (foundation < 15) {
-				tileh[TS_NEIGHBOUR] = SLOPE_FLAT;
-			} else {
-				tileh[TS_NEIGHBOUR] = _inclined_tileh[foundation - 15];
-			}
+			tileh[TS_NEIGHBOUR] = foundation < 15 ? SLOPE_FLAT : _inclined_tileh[foundation - 15];
 		}
 
 		AdjustTileh(neighbour, &tileh[TS_NEIGHBOUR]);
@@ -255,7 +249,9 @@
 			uint height = GetBridgeHeight(GetNorthernBridgeEnd(ti->tile));
 
 			if ((height <= TilePixelHeight(ti->tile) + TILE_HEIGHT) &&
-			(i == PCPpositions[bridgetrack][0] || i == PCPpositions[bridgetrack][1])) SETBIT(OverridePCP, i);
+					(i == PCPpositions[bridgetrack][0] || i == PCPpositions[bridgetrack][1])) {
+				SETBIT(OverridePCP, i);
+			}
 		}
 
 		if (PPPallowed[i] != 0 && HASBIT(PCPstatus, i) && !HASBIT(OverridePCP, i)) {
@@ -291,7 +287,16 @@
 	/* Drawing of pylons is finished, now draw the wires */
 	for (t = TRACK_BEGIN; t < TRACK_END; t++) {
 		if (HASBIT(trackconfig[TS_HOME], t)) {
+			if (IsTunnelTile(ti->tile)) {
+				const SortableSpriteStruct *sss = &CatenarySpriteData_Tunnel[GetTunnelDirection(ti->tile)];
 
+				AddSortableSpriteToDraw(
+					sss->image, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset,
+					sss->x_size, sss->y_size, sss->z_size,
+					GetTileZ(ti->tile) + sss->z_offset
+				);
+				break;
+			}
 			byte PCPconfig = HASBIT(PCPstatus, PCPpositions[t][0]) +
 				(HASBIT(PCPstatus, PCPpositions[t][1]) << 1);
 
@@ -372,7 +377,7 @@
 	switch (GetTileType(ti->tile)) {
 		case MP_RAILWAY:
 			if (IsRailDepot(ti->tile)) {
-				const SortableSpriteStruct* sss = &CatenarySpriteData_Depot[GetRailDepotDirection(ti->tile)];
+				const SortableSpriteStruct *sss = &CatenarySpriteData_Depot[GetRailDepotDirection(ti->tile)];
 
 				AddSortableSpriteToDraw(
 					sss->image, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset,
@@ -396,7 +401,7 @@
 int32 SettingsDisableElrail(int32 p1)
 {
 	EngineID e_id;
-	Vehicle* v;
+	Vehicle *v;
 	Player *p;
 	bool disable = (p1 != 0);
 
@@ -418,7 +423,7 @@
 	*  normal rail too */
 	if (disable) {
 		FOR_ALL_VEHICLES(v) {
-			if (v->type == VEH_Train && v->u.rail.railtype == RAILTYPE_ELECTRIC) {
+			if (v->type == VEH_TRAIN && v->u.rail.railtype == RAILTYPE_ELECTRIC) {
 				/* this railroad vehicle is now compatible only with elrail,
 				*  so add there also normal rail compatibility */
 				v->u.rail.compatible_railtypes |= (1 << RAILTYPE_RAIL);
@@ -431,7 +436,7 @@
 	/* setup total power for trains */
 	FOR_ALL_VEHICLES(v) {
 		/* power is cached only for front engines */
-		if (v->type == VEH_Train && IsFrontEngine(v)) TrainPowerChanged(v);
+		if (v->type == VEH_TRAIN && IsFrontEngine(v)) TrainPowerChanged(v);
 	}
 
 	FOR_ALL_PLAYERS(p) p->avail_railtypes = GetPlayerRailtypes(p->index);
--- a/src/engine.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/engine.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -34,7 +34,7 @@
 
 void ShowEnginePreviewWindow(EngineID engine);
 
-void DeleteCustomEngineNames(void)
+void DeleteCustomEngineNames()
 {
 	uint i;
 	StringID old;
@@ -48,13 +48,13 @@
 	_vehicle_design_names &= ~1;
 }
 
-void LoadCustomEngineNames(void)
+void LoadCustomEngineNames()
 {
 	/* XXX: not done */
 	DEBUG(misc, 1, "LoadCustomEngineNames: not done");
 }
 
-static void SetupEngineNames(void)
+static void SetupEngineNames()
 {
 	StringID *name;
 
@@ -92,17 +92,17 @@
 	InvalidateWindowClasses(WC_REPLACE_VEHICLE);
 }
 
-void AddTypeToEngines(void)
+void AddTypeToEngines()
 {
 	Engine* e = _engines;
 
-	do e->type = VEH_Train;    while (++e < &_engines[ROAD_ENGINES_INDEX]);
-	do e->type = VEH_Road;     while (++e < &_engines[SHIP_ENGINES_INDEX]);
-	do e->type = VEH_Ship;     while (++e < &_engines[AIRCRAFT_ENGINES_INDEX]);
-	do e->type = VEH_Aircraft; while (++e < &_engines[TOTAL_NUM_ENGINES]);
+	do e->type = VEH_TRAIN;    while (++e < &_engines[ROAD_ENGINES_INDEX]);
+	do e->type = VEH_ROAD;     while (++e < &_engines[SHIP_ENGINES_INDEX]);
+	do e->type = VEH_SHIP;     while (++e < &_engines[AIRCRAFT_ENGINES_INDEX]);
+	do e->type = VEH_AIRCRAFT; while (++e < &_engines[TOTAL_NUM_ENGINES]);
 }
 
-void StartupEngines(void)
+void StartupEngines()
 {
 	Engine *e;
 	const EngineInfo *ei;
@@ -169,7 +169,7 @@
 	Engine *e = GetEngine(eid);
 
 	SETBIT(e->player_avail, player);
-	if (e->type == VEH_Train) {
+	if (e->type == VEH_TRAIN) {
 		const RailVehicleInfo *rvi = RailVehInfo(eid);
 		Player *p = GetPlayer(player);
 
@@ -209,7 +209,7 @@
 	return best_player;
 }
 
-void EnginesDailyLoop(void)
+void EnginesDailyLoop()
 {
 	EngineID i;
 
@@ -289,8 +289,8 @@
 			p->block_preview = 20;
 
 			FOR_ALL_VEHICLES(v) {
-				if (v->type == VEH_Train || v->type == VEH_Road || v->type == VEH_Ship ||
-						(v->type == VEH_Aircraft && IsNormalAircraft(v))) {
+				if (v->type == VEH_TRAIN || v->type == VEH_ROAD || v->type == VEH_SHIP ||
+						(v->type == VEH_AIRCRAFT && IsNormalAircraft(v))) {
 					if (v->owner == p->index && v->engine_type == index) {
 						/* The user did prove me wrong, so restore old value */
 						p->block_preview = block_preview;
@@ -321,7 +321,7 @@
 	AddNewsItem(index, NEWS_FLAGS(NM_CALLBACK, 0, NT_NEW_VEHICLES, DNC_VEHICLEAVAIL), 0, 0);
 }
 
-void EnginesMonthlyLoop(void)
+void EnginesMonthlyLoop()
 {
 	Engine *e;
 
@@ -423,7 +423,7 @@
 }
 
 
-static EngineRenew *AllocateEngineRenew(void)
+static EngineRenew *AllocateEngineRenew()
 {
 	EngineRenew *er;
 
@@ -538,7 +538,7 @@
 	SLE_END()
 };
 
-static void Save_ERNW(void)
+static void Save_ERNW()
 {
 	EngineRenew *er;
 
@@ -548,7 +548,7 @@
 	}
 }
 
-static void Load_ERNW(void)
+static void Load_ERNW()
 {
 	int index;
 
@@ -590,7 +590,7 @@
 	SLE_END()
 };
 
-static void Save_ENGN(void)
+static void Save_ENGN()
 {
 	uint i;
 
@@ -600,7 +600,7 @@
 	}
 }
 
-static void Load_ENGN(void)
+static void Load_ENGN()
 {
 	int index;
 	while ((index = SlIterateArray()) != -1) {
@@ -608,7 +608,7 @@
 	}
 }
 
-static void LoadSave_ENGS(void)
+static void LoadSave_ENGS()
 {
 	SlArray(_engine_name_strings, lengthof(_engine_name_strings), SLE_STRINGID);
 }
@@ -619,7 +619,7 @@
 	{ 'ERNW', Save_ERNW,     Load_ERNW,     CH_ARRAY | CH_LAST},
 };
 
-void InitializeEngines(void)
+void InitializeEngines()
 {
 	/* Clean the engine renew pool and create 1 block in it */
 	CleanPool(&_EngineRenew_pool);
--- a/src/engine.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/engine.h	Mon Mar 19 12:38:16 2007 +0000
@@ -16,7 +16,7 @@
 	RAILVEH_WAGON,       ///< simple wagon, not motorized
 };
 
-typedef struct RailVehicleInfo {
+struct RailVehicleInfo {
 	byte image_index;
 	RailVehicleTypes railveh_type;
 	byte base_cost;
@@ -39,9 +39,9 @@
 	byte shorten_factor;   ///< length on main map for this type is 8 - shorten_factor
 	byte tractive_effort; ///< Tractive effort coefficient
 	byte user_def_data;    ///< Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles
-} RailVehicleInfo;
+};
 
-typedef struct ShipVehicleInfo {
+struct ShipVehicleInfo {
 	byte image_index;
 	byte base_cost;
 	uint16 max_speed;
@@ -50,7 +50,7 @@
 	byte running_cost;
 	SoundFxByte sfx;
 	bool refittable;
-} ShipVehicleInfo;
+};
 
 /* AircraftVehicleInfo subtypes, bitmask type.
  * If bit 0 is 0 then it is a helicopter, otherwise it is a plane
@@ -61,7 +61,7 @@
 	AIR_FAST = 2
 };
 
-typedef struct AircraftVehicleInfo {
+struct AircraftVehicleInfo {
 	byte image_index;
 	byte base_cost;
 	byte running_cost;
@@ -71,9 +71,9 @@
 	uint16 max_speed;
 	byte mail_capacity;
 	uint16 passenger_capacity;
-} AircraftVehicleInfo;
+};
 
-typedef struct RoadVehicleInfo {
+struct RoadVehicleInfo {
 	byte image_index;
 	byte base_cost;
 	byte running_cost;
@@ -81,12 +81,12 @@
 	byte max_speed;
 	byte capacity;
 	CargoID cargo_type;
-} RoadVehicleInfo;
+};
 
 /** Information about a vehicle
  *  @see table/engines.h
  */
-typedef struct EngineInfo {
+struct EngineInfo {
 	Date base_intro;
 	Year lifelength;
 	Year base_life;
@@ -97,9 +97,9 @@
 	byte refit_cost;
 	byte misc_flags;
 	byte callbackmask;
-} EngineInfo;
+};
 
-typedef struct Engine {
+struct Engine {
 	Date intro_date;
 	Date age;
 	uint16 reliability;
@@ -111,8 +111,8 @@
 	PlayerByte preview_player;
 	byte preview_wait;
 	byte player_avail;
-	byte type; ///< type, ie VEH_Road, VEH_Train, etc. Same as in vehicle.h
-} Engine;
+	byte type; ///< type, ie VEH_ROAD, VEH_TRAIN, etc. Same as in vehicle.h
+};
 
 /**
  * EngineInfo.misc_flags is a bitmask, with the following values
@@ -140,8 +140,8 @@
 static const EngineID INVALID_ENGINE = 0xFFFF;
 
 
-void AddTypeToEngines(void);
-void StartupEngines(void);
+void AddTypeToEngines();
+void StartupEngines();
 
 
 void DrawTrainEngine(int x, int y, EngineID engine, SpriteID pal);
@@ -149,8 +149,8 @@
 void DrawShipEngine(int x, int y, EngineID engine, SpriteID pal);
 void DrawAircraftEngine(int x, int y, EngineID engine, SpriteID pal);
 
-void LoadCustomEngineNames(void);
-void DeleteCustomEngineNames(void);
+void LoadCustomEngineNames();
+void DeleteCustomEngineNames();
 
 bool IsEngineBuildable(EngineID engine, byte type, PlayerID player);
 
@@ -261,11 +261,9 @@
 	EngineRenewID index;
 	EngineID from;
 	EngineID to;
-	struct EngineRenew *next;
+	EngineRenew *next;
 };
 
-typedef struct EngineRenew EngineRenew;
-
 /**
  * Memory pool for engine renew elements. DO NOT USE outside of engine.c. Is
  * placed here so the only exception to this rule, the saveload code, can use
--- a/src/engine_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/engine_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -22,10 +22,10 @@
 {
 	switch (GetEngine(engine)->type) {
 		default: NOT_REACHED();
-		case VEH_Road:              return STR_8103_ROAD_VEHICLE;
-		case VEH_Aircraft:          return STR_8104_AIRCRAFT;
-		case VEH_Ship:              return STR_8105_SHIP;
-		case VEH_Train:
+		case VEH_ROAD:              return STR_8103_ROAD_VEHICLE;
+		case VEH_AIRCRAFT:          return STR_8104_AIRCRAFT;
+		case VEH_SHIP:              return STR_8105_SHIP;
+		case VEH_TRAIN:
 			switch (RailVehInfo(engine)->railtype) {
 				default: NOT_REACHED();
 				case RAILTYPE_RAIL:     return STR_8102_RAILROAD_LOCOMOTIVE;
@@ -48,10 +48,10 @@
 typedef void DrawEngineProc(int x, int y, EngineID engine, SpriteID pal);
 typedef void DrawEngineInfoProc(EngineID, int x, int y, int maxw);
 
-typedef struct DrawEngineInfo {
+struct DrawEngineInfo {
 	DrawEngineProc *engine_proc;
 	DrawEngineInfoProc *info_proc;
-} DrawEngineInfo;
+};
 
 static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw);
 static void DrawRoadVehEngineInfo(EngineID engine, int x, int y, int maxw);
@@ -140,7 +140,7 @@
 {
 	const AircraftVehicleInfo *avi = AircraftVehInfo(engine);
 	SetDParam(0, (_price.aircraft_base >> 3) * avi->base_cost >> 5);
-	SetDParam(1, avi->max_speed);
+	SetDParam(1, avi->max_speed * 10 / 16);
 	SetDParam(2, avi->passenger_capacity);
 	SetDParam(3, avi->mail_capacity);
 	SetDParam(4, avi->running_cost * _price.aircraft_running >> 8);
--- a/src/fileio.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/fileio.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -10,6 +10,12 @@
 #include "macros.h"
 #include "variables.h"
 #include "debug.h"
+#include "fios.h"
+#ifndef WIN32
+#include <pwd.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#endif
 
 /*************************************************/
 /* FILE IO ROUTINES ******************************/
@@ -18,7 +24,7 @@
 #define FIO_BUFFER_SIZE 512
 #define MAX_HANDLES 64
 
-typedef struct {
+struct Fio {
 	byte *buffer, *buffer_end;          ///< position pointer in local buffer and last valid byte of buffer
 	uint32 pos;                         ///< current (system) position in file
 	FILE *cur_fh;                       ///< current file handle
@@ -29,12 +35,12 @@
 	const char *filename[MAX_HANDLES];  ///< array of filenames we (should) have open
 	uint usage_count[MAX_HANDLES];      ///< count how many times this file has been opened
 #endif /* LIMITED_FDS */
-} Fio;
+};
 
 static Fio _fio;
 
 /* Get current position in file */
-uint32 FioGetPos(void)
+uint32 FioGetPos()
 {
 	return _fio.pos + (_fio.buffer - _fio.buffer_start) - FIO_BUFFER_SIZE;
 }
@@ -73,7 +79,7 @@
 	FioSeekTo(GB(pos, 0, 24), SEEK_SET);
 }
 
-byte FioReadByte(void)
+byte FioReadByte()
 {
 	if (_fio.buffer == _fio.buffer_end) {
 		_fio.pos += FIO_BUFFER_SIZE;
@@ -94,13 +100,13 @@
 	}
 }
 
-uint16 FioReadWord(void)
+uint16 FioReadWord()
 {
 	byte b = FioReadByte();
 	return (FioReadByte() << 8) | b;
 }
 
-uint32 FioReadDword(void)
+uint32 FioReadDword()
 {
 	uint b = FioReadWord();
 	return (FioReadWord() << 16) | b;
@@ -124,7 +130,7 @@
 	}
 }
 
-void FioCloseAll(void)
+void FioCloseAll()
 {
 	int i;
 
@@ -132,15 +138,6 @@
 		FioCloseFile(i);
 }
 
-bool FioCheckFileExists(const char *filename)
-{
-	FILE *f = FioFOpenFile(filename);
-	if (f == NULL) return false;
-
-	fclose(f);
-	return true;
-}
-
 #if defined(LIMITED_FDS)
 static void FioFreeHandle()
 {
@@ -165,6 +162,45 @@
 }
 #endif /* LIMITED_FDS */
 
+void FioOpenFile(int slot, const char *filename)
+{
+	FILE *f;
+
+#if defined(LIMITED_FDS)
+	FioFreeHandle();
+#endif /* LIMITED_FDS */
+	f = FioFOpenFile(filename);
+	if (f == NULL) error("Cannot open file '%s%s'", _paths.data_dir, filename);
+
+	FioCloseFile(slot); // if file was opened before, close it
+	_fio.handles[slot] = f;
+#if defined(LIMITED_FDS)
+	_fio.filename[slot] = filename;
+	_fio.usage_count[slot] = 0;
+	_fio.open_handles++;
+#endif /* LIMITED_FDS */
+	FioSeekToFile(slot << 24);
+}
+
+/**
+ * Check whether the given file exists
+ * @param filename the file to try for existance
+ * @return true if and only if the file can be opened
+ */
+bool FioCheckFileExists(const char *filename)
+{
+	FILE *f = FioFOpenFile(filename);
+	if (f == NULL) return false;
+
+	fclose(f);
+	return true;
+}
+
+/**
+ * Opens the file with the given name
+ * @param filename the file to open (in either data_dir or second_data_dir)
+ * @return the opened file or NULL when it failed.
+ */
 FILE *FioFOpenFile(const char *filename)
 {
 	FILE *f;
@@ -192,22 +228,156 @@
 	return f;
 }
 
-void FioOpenFile(int slot, const char *filename)
+/**
+ * Create a directory with the given name
+ * @param name the new name of the directory
+ */
+void FioCreateDirectory(const char *name)
 {
-	FILE *f;
+#if defined(WIN32) || defined(WINCE)
+	CreateDirectory(OTTD2FS(name), NULL);
+#elif defined(OS2) && !defined(__INNOTEK_LIBC__)
+	mkdir(OTTD2FS(name));
+#else
+	mkdir(OTTD2FS(name), 0755);
+#endif
+}
 
-#if defined(LIMITED_FDS)
-	FioFreeHandle();
-#endif /* LIMITED_FDS */
-	f = FioFOpenFile(filename);
-	if (f == NULL) error("Cannot open file '%s%s'", _paths.data_dir, filename);
+/**
+ * Appends, if necessary, the path separator character to the end of the string.
+ * It does not add the path separator to zero-sized strings.
+ * @param buf    string to append the separator to
+ * @param buflen the length of the buf
+ */
+void AppendPathSeparator(char *buf, size_t buflen)
+{
+	size_t s = strlen(buf);
 
-	FioCloseFile(slot); // if file was opened before, close it
-	_fio.handles[slot] = f;
-#if defined(LIMITED_FDS)
-	_fio.filename[slot] = filename;
-	_fio.usage_count[slot] = 0;
-	_fio.open_handles++;
-#endif /* LIMITED_FDS */
-	FioSeekToFile(slot << 24);
+	/* Length of string + path separator + '\0' */
+	if (s != 0 && buf[s - 1] != PATHSEPCHAR && s + 2 < buflen) {
+		buf[s]     = PATHSEPCHAR;
+		buf[s + 1] = '\0';
+	}
 }
+
+#if defined(WIN32) || defined(WINCE)
+/**
+ * Determine the base (personal dir and game data dir) paths
+ * @param exe the path to the executable
+ */
+extern void DetermineBasePaths(const char *exe);
+#else /* defined(WIN32) || defined(WINCE) */
+
+/**
+ * Changes the working directory to the path of the give executable.
+ * For OSX application bundles '.app' is the required extension of the bundle,
+ * so when we crop the path to there, when can remove the name of the bundle
+ * in the same way we remove the name from the executable name.
+ * @param exe the path to the executable
+ */
+void ChangeWorkingDirectory(const char *exe)
+{
+#ifdef WITH_COCOA
+	char *app_bundle = strchr(exe, '.');
+	while (app_bundle != NULL && strncasecmp(app_bundle, ".app", 4) != 0) app_bundle = strchr(&app_bundle[1], '.');
+
+	if (app_bundle != NULL) app_bundle[0] = '\0';
+#endif /* WITH_COCOA */
+	char *s = strrchr(exe, PATHSEPCHAR);
+	if (s != NULL) {
+		*s = '\0';
+		chdir(exe);
+		*s = PATHSEPCHAR;
+	}
+#ifdef WITH_COCOA
+	if (app_bundle != NULL) app_bundle[0] = '.';
+#endif /* WITH_COCOA */
+}
+
+/**
+ * Determine the base (personal dir and game data dir) paths
+ * @param exe the path to the executable
+ */
+void DetermineBasePaths(const char *exe)
+{
+	/* Change the working directory to enable doubleclicking in UIs */
+	ChangeWorkingDirectory(exe);
+
+	_paths.game_data_dir = MallocT<char>(MAX_PATH);
+	ttd_strlcpy(_paths.game_data_dir, GAME_DATA_DIR, MAX_PATH);
+#if defined(SECOND_DATA_DIR)
+	_paths.second_data_dir = MallocT<char>(MAX_PATH);
+	ttd_strlcpy(_paths.second_data_dir, SECOND_DATA_DIR, MAX_PATH);
+#endif
+
+#if defined(USE_HOMEDIR)
+	const char *homedir = getenv("HOME");
+
+	if (homedir == NULL) {
+		const struct passwd *pw = getpwuid(getuid());
+		if (pw != NULL) homedir = pw->pw_dir;
+	}
+
+	_paths.personal_dir = str_fmt("%s" PATHSEP "%s", homedir, PERSONAL_DIR);
+#else /* not defined(USE_HOMEDIR) */
+	_paths.personal_dir = MallocT<char>(MAX_PATH);
+	ttd_strlcpy(_paths.personal_dir, PERSONAL_DIR, MAX_PATH);
+
+	/* check if absolute or relative path */
+	const char *s = strchr(_paths.personal_dir, PATHSEPCHAR);
+
+	/* add absolute path */
+	if (s == NULL || _paths.personal_dir != s) {
+		getcwd(_paths.personal_dir, MAX_PATH);
+		AppendPathSeparator(_paths.personal_dir, MAX_PATH);
+		ttd_strlcat(_paths.personal_dir, PERSONAL_DIR, MAX_PATH);
+	}
+#endif /* defined(USE_HOMEDIR) */
+
+	AppendPathSeparator(_paths.personal_dir,  MAX_PATH);
+	AppendPathSeparator(_paths.game_data_dir, MAX_PATH);
+}
+#endif /* defined(WIN32) || defined(WINCE) */
+
+/**
+ * Acquire the base paths (personal dir and game data dir),
+ * fill all other paths (save dir, autosave dir etc) and
+ * make the save and scenario directories.
+ * @param exe the path to the executable
+ * @todo for save_dir, autosave_dir, scenario_dir and heightmap_dir the
+ *       assumption is that there is no path separator, however for gm_dir
+ *       lang_dir and data_dir that assumption is made.
+ *       This inconsistency should be resolved.
+ */
+void DeterminePaths(const char *exe)
+{
+	DetermineBasePaths(exe);
+
+	_paths.save_dir      = str_fmt("%ssave", _paths.personal_dir);
+	_paths.autosave_dir  = str_fmt("%s" PATHSEP "autosave", _paths.save_dir);
+	_paths.scenario_dir  = str_fmt("%sscenario", _paths.personal_dir);
+	_paths.heightmap_dir = str_fmt("%s" PATHSEP "heightmap", _paths.scenario_dir);
+	_paths.gm_dir        = str_fmt("%sgm" PATHSEP, _paths.game_data_dir);
+	_paths.data_dir      = str_fmt("%sdata" PATHSEP, _paths.game_data_dir);
+#if defined(CUSTOM_LANG_DIR)
+	/* Sets the search path for lng files to the custom one */
+	_paths.lang_dir = MallocT<char>(MAX_PATH);
+	ttd_strlcpy(_paths.lang_dir, CUSTOM_LANG_DIR, MAX_PATH);
+	AppendPathSeparator(_paths.lang_dir, MAX_PATH);
+#else
+	_paths.lang_dir = str_fmt("%slang" PATHSEP, _paths.game_data_dir);
+#endif
+
+	if (_config_file == NULL) {
+		_config_file = str_fmt("%sopenttd.cfg", _paths.personal_dir);
+	}
+
+	_highscore_file = str_fmt("%shs.dat", _paths.personal_dir);
+	_log_file = str_fmt("%sopenttd.log",  _paths.personal_dir);
+
+	/* Make (auto)save and scenario folder */
+	FioCreateDirectory(_paths.save_dir);
+	FioCreateDirectory(_paths.autosave_dir);
+	FioCreateDirectory(_paths.scenario_dir);
+	FioCreateDirectory(_paths.heightmap_dir);
+}
--- a/src/fileio.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/fileio.h	Mon Mar 19 12:38:16 2007 +0000
@@ -7,15 +7,20 @@
 
 void FioSeekTo(uint32 pos, int mode);
 void FioSeekToFile(uint32 pos);
-uint32 FioGetPos(void);
-byte FioReadByte(void);
-uint16 FioReadWord(void);
-uint32 FioReadDword(void);
-void FioCloseAll(void);
-FILE *FioFOpenFile(const char *filename);
+uint32 FioGetPos();
+byte FioReadByte();
+uint16 FioReadWord();
+uint32 FioReadDword();
+void FioCloseAll();
 void FioOpenFile(int slot, const char *filename);
 void FioReadBlock(void *ptr, uint size);
 void FioSkipBytes(int n);
+
+FILE *FioFOpenFile(const char *filename);
 bool FioCheckFileExists(const char *filename);
+void FioCreateDirectory(const char *filename);
+
+void AppendPathSeparator(char *buf, size_t buflen);
+void DeterminePaths(const char *exe);
 
 #endif /* FILEIO_H */
--- a/src/fios.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/fios.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -18,6 +18,7 @@
 #include <sys/stat.h>
 
 #ifdef WIN32
+# include <tchar.h>
 # include <io.h>
 #else
 # include <unistd.h>
@@ -33,7 +34,8 @@
 /* OS-specific functions are taken from their respective files (win32/unix/os2 .c) */
 extern bool FiosIsRoot(const char *path);
 extern bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb);
-extern void FiosGetDrives(void);
+extern bool FiosIsHiddenFile(const struct dirent *ent);
+extern void FiosGetDrives();
 extern bool FiosGetDiskFreeSpace(const char *path, uint32 *tot);
 
 /* get the name of an oldstyle savegame */
@@ -43,7 +45,7 @@
  * Allocate a new FiosItem.
  * @return A pointer to the newly allocated FiosItem.
  */
-FiosItem *FiosAlloc(void)
+FiosItem *FiosAlloc()
 {
 	if (_fios_count == _fios_alloc) {
 		_fios_alloc += 256;
@@ -77,7 +79,7 @@
 /**
  * Free the list of savegames
  */
-void FiosFreeSavegameList(void)
+void FiosFreeSavegameList()
 {
 	free(_fios_items);
 	_fios_items = NULL;
@@ -170,8 +172,8 @@
 	snprintf(buf, size, "%s" PATHSEP "%s%s", _fios_path, name, extension);
 }
 
-#if defined(WIN32) || defined(WIN64)
-# define unlink _wunlink
+#if defined(WIN32)
+# define unlink _tunlink
 #endif
 
 bool FiosDelete(const char *name)
@@ -227,7 +229,8 @@
 
 			/* found file must be directory, but not '.' or '..' */
 			if (FiosIsValidFile(_fios_path, dirent, &sb) && (sb.st_mode & S_IFDIR) &&
-				strcmp(d_name, ".") != 0 && strcmp(d_name, "..") != 0) {
+					(!FiosIsHiddenFile(dirent) || strncasecmp(d_name, PERSONAL_DIR, strlen(d_name)) == 0) &&
+					strcmp(d_name, ".") != 0 && strcmp(d_name, "..") != 0) {
 				fios = FiosAlloc();
 				fios->type = FIOS_TYPE_DIR;
 				fios->mtime = 0;
@@ -258,7 +261,7 @@
 			char *t;
 			ttd_strlcpy(d_name, FS2OTTD(dirent->d_name), sizeof(d_name));
 
-			if (!FiosIsValidFile(_fios_path, dirent, &sb) || !(sb.st_mode & S_IFREG)) continue;
+			if (!FiosIsValidFile(_fios_path, dirent, &sb) || !(sb.st_mode & S_IFREG) || FiosIsHiddenFile(dirent)) continue;
 
 			/* File has no extension, skip it */
 			if ((t = strrchr(d_name, '.')) == NULL) continue;
--- a/src/fios.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/fios.h	Mon Mar 19 12:38:16 2007 +0000
@@ -6,12 +6,12 @@
 #define FIOS_H
 
 /* Deals with finding savegames */
-typedef struct {
+struct FiosItem {
 	byte type;
 	uint64 mtime;
 	char title[64];
 	char name[256 - 12 - 64];
-} FiosItem;
+};
 
 enum {
 	FIOS_TYPE_DRIVE        =   0,
@@ -39,7 +39,7 @@
 /* Get a list of Heightmaps */
 FiosItem *FiosGetHeightmapList(int mode);
 /* Free the list of savegames */
-void FiosFreeSavegameList(void);
+void FiosFreeSavegameList();
 /* Browse to. Returns a filename w/path if we reached a file. */
 char *FiosBrowseTo(const FiosItem *item);
 /* Return path, free space and stringID */
@@ -49,22 +49,22 @@
 /* Make a filename from a name */
 void FiosMakeSavegameName(char *buf, const char *name, size_t size);
 /* Allocate a new FiosItem */
-FiosItem *FiosAlloc(void);
+FiosItem *FiosAlloc();
 
 int CDECL compare_FiosItems(const void *a, const void *b);
 
 /* Implementation of opendir/readdir/closedir for Windows */
 #if defined(WIN32)
 #include <windows.h>
-typedef struct DIR DIR;
+struct DIR;
 
-typedef struct dirent { // XXX - only d_name implemented
-	wchar_t *d_name; // name of found file
+struct dirent { // XXX - only d_name implemented
+	TCHAR *d_name; // name of found file
 	/* little hack which will point to parent DIR struct which will
 	 * save us a call to GetFileAttributes if we want information
 	 * about the file (for example in function fio_bla) */
 	DIR *dir;
-} dirent;
+};
 
 struct DIR {
 	HANDLE hFind;
@@ -72,14 +72,14 @@
 	 * note: having only one global instance is not possible because
 	 * multiple independent opendir/readdir sequences must be supported. */
 	dirent ent;
-	WIN32_FIND_DATAW fd;
+	WIN32_FIND_DATA fd;
 	/* since opendir calls FindFirstFile, we need a means of telling the
 	 * first call to readdir that we already have a file.
 	 * that's the case iff this is true */
 	bool at_first_entry;
 };
 
-DIR *opendir(const wchar_t *path);
+DIR *opendir(const TCHAR *path);
 struct dirent *readdir(DIR *d);
 int closedir(DIR *d);
 #else
--- a/src/fontcache.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/fontcache.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -278,7 +278,7 @@
 }
 
 
-void InitFreeType(void)
+void InitFreeType()
 {
 	if (StrEmpty(_freetype.small_font) && StrEmpty(_freetype.medium_font) && StrEmpty(_freetype.large_font)) {
 		DEBUG(freetype, 1, "No font faces specified, using sprite fonts instead");
@@ -315,10 +315,10 @@
 }
 
 
-typedef struct GlyphEntry {
+struct GlyphEntry {
 	Sprite *sprite;
 	byte width;
-} GlyphEntry;
+};
 
 
 /* The glyph cache. This is structured to reduce memory consumption.
@@ -492,7 +492,7 @@
 }
 
 
-void InitializeUnicodeGlyphMap(void)
+void InitializeUnicodeGlyphMap()
 {
 	FontSize size;
 	SpriteID base;
--- a/src/fontcache.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/fontcache.h	Mon Mar 19 12:38:16 2007 +0000
@@ -10,29 +10,29 @@
 void SetUnicodeGlyph(FontSize size, uint32 key, SpriteID sprite);
 
 /** Initialize the glyph map */
-void InitializeUnicodeGlyphMap(void);
+void InitializeUnicodeGlyphMap();
 
 #ifdef WITH_FREETYPE
 
-typedef struct FreeTypeSettings {
+struct FreeTypeSettings {
 	char small_font[260];
 	char medium_font[260];
 	char large_font[260];
 	uint small_size;
 	uint medium_size;
 	uint large_size;
-} FreeTypeSettings;
+};
 
 extern FreeTypeSettings _freetype;
 
-void InitFreeType(void);
+void InitFreeType();
 const struct Sprite *GetGlyph(FontSize size, uint32 key);
 uint GetGlyphWidth(FontSize size, uint32 key);
 
 #else
 
 /* Stub for initializiation */
-static inline void InitFreeType(void) {}
+static inline void InitFreeType() {}
 
 /** Get the Sprite for a glyph */
 static inline const Sprite *GetGlyph(FontSize size, uint32 key)
--- a/src/functions.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/functions.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,7 +8,7 @@
 #include "gfx.h"
 
 void DoClearSquare(TileIndex tile);
-void RunTileLoop(void);
+void RunTileLoop();
 
 uint GetPartialZ(int x, int y, Slope corners);
 uint GetSlopeZ(int x, int y);
@@ -80,11 +80,11 @@
 
 // Mersenne twister functions
 void SeedMT(uint32 seed);
-uint32 RandomMT(void);
+uint32 RandomMT();
 
 
 #ifdef MERSENNE_TWISTER
-	static inline uint32 Random(void) { return RandomMT(); }
+	static inline uint32 Random() { return RandomMT(); }
 	uint RandomRange(uint max);
 #else
 
@@ -94,33 +94,33 @@
 	#define RandomRange(max) DoRandomRange(max, __LINE__, __FILE__)
 	uint DoRandomRange(uint max, int line, const char *file);
 #else
-	uint32 Random(void);
+	uint32 Random();
 	uint RandomRange(uint max);
 #endif
 #endif // MERSENNE_TWISTER
 
 static inline TileIndex RandomTileSeed(uint32 r) { return TILE_MASK(r); }
-static inline TileIndex RandomTile(void) { return TILE_MASK(Random()); }
+static inline TileIndex RandomTile() { return TILE_MASK(Random()); }
 
 
-uint32 InteractiveRandom(void); // Used for random sequences that are not the same on the other end of the multiplayer link
+uint32 InteractiveRandom(); // Used for random sequences that are not the same on the other end of the multiplayer link
 uint InteractiveRandomRange(uint max);
 
 /* texteff.cpp */
-void MoveAllTextEffects(void);
+void MoveAllTextEffects();
 void AddTextEffect(StringID msg, int x, int y, uint16 duration);
-void InitTextEffects(void);
+void InitTextEffects();
 void DrawTextEffects(DrawPixelInfo *dpi);
 
-void InitTextMessage(void);
-void DrawTextMessage(void);
+void InitTextMessage();
+void DrawTextMessage();
 void CDECL AddTextMessage(uint16 color, uint8 duration, const char *message, ...);
-void UndrawTextMessage(void);
+void UndrawTextMessage();
 
 bool AddAnimatedTile(TileIndex tile);
 void DeleteAnimatedTile(TileIndex tile);
-void AnimateAnimatedTiles(void);
-void InitializeAnimatedTiles(void);
+void AnimateAnimatedTiles();
+void InitializeAnimatedTiles();
 
 /* tunnelbridge_cmd.cpp */
 bool CheckBridge_Stuff(byte bridge_type, uint bridge_len);
@@ -128,7 +128,7 @@
 int CalcBridgeLenCostFactor(int x);
 
 /* misc_cmd.cpp */
-void PlaceTreesRandomly(void);
+void PlaceTreesRandomly();
 
 void InitializeLandscapeVariables(bool only_constants);
 
@@ -142,7 +142,7 @@
 #define AllocateNameUnique(name, skip) RealAllocateName(name, skip, true)
 #define AllocateName(name, skip) RealAllocateName(name, skip, false)
 StringID RealAllocateName(const char *name, byte skip, bool check_double);
-void ConvertNameArray(void);
+void ConvertNameArray();
 
 /* misc functions */
 void MarkTileDirty(int x, int y);
@@ -157,7 +157,7 @@
 void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, byte mode, Window *w);
 void SetObjectToPlace(CursorID icon, SpriteID pal, byte mode, WindowClass window_class, WindowNumber window_num);
 
-void ResetObjectToPlace(void);
+void ResetObjectToPlace();
 
 bool ScrollWindowTo(int x, int y, Window * w);
 
@@ -181,12 +181,12 @@
 void ShowHighscoreTable(int difficulty, int8 rank);
 TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng);
 
-void AfterLoadTown(void);
-void UpdatePatches(void);
-void AskExitGame(void);
-void AskExitToGameMenu(void);
+void AfterLoadTown();
+void UpdatePatches();
+void AskExitGame();
+void AskExitToGameMenu();
 
-void RedrawAutosave(void);
+void RedrawAutosave();
 
 StringID RemapOldStringID(StringID s);
 
@@ -203,19 +203,15 @@
 void ShowSaveLoadDialog(int mode);
 
 /* callback from drivers that is called if the game size changes dynamically */
-void GameSizeChanged(void);
+void GameSizeChanged();
 bool FileExists(const char *filename);
-bool ReadLanguagePack(int index);
-void InitializeLanguagePacks(void);
 const char *GetCurrentLocale(const char *param);
 void *ReadFileToMem(const char *filename, size_t *lenp, size_t maxsize);
 
-void LoadFromConfig(void);
-void SaveToConfig(void);
-void CheckConfig(void);
+void LoadFromConfig();
+void SaveToConfig();
+void CheckConfig();
 int ttd_main(int argc, char* argv[]);
-void HandleExitGameRequest(void);
-
-void DeterminePaths(void);
+void HandleExitGameRequest();
 
 #endif /* FUNCTIONS_H */
--- a/src/genworld.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/genworld.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -20,19 +20,19 @@
 #include "date.h"
 
 void GenerateLandscape(byte mode);
-void GenerateClearTile(void);
-void GenerateIndustries(void);
-void GenerateUnmovables(void);
-bool GenerateTowns(void);
-void GenerateTrees(void);
+void GenerateClearTile();
+void GenerateIndustries();
+void GenerateUnmovables();
+bool GenerateTowns();
+void GenerateTrees();
 
-void StartupEconomy(void);
-void StartupPlayers(void);
-void StartupDisasters(void);
+void StartupEconomy();
+void StartupPlayers();
+void StartupDisasters();
 
 void InitializeGame(int mode, uint size_x, uint size_y);
 
-void ConvertGroundTilesIntoWaterTiles(void);
+void ConvertGroundTilesIntoWaterTiles();
 
 /* Please only use this variable in genworld.h and genworld.c and
  *  nowhere else. For speed improvements we need it to be global, but
@@ -58,7 +58,7 @@
  *  writing in a thread, it can cause damaged data (reading and writing the
  *  same tile at the same time).
  */
-bool IsGeneratingWorldReadyForPaint(void)
+bool IsGeneratingWorldReadyForPaint()
 {
 	/* If we are in quit_thread mode, ignore this and always return false. This
 	 *  forces the screen to not be drawn, and the GUI not to wait for a draw. */
@@ -70,7 +70,7 @@
 /**
  * Tells if the world generation is done in a thread or not.
  */
-bool IsGenerateWorldThreaded(void)
+bool IsGenerateWorldThreaded()
 {
 	return _gw.threaded && !_gw.quit_thread;
 }
@@ -180,7 +180,7 @@
  * This will wait for the thread to finish up his work. It will not continue
  *  till the work is done.
  */
-void WaitTillGeneratedWorld(void)
+void WaitTillGeneratedWorld()
 {
 	if (_gw.thread == NULL) return;
 	_gw.quit_thread = true;
@@ -192,7 +192,7 @@
 /**
  * Initializes the abortion process
  */
-void AbortGeneratingWorld(void)
+void AbortGeneratingWorld()
 {
 	_gw.abort = true;
 }
@@ -200,7 +200,7 @@
 /**
  * Is the generation being aborted?
  */
-bool IsGeneratingWorldAborted(void)
+bool IsGeneratingWorldAborted()
 {
 	return _gw.abort;
 }
@@ -208,7 +208,7 @@
 /**
  * Really handle the abortion, i.e. clean up some of the mess
  */
-void HandleGeneratingWorldAbortion(void)
+void HandleGeneratingWorldAbortion()
 {
 	/* Clean up - in SE create an empty map, otherwise, go to intro menu */
 	_switch_mode = (_game_mode == GM_EDITOR) ? SM_EDITOR : SM_MENU;
--- a/src/genworld.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/genworld.h	Mon Mar 19 12:38:16 2007 +0000
@@ -26,10 +26,10 @@
 	GENERATE_NEW_SEED = (uint)-1, ///< Create a new random seed
 };
 
-typedef void gw_done_proc(void);
-typedef void gw_abort_proc(void);
+typedef void gw_done_proc();
+typedef void gw_abort_proc();
 
-typedef struct gw_info {
+struct gw_info {
 	bool active;           ///< Is generating world active
 	bool abort;            ///< Whether to abort the thread ASAP
 	bool wait_for_draw;    ///< Are we waiting on a draw event
@@ -42,14 +42,14 @@
 	gw_done_proc *proc;    ///< Proc that is called when done (can be NULL)
 	gw_abort_proc *abortp; ///< Proc that is called when aborting (can be NULL)
 	OTTDThread *thread;    ///< The thread we are in (can be NULL)
-} gw_info;
+};
 
 #ifdef TEMPORARY_OTTDTHREAD_DEFINITION
 #undef OTTDThread
 #undef TEMPORARY_OTTDTHREAD_DEFINITION
 #endif
 
-typedef enum gwp_classes {
+enum gwp_class {
 	GWP_MAP_INIT,    ///< Initialize/allocate the map, start economy
 	GWP_LANDSCAPE,   ///< Create the landscape
 	GWP_ROUGH_ROCKY, ///< Make rough and rocky areas
@@ -61,12 +61,12 @@
 	GWP_RUNTILELOOP, ///< Runs the tile loop 1280 times to make snow etc
 	GWP_GAME_START,  ///< Really prepare to start the game
 	GWP_CLASS_COUNT
-} gwp_class;
+};
 
 /**
  * Check if we are currently in the process of generating a world.
  */
-static inline bool IsGeneratingWorld(void)
+static inline bool IsGeneratingWorld()
 {
 	extern gw_info _gw;
 
@@ -75,23 +75,23 @@
 
 /* genworld.cpp */
 void SetGeneratingWorldPaintStatus(bool status);
-bool IsGeneratingWorldReadyForPaint(void);
-bool IsGenerateWorldThreaded(void);
+bool IsGeneratingWorldReadyForPaint();
+bool IsGenerateWorldThreaded();
 void GenerateWorldSetCallback(gw_done_proc *proc);
 void GenerateWorldSetAbortCallback(gw_abort_proc *proc);
-void WaitTillGeneratedWorld(void);
+void WaitTillGeneratedWorld();
 void GenerateWorld(int mode, uint size_x, uint size_y);
-void AbortGeneratingWorld(void);
-bool IsGeneratingWorldAborted(void);
-void HandleGeneratingWorldAbortion(void);
+void AbortGeneratingWorld();
+bool IsGeneratingWorldAborted();
+void HandleGeneratingWorldAbortion();
 
 /* genworld_gui.cpp */
 void SetGeneratingWorldProgress(gwp_class cls, uint total);
 void IncreaseGeneratingWorldProgress(gwp_class cls);
-void PrepareGenerateWorldProgress(void);
-void ShowGenerateWorldProgress(void);
+void PrepareGenerateWorldProgress();
+void ShowGenerateWorldProgress();
 void StartNewGameWithoutGUI(uint seed);
-void ShowCreateScenario(void);
-void StartScenarioEditor(void);
+void ShowCreateScenario();
+void StartScenarioEditor();
 
 #endif /* GENWORLD_H */
--- a/src/genworld_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/genworld_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -29,12 +29,12 @@
 /**
  * In what 'mode' the GenerateLandscapeWindowProc is.
  */
-typedef enum glwp_modes {
+enum glwp_modes {
 	GLWP_GENERATE,
 	GLWP_HEIGHTMAP,
 	GLWP_SCENARIO,
 	GLWP_END
-} glwp_modes;
+};
 
 static uint _heightmap_x = 0;
 static uint _heightmap_y = 0;
@@ -533,17 +533,17 @@
 	if (w != NULL) InvalidateWindow(WC_GENERATE_LANDSCAPE, mode);
 }
 
-void ShowGenerateLandscape(void)
+void ShowGenerateLandscape()
 {
 	_ShowGenerateLandscape(GLWP_GENERATE);
 }
 
-void ShowHeightmapLoad(void)
+void ShowHeightmapLoad()
 {
 	_ShowGenerateLandscape(GLWP_HEIGHTMAP);
 }
 
-void StartScenarioEditor(void)
+void StartScenarioEditor()
 {
 	StartGeneratingLandscape(GLWP_SCENARIO);
 }
@@ -726,7 +726,7 @@
 	CreateScenarioWndProc,
 };
 
-void ShowCreateScenario(void)
+void ShowCreateScenario()
 {
 	DeleteWindowByClass(WC_GENERATE_LANDSCAPE);
 	AllocateWindowDescFront(&_create_scenario_desc, GLWP_SCENARIO);
@@ -740,13 +740,13 @@
 {   WIDGETS_END},
 };
 
-typedef struct tp_info {
+struct tp_info {
 	uint percent;
 	StringID cls;
 	uint current;
 	uint total;
 	int timer;
-} tp_info;
+};
 
 static tp_info _tp;
 
@@ -809,7 +809,7 @@
 /**
  * Initializes the progress counters to the starting point.
  */
-void PrepareGenerateWorldProgress(void)
+void PrepareGenerateWorldProgress()
 {
 	_tp.cls   = STR_WORLD_GENERATION;
 	_tp.current = 0;
@@ -821,7 +821,7 @@
 /**
  * Show the window where a user can follow the process of the map generation.
  */
-void ShowGenerateWorldProgress(void)
+void ShowGenerateWorldProgress()
 {
 	AllocateWindowDescFront(&_show_terrain_progress_desc, 0);
 }
--- a/src/gfx.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/gfx.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -37,18 +37,18 @@
 bool _exit_game;
 bool _networking;         ///< are we in networking mode?
 byte _game_mode;
-byte _pause;
+byte _pause_game;
 int _pal_first_dirty;
 int _pal_last_dirty;
 
 Colour _cur_palette[256];
 byte _stringwidth_table[FS_END][224];
 
-typedef enum BlitterModes {
+enum BlitterMode {
 	BM_NORMAL,
 	BM_COLOUR_REMAP,
 	BM_TRANSPARENT,
-} BlitterMode;
+};
 
 static void GfxMainBlitter(const Sprite *sprite, int x, int y, BlitterMode mode);
 
@@ -718,7 +718,7 @@
 	}
 }
 
-typedef struct BlitterParams {
+struct BlitterParams {
 	int start_x, start_y;
 	const byte *sprite;
 	Pixel *dst;
@@ -726,7 +726,7 @@
 	int width, height;
 	int width_org;
 	int pitch;
-} BlitterParams;
+};
 
 static void GfxBlitTileZoomIn(BlitterParams *bp)
 {
@@ -1524,9 +1524,9 @@
 	}
 }
 
-void DoPaletteAnimations(void);
+void DoPaletteAnimations();
 
-void GfxInitPalettes(void)
+void GfxInitPalettes()
 {
 	memcpy(_cur_palette, _palettes[_use_dos_palette ? 1 : 0], sizeof(_cur_palette));
 
@@ -1538,7 +1538,7 @@
 #define EXTR(p, q) (((uint16)(_timer_counter * (p)) * (q)) >> 16)
 #define EXTR2(p, q) (((uint16)(~_timer_counter * (p)) * (q)) >> 16)
 
-void DoPaletteAnimations(void)
+void DoPaletteAnimations()
 {
 	const Colour *s;
 	Colour *d;
@@ -1649,7 +1649,7 @@
 }
 
 
-void LoadStringWidthTable(void)
+void LoadStringWidthTable()
 {
 	uint i;
 
@@ -1678,7 +1678,7 @@
 }
 
 
-void ScreenSizeChanged(void)
+void ScreenSizeChanged()
 {
 	/* check the dirty rect */
 	if (_invalid_rect.right >= _screen.width) _invalid_rect.right = _screen.width;
@@ -1688,7 +1688,7 @@
 	_cursor.visible = false;
 }
 
-void UndrawMouseCursor(void)
+void UndrawMouseCursor()
 {
 	if (_cursor.visible) {
 		_cursor.visible = false;
@@ -1701,7 +1701,7 @@
 	}
 }
 
-void DrawMouseCursor(void)
+void DrawMouseCursor()
 {
 	int x;
 	int y;
@@ -1794,7 +1794,7 @@
 	_video_driver->make_dirty(left, top, right - left, bottom - top);
 }
 
-void DrawDirtyBlocks(void)
+void DrawDirtyBlocks()
 {
 	byte *b = _dirty_blocks;
 	const int w = ALIGN(_screen.width, 64);
@@ -1916,7 +1916,7 @@
 	} while (--height != 0);
 }
 
-void MarkWholeScreenDirty(void)
+void MarkWholeScreenDirty()
 {
 	SetDirtyBlocks(0, 0, _screen.width, _screen.height);
 }
@@ -1995,7 +1995,7 @@
 	cv->dirty = true;
 }
 
-static void SwitchAnimatedCursor(void)
+static void SwitchAnimatedCursor()
 {
 	const AnimCursor *cur = _cursor.animate_cur;
 
@@ -2007,7 +2007,7 @@
 	_cursor.animate_cur     = cur + 1;
 }
 
-void CursorTick(void)
+void CursorTick()
 {
 	if (_cursor.animate_timeout != 0 && --_cursor.animate_timeout == 0)
 		SwitchAnimatedCursor();
--- a/src/gfx.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/gfx.h	Mon Mar 19 12:38:16 2007 +0000
@@ -5,6 +5,7 @@
 #ifndef GFX_H
 #define GFX_H
 
+#include "openttd.h"
 
 enum WindowKeyCodes {
 	WKC_SHIFT = 0x8000,
@@ -86,20 +87,20 @@
 	GM_EDITOR
 };
 
-void GameLoop(void);
+void GameLoop();
 
-void CreateConsole(void);
+void CreateConsole();
 
 typedef int32 CursorID;
 typedef byte Pixel;
 
-typedef struct Point {
+struct Point {
 	int x,y;
-} Point;
+};
 
-typedef struct Rect {
+struct Rect {
 	int left,top,right,bottom;
-} Rect;
+};
 
 /** A single sprite of a list of animated cursors */
 struct AnimCursor {
@@ -108,13 +109,19 @@
 	byte display_time; ///< Amount of ticks this sprite will be shown
 };
 
-typedef struct CursorVars {
+struct CursorVars {
 	Point pos, size, offs, delta; ///< position, size, offset from top-left, and movement
 	Point draw_pos, draw_size;    ///< position and size bounding-box for drawing
 	SpriteID sprite; ///< current image of cursor
 	SpriteID pal;
 
 	int wheel;       ///< mouse wheel movement
+
+	/* We need two different vars to keep track of how far the scrollwheel moved.
+	 * OSX uses this for scrolling around the map. */
+	int v_wheel;
+	int h_wheel;
+
 	const AnimCursor *animate_list; ///< in case of animated cursor, list of frames
 	const AnimCursor *animate_cur;  ///< in case of animated cursor, current frame
 	uint animate_timeout;           ///< in case of animated cursor, number of ticks to show the current cursor
@@ -123,20 +130,20 @@
 	bool dirty;      ///< the rect occupied by the mouse is dirty (redraw)
 	bool fix_at;     ///< mouse is moving, but cursor is not (used for scrolling)
 	bool in_window;  ///< mouse inside this window, determines drawing logic
-} CursorVars;
+};
 
-typedef struct DrawPixelInfo {
+struct DrawPixelInfo {
 	Pixel *dst_ptr;
 	int left, top, width, height;
 	int pitch;
 	uint16 zoom;
-} DrawPixelInfo;
+};
 
-typedef struct Colour {
+struct Colour {
 	byte r;
 	byte g;
 	byte b;
-} Colour;
+};
 
 
 
@@ -156,7 +163,7 @@
 extern bool _exit_game;
 extern bool _networking;         ///< are we in networking mode?
 extern byte _game_mode;
-extern byte _pause;
+extern byte _pause_game;
 
 extern int _pal_first_dirty;
 extern int _pal_last_dirty;
@@ -166,27 +173,27 @@
 extern Colour _cur_palette[256];
 
 void HandleKeypress(uint32 key);
-void HandleMouseEvents(void);
+void HandleMouseEvents();
 void CSleep(int milliseconds);
-void UpdateWindows(void);
+void UpdateWindows();
 
-uint32 InteractiveRandom(void); //< Used for random sequences that are not the same on the other end of the multiplayer link
+uint32 InteractiveRandom(); //< Used for random sequences that are not the same on the other end of the multiplayer link
 uint InteractiveRandomRange(uint max);
-void DrawTextMessage(void);
-void DrawMouseCursor(void);
-void ScreenSizeChanged(void);
-void HandleExitGameRequest(void);
-void GameSizeChanged(void);
-void UndrawMouseCursor(void);
+void DrawTextMessage();
+void DrawMouseCursor();
+void ScreenSizeChanged();
+void HandleExitGameRequest();
+void GameSizeChanged();
+void UndrawMouseCursor();
 
 #include "helpers.hpp"
 
-typedef enum FontSizes {
+enum FontSize {
 	FS_NORMAL,
 	FS_SMALL,
 	FS_LARGE,
 	FS_END,
-} FontSize;
+};
 
 DECLARE_POSTFIX_INCREMENT(FontSize);
 
@@ -222,14 +229,14 @@
 
 BoundingRect GetStringBoundingBox(const char *str);
 uint32 FormatStringLinebreaks(char *str, int maxw);
-void LoadStringWidthTable(void);
+void LoadStringWidthTable();
 void DrawStringMultiCenter(int x, int y, StringID str, int maxw);
 uint DrawStringMultiLine(int x, int y, StringID str, int maxw);
-void DrawDirtyBlocks(void);
+void DrawDirtyBlocks();
 void SetDirtyBlocks(int left, int top, int right, int bottom);
-void MarkWholeScreenDirty(void);
+void MarkWholeScreenDirty();
 
-void GfxInitPalettes(void);
+void GfxInitPalettes();
 
 bool FillDrawPixelInfo(DrawPixelInfo* n, int left, int top, int width, int height);
 
@@ -239,10 +246,10 @@
 void SetMouseCursor(CursorID cursor);
 void SetMouseCursor(SpriteID sprite, SpriteID pal);
 void SetAnimatedMouseCursor(const AnimCursor *table);
-void CursorTick(void);
-void DrawMouseCursor(void);
-void ScreenSizeChanged(void);
-void UndrawMouseCursor(void);
+void CursorTick();
+void DrawMouseCursor();
+void ScreenSizeChanged();
+void UndrawMouseCursor();
 bool ChangeResInGame(int w, int h);
 void SortResolutions(int count);
 void ToggleFullScreen(bool fs);
@@ -292,9 +299,9 @@
 
 VARDEF bool _use_dos_palette;
 
-typedef enum StringColorFlags {
+enum StringColorFlags {
 	IS_PALETTE_COLOR = 0x100, ///< color value is already a real palette color index, not an index of a StringColor
-} StringColorFlags;
+};
 
 
 #ifdef _DEBUG
--- a/src/gfxinit.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/gfxinit.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -18,15 +18,15 @@
 #include "fontcache.h"
 #include <string.h>
 
-typedef struct MD5File {
+struct MD5File {
 	const char * filename;     ///< filename
 	md5_byte_t hash[16];       ///< md5 sum of the file
-} MD5File;
+};
 
-typedef struct FileList {
+struct FileList {
 	MD5File basic[4];          ///< grf files that always have to be loaded
 	MD5File landscape[3];      ///< landscape specific grf files
-} FileList;
+};
 
 enum {
 	SKIP = 0xFFFE,
@@ -162,7 +162,7 @@
  * If neither are found, Windows palette is assumed.
  *
  * (Note: Also checks sample.cat for corruption) */
-void CheckExternalFiles(void)
+void CheckExternalFiles()
 {
 	uint i;
 	/* count of files from this version */
@@ -340,7 +340,7 @@
 };
 
 
-static void LoadSpriteTables(void)
+static void LoadSpriteTables()
 {
 	const FileList* files = _use_dos_palette ? &files_dos : &files_win;
 	uint load_index;
@@ -400,7 +400,7 @@
 }
 
 
-void GfxLoadSprites(void)
+void GfxLoadSprites()
 {
 	DEBUG(sprite, 2, "Loading sprite set %d", _opt.landscape);
 
--- a/src/gfxinit.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/gfxinit.h	Mon Mar 19 12:38:16 2007 +0000
@@ -5,7 +5,7 @@
 #ifndef GFXINIT_H
 #define GFXINIT_H
 
-void CheckExternalFiles(void);
-void GfxLoadSprites(void);
+void CheckExternalFiles();
+void GfxLoadSprites();
 
 #endif /* GFXINIT_H */
--- a/src/graph_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/graph_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -43,7 +43,7 @@
 static const int64 INVALID_DATAPOINT     = INT64_MAX; // Value used for a datapoint that shouldn't be drawn.
 static const uint  INVALID_DATAPOINT_POS = UINT_MAX;  // Used to determine if the previous point was drawn.
 
-typedef struct GraphDrawer {
+struct GraphDrawer {
 	uint excluded_data; ///< bitmask of the datasets that shouldn't be displayed.
 	byte num_dataset;
 	byte num_on_x_axis;
@@ -65,7 +65,7 @@
 	StringID format_str_y_axis;
 	byte colors[GRAPH_MAX_DATASETS];
 	int64 cost[GRAPH_MAX_DATASETS][24]; ///< last 2 years
-} GraphDrawer;
+};
 
 static void DrawGraph(const GraphDrawer *gw)
 {
@@ -316,7 +316,7 @@
 	GraphLegendWndProc
 };
 
-static void ShowGraphLegend(void)
+static void ShowGraphLegend()
 {
 	AllocateWindowDescFront(&_graph_legend_desc, 0);
 }
@@ -415,7 +415,7 @@
 };
 
 
-void ShowOperatingProfitGraph(void)
+void ShowOperatingProfitGraph()
 {
 	if (AllocateWindowDescFront(&_operating_profit_desc, 0)) {
 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
@@ -483,7 +483,7 @@
 	IncomeGraphWndProc
 };
 
-void ShowIncomeGraph(void)
+void ShowIncomeGraph()
 {
 	if (AllocateWindowDescFront(&_income_graph_desc, 0)) {
 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
@@ -550,7 +550,7 @@
 	DeliveredCargoGraphWndProc
 };
 
-void ShowDeliveredCargoGraph(void)
+void ShowDeliveredCargoGraph()
 {
 	if (AllocateWindowDescFront(&_delivered_cargo_graph_desc, 0)) {
 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
@@ -619,7 +619,7 @@
 	PerformanceHistoryWndProc
 };
 
-void ShowPerformanceHistoryGraph(void)
+void ShowPerformanceHistoryGraph()
 {
 	if (AllocateWindowDescFront(&_performance_history_desc, 0)) {
 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
@@ -686,7 +686,7 @@
 	CompanyValueGraphWndProc
 };
 
-void ShowCompanyValueGraph(void)
+void ShowCompanyValueGraph()
 {
 	if (AllocateWindowDescFront(&_company_value_graph_desc, 0)) {
 		InvalidateWindow(WC_GRAPH_LEGEND, 0);
@@ -784,7 +784,7 @@
 };
 
 
-void ShowCargoPaymentRates(void)
+void ShowCargoPaymentRates()
 {
 	Window *w = AllocateWindowDescFront(&_cargo_payment_rates_desc, 0);
 	if (w == NULL) return;
@@ -799,8 +799,9 @@
 	ResizeWindow(w, 0, num_active * 8);
 
 	/* Add widgets for each cargo type */
-	w->widget_count = 3 + num_active;
-	w->widget = ReallocT(w->widget, w->widget_count);
+	w->widget_count += num_active;
+	w->widget = ReallocT(w->widget, w->widget_count + 1);
+	w->widget[w->widget_count].type = WWT_LAST;
 
 	/* Set the properties of each widget */
 	for (uint i = 0; i != num_active; i++) {
@@ -905,7 +906,7 @@
 	CompanyLeagueWndProc
 };
 
-void ShowCompanyLeagueTable(void)
+void ShowCompanyLeagueTable()
 {
 	AllocateWindowDescFront(&_company_league_desc,0);
 }
@@ -1144,7 +1145,7 @@
 	PerformanceRatingDetailWndProc
 };
 
-void ShowPerformanceRatingDetail(void)
+void ShowPerformanceRatingDetail()
 {
 	AllocateWindowDescFront(&_performance_rating_detail_desc, 0);
 }
--- a/src/gui.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/gui.h	Mon Mar 19 12:38:16 2007 +0000
@@ -10,31 +10,31 @@
 #include "string.h"
 
 /* main_gui.cpp */
-void SetupColorsAndInitialWindow(void);
+void SetupColorsAndInitialWindow();
 void CcPlaySound10(bool success, TileIndex tile, uint32 p1, uint32 p2);
 void CcBuildCanal(bool success, TileIndex tile, uint32 p1, uint32 p2);
 void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2);
 
 /* settings_gui.cpp */
-void ShowGameOptions(void);
-void ShowGameDifficulty(void);
-void ShowPatchesSelection(void);
+void ShowGameOptions();
+void ShowGameDifficulty();
+void ShowPatchesSelection();
 void DrawArrowButtons(int x, int y, int ctab, byte state, bool clickable_left, bool clickable_right);
 
 /* graph_gui.cpp */
-void ShowOperatingProfitGraph(void);
-void ShowIncomeGraph(void);
-void ShowDeliveredCargoGraph(void);
-void ShowPerformanceHistoryGraph(void);
-void ShowCompanyValueGraph(void);
-void ShowCargoPaymentRates(void);
-void ShowCompanyLeagueTable(void);
-void ShowPerformanceRatingDetail(void);
+void ShowOperatingProfitGraph();
+void ShowIncomeGraph();
+void ShowDeliveredCargoGraph();
+void ShowPerformanceHistoryGraph();
+void ShowCompanyValueGraph();
+void ShowCargoPaymentRates();
+void ShowCompanyLeagueTable();
+void ShowPerformanceRatingDetail();
 
 /* news_gui.cpp */
-void ShowLastNewsMessage(void);
-void ShowMessageOptions(void);
-void ShowMessageHistory(void);
+void ShowLastNewsMessage();
+void ShowMessageOptions();
+void ShowMessageHistory();
 
 /* rail_gui.cpp */
 void ShowBuildRailToolbar(RailType railtype, int button);
@@ -46,23 +46,23 @@
 void ShowOrdersWindow(const Vehicle *v);
 
 /* road_gui.cpp */
-void ShowBuildRoadToolbar(void);
-void ShowBuildRoadScenToolbar(void);
+void ShowBuildRoadToolbar();
+void ShowBuildRoadScenToolbar();
 void ShowRoadVehViewWindow(const Vehicle *v);
 
 /* dock_gui.cpp */
-void ShowBuildDocksToolbar(void);
+void ShowBuildDocksToolbar();
 void ShowShipViewWindow(const Vehicle *v);
 
 /* aircraft_gui.cpp */
-void ShowBuildAirToolbar(void);
+void ShowBuildAirToolbar();
 
 /* terraform_gui.cpp */
 void ShowTerraformToolbar(Window *link = NULL);
 
 /* tgp_gui.cpp */
-void ShowGenerateLandscape(void);
-void ShowHeightmapLoad(void);
+void ShowGenerateLandscape();
+void ShowHeightmapLoad();
 
 void PlaceProc_DemolishArea(TileIndex tile);
 void PlaceProc_LevelLand(TileIndex tile);
@@ -78,13 +78,13 @@
 };
 
 /* misc_gui.cpp */
-void PlaceLandBlockInfo(void);
-void ShowAboutWindow(void);
-void ShowBuildTreesToolbar(void);
-void ShowBuildTreesScenToolbar(void);
-void ShowTownDirectory(void);
-void ShowIndustryDirectory(void);
-void ShowSubsidiesList(void);
+void PlaceLandBlockInfo();
+void ShowAboutWindow();
+void ShowBuildTreesToolbar();
+void ShowBuildTreesScenToolbar();
+void ShowTownDirectory();
+void ShowIndustryDirectory();
+void ShowSubsidiesList();
 void ShowPlayerStations(PlayerID player);
 void ShowPlayerFinances(PlayerID player);
 void ShowPlayerCompany(PlayerID player);
@@ -95,13 +95,13 @@
 void DrawStationCoverageAreaText(int sx, int sy, uint mask,int rad);
 void CheckRedrawStationCoverage(const Window *w);
 
-void ShowSmallMap(void);
-void ShowExtraViewPortWindow(void);
+void ShowSmallMap();
+void ShowExtraViewPortWindow();
 void SetVScrollCount(Window *w, int num);
 void SetVScroll2Count(Window *w, int num);
 void SetHScrollCount(Window *w, int num);
 
-void ShowCheatWindow(void);
+void ShowCheatWindow();
 
 void DrawEditBox(Window *w, querystr_d *string, int wid);
 void HandleEditBox(Window *w, querystr_d *string, int wid);
@@ -116,7 +116,7 @@
 void InitializeTextBuffer(Textbuf *tb, const char *buf, uint16 maxlength, uint16 maxwidth);
 void UpdateTextBufferSize(Textbuf *tb);
 
-void BuildFileList(void);
+void BuildFileList();
 void SetFiosType(const byte fiostype);
 
 /* FIOS_TYPE_FILE, FIOS_TYPE_OLDFILE etc. different colours */
@@ -125,10 +125,10 @@
 /* bridge_gui.cpp */
 void ShowBuildBridgeWindow(uint start, uint end, byte type);
 
-void ShowBuildIndustryWindow(void);
+void ShowBuildIndustryWindow();
 void ShowQueryString(StringID str, StringID caption, uint maxlen, uint maxwidth, Window *parent, CharSetFilter afilter);
 void ShowQuery(StringID caption, StringID message, Window *w, void (*callback)(Window*, bool));
-void ShowMusicWindow(void);
+void ShowMusicWindow();
 
 /* main_gui.cpp */
 void HandleOnEditText(const char *str);
@@ -136,6 +136,6 @@
 VARDEF PlaceProc *_place_proc;
 
 /* vehicle_gui.cpp */
-void InitializeGUI(void);
+void InitializeGUI();
 
 #endif /* GUI_H */
--- a/src/hal.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/hal.h	Mon Mar 19 12:38:16 2007 +0000
@@ -5,34 +5,34 @@
 #ifndef HAL_H
 #define HAL_H
 
-typedef struct {
+struct HalCommonDriver {
 	const char *(*start)(const char * const *parm);
-	void (*stop)(void);
-} HalCommonDriver;
+	void (*stop)();
+};
 
-typedef struct {
+struct HalVideoDriver {
 	const char *(*start)(const char * const *parm);
-	void (*stop)(void);
+	void (*stop)();
 	void (*make_dirty)(int left, int top, int width, int height);
-	void (*main_loop)(void);
+	void (*main_loop)();
 	bool (*change_resolution)(int w, int h);
 	void (*toggle_fullscreen)(bool fullscreen);
-} HalVideoDriver;
+};
 
-typedef struct {
+struct HalSoundDriver {
 	const char *(*start)(const char * const *parm);
-	void (*stop)(void);
-} HalSoundDriver;
+	void (*stop)();
+};
 
-typedef struct {
+struct HalMusicDriver {
 	const char *(*start)(const char * const *parm);
-	void (*stop)(void);
+	void (*stop)();
 
 	void (*play_song)(const char *filename);
-	void (*stop_song)(void);
-	bool (*is_song_playing)(void);
+	void (*stop_song)();
+	bool (*is_song_playing)();
 	void (*set_volume)(byte vol);
-} HalMusicDriver;
+};
 
 extern HalMusicDriver *_music_driver;
 extern HalSoundDriver *_sound_driver;
--- a/src/heightmap.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/heightmap.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -353,7 +353,7 @@
  * This function takes care of the fact that land in OpenTTD can never differ
  * more than 1 in height
  */
-static void FixSlopes(void)
+static void FixSlopes()
 {
 	uint width, height;
 	uint row, col;
--- a/src/industry.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/industry.h	Mon Mar 19 12:38:16 2007 +0000
@@ -12,13 +12,14 @@
 
 enum {
 	INVALID_INDUSTRY = 0xFFFF,
+	INDUTILE_NOANIM = 0xFF,        ///< flag to mark industry tiles as having no animation
 };
 
-typedef enum IndustryLifeTypes {
+enum IndustryLifeType {
 	INDUSTRYLIFE_NOT_CLOSABLE,     ///< Industry can never close
 	INDUSTRYLIFE_PRODUCTION,       ///< Industry can close and change of production
 	INDUSTRYLIFE_CLOSABLE,         ///< Industry can only close (no production change)
-} IndustryLifeType;
+};
 
 /**
  * Defines the internal data of a functionnal industry
@@ -49,15 +50,15 @@
 	IndustryID index;               ///< index of the industry in the pool of industries
 };
 
-typedef struct IndustryTileTable {
+struct IndustryTileTable {
 	TileIndexDiffC ti;
 	IndustryGfx gfx;
-} IndustryTileTable;
+};
 
 /**
  * Defines the data structure for constructing industry.
  */
-typedef struct IndustrySpec {
+struct IndustrySpec {
 	const IndustryTileTable *const *table;///< List of the tiles composing the industry
 	byte num_table;                       ///< Number of elements in the table
 	byte cost_multiplier;                 ///< Base cost multiplier*/
@@ -71,18 +72,23 @@
 	IndustryLifeType life_type;           ///< This is also known as Industry production flag, in newgrf specs
 	byte climate_availability;            ///< Bitmask, giving landscape enums as bit position
 	StringID name;                        ///< Displayed name of the industry
+	StringID new_industry_text;           ///< Message appearing when the industry is built
 	StringID closure_text;                ///< Message appearing when the industry closes
 	StringID production_up_text;          ///< Message appearing when the industry's production is increasing
 	StringID production_down_text;        ///< Message appearing when the industry's production is decreasing
-} IndustrySpec;
+};
 
 /**
  * Defines the data structure of each indivudual tile of an industry.
  */
-typedef struct IndustryTileSpec {
+struct IndustryTileSpec {
 	CargoID accepts_cargo[3];             ///< Cargo accepted by this tile
 	Slope slopes_refused;                 ///< slope pattern on which this tile cannot be built
-} IndustryTileSpec;
+	byte anim_production;                 ///< Animation frame to start when goods are produced
+	byte anim_next;                       ///< Next frame in an animation
+	bool anim_state;                      ///< When true, the tile has to be drawn using the animation
+                                         ///< state instead of the construction state
+};
 
 const IndustrySpec *GetIndustrySpec(IndustryType thistype);    ///< Array of industries default data
 const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx);  ///< Array of industry tiles default data
@@ -111,7 +117,7 @@
 
 VARDEF int _total_industries; //general counter
 
-static inline IndustryID GetMaxIndustryIndex(void)
+static inline IndustryID GetMaxIndustryIndex()
 {
 	/* TODO - This isn't the real content of the function, but
 	 *  with the new pool-system this will be replaced with one that
@@ -121,7 +127,7 @@
 	return GetIndustryPoolSize() - 1;
 }
 
-static inline uint GetNumIndustries(void)
+static inline uint GetNumIndustries()
 {
 	return _total_industries;
 }
@@ -129,7 +135,7 @@
 /**
  * Return a random valid industry.
  */
-static inline Industry *GetRandomIndustry(void)
+static inline Industry *GetRandomIndustry()
 {
 	int num = RandomRange(GetNumIndustries());
 	IndustryID index = INVALID_INDUSTRY;
--- a/src/industry_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/industry_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -233,7 +233,7 @@
 	ind = GetIndustryByTile(ti->tile);
 
 	/* Retrieve pointer to the draw industry tile struct */
-	dits = &_industry_draw_tile_data[gfx << 2 | (_industry_section_draw_animation_state[gfx] ?
+	dits = &_industry_draw_tile_data[gfx << 2 | (GetIndustryTileSpec(gfx)->anim_state ?
 			GetIndustryAnimationState(ti->tile) & 3 :
 			GetIndustryConstructionStage(ti->tile))];
 
@@ -357,9 +357,9 @@
 		am = MoveGoodsToStation(i->xy, i->width, i->height, i->produced_cargo[0], cw);
 		i->last_mo_transported[0] += am;
 		if (am != 0) {
-			uint newgfx = _industry_produce_section[GetIndustryGfx(tile)];
+			uint newgfx = GetIndustryTileSpec(GetIndustryGfx(tile))->anim_production;
 
-			if (newgfx != 0xFF) {
+			if (newgfx != INDUTILE_NOANIM) {
 				ResetIndustryConstructionStage(tile);
 				SetIndustryCompleted(tile, true);
 				SetIndustryGfx(tile, newgfx);
@@ -645,8 +645,8 @@
 
 	TransportIndustryGoods(tile);
 
-	newgfx = _industry_section_animation_next[GetIndustryGfx(tile)];
-	if (newgfx != 255) {
+	newgfx = GetIndustryTileSpec(GetIndustryGfx(tile))->anim_next;
+	if (newgfx != INDUTILE_NOANIM) {
 		ResetIndustryConstructionStage(tile);
 		SetIndustryGfx(tile, newgfx);
 		MarkTileDirtyByTile(tile);
@@ -985,7 +985,7 @@
 	}
 }
 
-void OnTick_Industry(void)
+void OnTick_Industry()
 {
 	Industry *i;
 
@@ -1355,7 +1355,7 @@
 	return true;
 }
 
-static Industry *AllocateIndustry(void)
+static Industry *AllocateIndustry()
 {
 	Industry *i;
 
@@ -1582,7 +1582,7 @@
 	}
 }
 
-void GenerateIndustries(void)
+void GenerateIndustries()
 {
 	const byte *b;
 	uint i = 0;
@@ -1670,7 +1670,7 @@
 		SetDParam(0, i->index);
 		AddNewsItem(
 			indspec->closure_text,
-			NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ECONOMY, 0),
+			NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_OPENCLOSE, 0),
 			i->xy + TileDiffXY(1, 1), 0
 		);
 	}
@@ -1731,11 +1731,10 @@
 
 static void MaybeNewIndustry(uint32 r)
 {
-	int type;
+	int type =_new_industry_rand[_opt.landscape][GB(r, 16, 5)];
 	int j;
 	Industry *i;
-
-	type = _new_industry_rand[_opt.landscape][GB(r, 16, 5)];
+	const IndustrySpec *ind_spc = GetIndustrySpec(type);;
 
 	if (type == IT_OIL_WELL && _cur_year > 1950) return;
 	if (type == IT_OIL_RIG  && _cur_year < 1960) return;
@@ -1747,13 +1746,10 @@
 		if (--j == 0) return;
 	}
 
-	SetDParam(0, GetIndustrySpec(type)->name);
+	SetDParam(0, ind_spc->name);
 	SetDParam(1, i->town->index);
-	AddNewsItem(
-		(type != IT_FOREST && type != IT_FRUIT_PLANTATION && type != IT_RUBBER_PLANTATION && type != IT_COTTON_CANDY) ?
-			STR_482D_NEW_UNDER_CONSTRUCTION : STR_482E_NEW_BEING_PLANTED_NEAR,
-		NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ECONOMY,0), i->xy, 0
-	);
+	AddNewsItem(ind_spc->new_industry_text,
+		NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_OPENCLOSE, 0), i->xy, 0);
 }
 
 static void ChangeIndustryProduction(Industry *i)
@@ -1820,11 +1816,11 @@
 
 	if (str != STR_NULL) {
 		SetDParam(0, i->index);
-		AddNewsItem(str, NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, NT_ECONOMY, 0), i->xy + TileDiffXY(1, 1), 0);
+		AddNewsItem(str, NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_TILE, str == indspec->closure_text ? NT_OPENCLOSE : NT_ECONOMY, 0), i->xy + TileDiffXY(1, 1), 0);
 	}
 }
 
-void IndustryMonthlyLoop(void)
+void IndustryMonthlyLoop()
 {
 	Industry *i;
 	PlayerID old_player = _current_player;
@@ -1850,7 +1846,7 @@
 }
 
 
-void InitializeIndustries(void)
+void InitializeIndustries()
 {
 	CleanPool(&_Industry_pool);
 	AddBlockToPool(&_Industry_pool);
@@ -1908,7 +1904,7 @@
 	SLE_END()
 };
 
-static void Save_INDY(void)
+static void Save_INDY()
 {
 	Industry *ind;
 
@@ -1919,7 +1915,7 @@
 	}
 }
 
-static void Load_INDY(void)
+static void Load_INDY()
 {
 	int index;
 
--- a/src/industry_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/industry_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -271,7 +271,7 @@
 	},
 };
 
-void ShowBuildIndustryWindow(void)
+void ShowBuildIndustryWindow()
 {
 	if (!IsValidPlayer(_current_player)) return;
 	AllocateWindowDescFront(_industry_window_desc[_patches.build_rawmaterial_ind][_opt_ptr->landscape],0);
@@ -561,7 +561,7 @@
  * starts a new game without industries after playing a game with industries
  * the list is not populated with invalid industries from the previous game.
  */
-static void MakeSortedIndustryList(void)
+static void MakeSortedIndustryList()
 {
 	const Industry* i;
 	int n = 0;
@@ -690,7 +690,7 @@
 };
 
 
-void ShowIndustryDirectory(void)
+void ShowIndustryDirectory()
 {
 	Window *w = AllocateWindowDescFront(&_industry_directory_desc, 0);
 
--- a/src/industry_map.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/industry_map.h	Mon Mar 19 12:38:16 2007 +0000
@@ -166,10 +166,10 @@
 	_m[tile].m1 = 0;
 }
 
-typedef struct IndustryTypeSolver {
+struct IndustryTypeSolver {
 	IndustryGfx MinGfx;
 	IndustryGfx MaxGfx;
-} IndustryTypeSolver;
+};
 
 static const IndustryTypeSolver industry_gfx_Solver [IT_END] = {
 	{  0,   6}, ///< IT_COAL_MINE
--- a/src/intro_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/intro_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -99,7 +99,7 @@
 	SelectGameWndProc
 };
 
-void ShowSelectGameWindow(void)
+void ShowSelectGameWindow()
 {
 	AllocateWindowDesc(&_select_game_desc);
 }
@@ -109,7 +109,7 @@
 	if (confirmed) _exit_game = true;
 }
 
-void AskExitGame(void)
+void AskExitGame()
 {
 #if defined(_WIN32)
 		SetDParam(0, STR_0133_WINDOWS);
@@ -142,7 +142,7 @@
 	if (confirmed) _switch_mode = SM_MENU;
 }
 
-void AskExitToGameMenu(void)
+void AskExitToGameMenu()
 {
 	ShowQuery(
 		STR_0161_QUIT_GAME,
--- a/src/landscape.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/landscape.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -379,7 +379,7 @@
 #define TILELOOP_ASSERTMASK ((TILELOOP_SIZE-1) + ((TILELOOP_SIZE-1) << MapLogX()))
 #define TILELOOP_CHKMASK (((1 << (MapLogX() - TILELOOP_BITS))-1) << TILELOOP_BITS)
 
-void RunTileLoop(void)
+void RunTileLoop()
 {
 	TileIndex tile;
 	uint count;
@@ -405,7 +405,7 @@
 	_cur_tileloop_tile = tile;
 }
 
-void InitializeLandscape(void)
+void InitializeLandscape()
 {
 	uint maxx = MapMaxX();
 	uint maxy = MapMaxY();
@@ -425,7 +425,7 @@
 	for (x = 0; x < sizex; x++) MakeVoid(sizex * y + x);
 }
 
-void ConvertGroundTilesIntoWaterTiles(void)
+void ConvertGroundTilesIntoWaterTiles()
 {
 	TileIndex tile;
 	uint z;
@@ -587,7 +587,7 @@
 
 #include "table/genland.h"
 
-static void CreateDesertOrRainForest(void)
+static void CreateDesertOrRainForest()
 {
 	TileIndex tile;
 	TileIndex update_freq = MapSize() / 4;
@@ -697,15 +697,15 @@
 	if (_opt.landscape == LT_DESERT) CreateDesertOrRainForest();
 }
 
-void OnTick_Town(void);
-void OnTick_Trees(void);
-void OnTick_Station(void);
-void OnTick_Industry(void);
+void OnTick_Town();
+void OnTick_Trees();
+void OnTick_Station();
+void OnTick_Industry();
 
-void OnTick_Players(void);
-void OnTick_Train(void);
+void OnTick_Players();
+void OnTick_Train();
 
-void CallLandscapeTick(void)
+void CallLandscapeTick()
 {
 	OnTick_Town();
 	OnTick_Trees();
--- a/src/lang/american.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/american.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...owned by {STRING}
 STR_013C_CARGO                                                  :{BLACK}Cargo
@@ -590,6 +591,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arrival of first vehicle at competitor's station
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Accidents / disasters
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Company information
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Open / close of industries
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Economy changes
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Advice / information on player's vehicles
 STR_020C_NEW_VEHICLES                                           :{YELLOW}New vehicles
@@ -725,7 +727,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Place lighthouse
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Place transmitter
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Define desert area.{}Press and hold CTRL to remove it
-STR_CREATE_LAKE                                                 :{BLACK}Define water area.{}It will flood its surroundings if at sea level
+STR_CREATE_LAKE                                                 :{BLACK}Define water area.{}Make a canal, unless CTRL is held down at sea level, when it will flood the surroundings instead
 STR_0290_DELETE                                                 :{BLACK}Delete
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Delete this town completely
 STR_0292_SAVE_SCENARIO                                          :Save scenario
@@ -1088,6 +1090,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Own company
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :All companies
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Prefer team chat with <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Function of scrollwheel: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom map
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scroll map
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Off
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Map scrollwheel speed: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Max trains per player: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Max road vehicles per player: {ORANGE}{STRING}
@@ -1206,7 +1213,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Place trees of random type
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Can't build canals here...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Build canals
+STR_BUILD_CANALS_TIP                                            :{BLACK}Build canals.
 STR_LANDINFO_CANAL                                              :Canal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Can't build locks here...
@@ -2906,6 +2913,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Invalid parameter for {STRING}: parameter {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} must be loaded before {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} must be loaded after {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :the GRF file it was designed to translate
 
 STR_NEWGRF_ADD                                                  :{BLACK}Add
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Add a NewGRF file to the list
--- a/src/lang/brazilian_portuguese.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/brazilian_portuguese.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -282,6 +282,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...propriedade de {STRING}
 STR_013C_CARGO                                                  :{BLACK}Carga
@@ -592,6 +593,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Chegada do primeiro veículo à estação de um oponente
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Acidentes / desastres
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informações da empresa
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Abrir / fechar industrias
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Alterações econômicas
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Avisos / informações dos veículos do jogador
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Novos veículos
@@ -727,7 +729,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Colocar farol
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Colocar transmissor
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Define área desértica.{} Pressione e segure CTRL para removê-la
-STR_CREATE_LAKE                                                 :{BLACK}Define área de água.{} Ela irá inundar quando no nível do mar
 STR_0290_DELETE                                                 :{BLACK}Remover
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Remover esta cidade completamente
 STR_0292_SAVE_SCENARIO                                          :Salvar cenário
@@ -1090,6 +1091,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Minha empresa
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Todas as empresas
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Falar em time com <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Função do scrollwheel: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom map
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scroll map
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Desligado
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Velocidade do scrollwheel do mapa: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Máximo de trens por jogador: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Máximo de automóveis por jogador: {ORANGE}{STRING}
@@ -1208,7 +1214,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Plantar árvores de tipo aleatório
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Impossível construir canais aqui...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Construir canais
+STR_BUILD_CANALS_TIP                                            :{BLACK}Construir canais.
 STR_LANDINFO_CANAL                                              :Canal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Impossível construir eclusas aqui...
@@ -2910,6 +2916,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :parâmetro inválido para {STRING}: parâmetro {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} deve ser carregado antes de {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} deve ser carregado depois de {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :o arquivo GRF foi designado para tradução
 
 STR_NEWGRF_ADD                                                  :{BLACK}Adicionar
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Adiciona um NewGRF à lista
--- a/src/lang/bulgarian.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/bulgarian.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -282,6 +282,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...собственост на {STRING}
 STR_013C_CARGO                                                  :{BLACK}Товар
@@ -592,6 +593,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Първо пристигане на превозно средство в конкурентна станция
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Инциденти / бедствия
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Информация за компанията
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Отворени / затворени промишлености
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Промени в икономиката
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Съвет / информация за превозните средства
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Нови превозни средства
@@ -727,7 +729,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Поставяне фар
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Постави предавател
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Избери пустинен терен.{}Задръж CTRL за да го премахнеш.
-STR_CREATE_LAKE                                                 :{BLACK}Посочване на водна зона.{}Ще наводни съседните ако са на морското ниво
+STR_CREATE_LAKE                                                 :{BLACK}Определи водна площ.{}Построи канал, освем когато CTRL е натиснат на морско ниво, когато ще наводни околната среда в замяна
 STR_0290_DELETE                                                 :{BLACK}Изтрий
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Премахни напълно града
 STR_0292_SAVE_SCENARIO                                          :Запис на сценарий
@@ -1090,6 +1092,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Твоята компания
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Всички компании
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Избери предпочитания отбор за чатене <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Предназначение на scrollwheel: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Промени фокусат на картата
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Разгледай картата
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Изклучен
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Scrollwheel скорост на картата: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Макс. влакове на играч: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Макс. брой коли на играч: {ORANGE}{STRING}
@@ -1208,7 +1215,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Постави дървета от произволен тип
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Тук не може да се строят канали...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Строене на канали. Натиснете CTRL за да поставите морска плочка (само на нивото на морето).
+STR_BUILD_CANALS_TIP                                            :{BLACK}Построи канал.
 STR_LANDINFO_CANAL                                              :Канал
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Тук не може да се строят шлюзове...
@@ -2634,7 +2641,9 @@
 STR_TRAIN_NO_POWER                                              :{RED}Няма мощност
 STR_TRAIN_START_NO_CATENARY                                     :Влака не може да тръгне, защото ЖП линията няма catenary
 
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}Нов {STRING} е на разположение!
 STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{STRING}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Нов {STRING} е на разположение! - {STRING}
 
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Кола на пътя
@@ -2906,6 +2915,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Невалиден параметър за {STRING}: параметър {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} трябва да бъде зареден преди {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} трябва да бъде зареден след {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF файлат беше предназначен да преведе
 
 STR_NEWGRF_ADD                                                  :{BLACK}Добави
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Добавяне на NewGRF файл към списъка
@@ -3139,3 +3149,4 @@
 
 ########
 
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Сума за преместване: {LTBLUE}{CURRENCY}
--- a/src/lang/catalan.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/catalan.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...propietat de {STRING}
 STR_013C_CARGO                                                  :{BLACK}Càrrega
@@ -590,6 +591,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arribada del 1er. vehicle a una estació competidora
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Accidents / desastres
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informació de l'Empresa
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Obrir / tancar d'indústries
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Canvis de l'Economia
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Avisos / informació dels teus vehicles
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nous vehicles
@@ -725,7 +727,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Situa un far
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Situa un repetidor
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Defineix àrea de desert.{}Prem i mantingues la tecla CTRL per treure'l
-STR_CREATE_LAKE                                                 :{BLACK}Defineix àrea d'aigua.{}Inundarà els voltants si és a nivell del mar
+STR_CREATE_LAKE                                                 :{BLACK}Defineix l'area d'aigua.{}Fa un canal, excepte si CTRL està apretat al nivell del mar, llavors s'inundaran els voltants
 STR_0290_DELETE                                                 :{BLACK}Esborra
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Esborra totalment aquesta població
 STR_0292_SAVE_SCENARIO                                          :Desa l'escenari
@@ -1088,6 +1090,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Pròpia companyia
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Totes les companyies
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Prefereix fer un chat d'equip amb <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Funció de la rodeta del ratolí: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom mapa
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Moure mapa
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Off
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Velocitat del mapa amb la rodeta del ratolí: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Max trens per jugador: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Max automòbils per jugador: {ORANGE}{STRING}
@@ -1206,7 +1213,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Situar arbres de tipus aleatori
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Aquí no es poden construir canals...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Construeix canals
+STR_BUILD_CANALS_TIP                                            :{BLACK}Construir canals.
 STR_LANDINFO_CANAL                                              :Canal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Aquí no es pot construir una resclosa...
@@ -2906,6 +2913,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Paràmetre invàlid per {STRING}: paràmetre {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} ha de ser carregat abans de {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} ha de ser carregat després de {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :l'arxiu GRF dissenyat està pendent de traduir
 
 STR_NEWGRF_ADD                                                  :{BLACK}Afegeix
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Afegeix un arxiu NewGRF a la llista
--- a/src/lang/czech.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/czech.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -444,13 +444,13 @@
 STR_SORT_BY_FACILITY                                            :druhu stanice
 STR_SORT_BY_WAITING                                             :množství čekajícího nákladu
 STR_SORT_BY_RATING_MAX                                          :hodnocení přepravy
-STR_ENGINE_SORT_ENGINE_ID                                       :ID lokomotivy (klasické pořadí)
-STR_ENGINE_SORT_COST                                            :Cena
-STR_ENGINE_SORT_POWER                                           :Výkon
-STR_ENGINE_SORT_INTRO_DATE                                      :Datum uvedení na trh
-STR_ENGINE_SORT_RUNNING_COST                                    :Provozní náklady
-STR_ENGINE_SORT_POWER_VS_RUNNING_COST                           :Výkon/Provozní náklady
-STR_ENGINE_SORT_CARGO_CAPACITY                                  :Přepravní kapacita
+STR_ENGINE_SORT_ENGINE_ID                                       :ID vozu (klasické pořadí)
+STR_ENGINE_SORT_COST                                            :ceny
+STR_ENGINE_SORT_POWER                                           :výkonu
+STR_ENGINE_SORT_INTRO_DATE                                      :data uvedení na trh
+STR_ENGINE_SORT_RUNNING_COST                                    :provozních nákladů
+STR_ENGINE_SORT_POWER_VS_RUNNING_COST                           :výkonu/provozních nákladů
+STR_ENGINE_SORT_CARGO_CAPACITY                                  :přepravní kapacity
 STR_NO_WAITING_CARGO                                            :{BLACK}Nečeká žádná komodita jakéhokoli druhu
 STR_SELECT_ALL_FACILITIES                                       :{BLACK}Označit všechny druhy stanic
 STR_SELECT_ALL_TYPES                                            :{BLACK}Označit všechny druhy komodit (včetne žádného čekajícího nákladu)
@@ -649,6 +649,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Příjezd prvního vozidla do konkurenční stanice
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Nehody / katastrofy
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informace o společnosti
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Otevření / zavření továren
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Změny v ekonomice
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Rady / informace o hráčových vozidlech
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nový dopravní prostředek
@@ -784,7 +785,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Umístit maják
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Umístit vysílač
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Vytvořit pouštní oblast{}Stiskem CTRL ji odstraníš
-STR_CREATE_LAKE                                                 :{BLACK}Vytvořit vodní plochu.{}Sousední dílky se zaplaví také, pokud jsou na úrovni moře
+STR_CREATE_LAKE                                                 :{BLACK}Vytvořit vodní plochu.{}Pokud není držen CTRL, vytvoří se na úrovni moře průplav; v opačném případě se zaplaví ostatní dílky
 STR_0290_DELETE                                                 :{BLACK}Smaž
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Smazat celé toto město
 STR_0292_SAVE_SCENARIO                                          :Uložit mapu
@@ -1147,6 +1148,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :jen vlastní společnost
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :všechny společnosti
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Přepnout na týmový chat <ENTER>em: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Chování skrolovacího tlačítka: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :zoomování mapy
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :pohyb po mapě
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :nic
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Rychlost skrolovacího kolečka: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Maximum vlaků na hráče: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Maximum silničních vozidel na hráče: {ORANGE}{STRING}
@@ -1265,7 +1271,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Umístit nahodné stromy
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Zde nemohu postavit průplav...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Stavět průplav. Podržením CTRL můžete vytvořit vodní plochu (pouze na úrovni moře).
+STR_BUILD_CANALS_TIP                                            :{BLACK}Vytvořit průplav
 STR_LANDINFO_CANAL                                              :Průplav
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Zde nemohu postavit zdymadlo...
@@ -1697,7 +1703,7 @@
 STR_202D_UNTIL                                                  :{YELLOW}, do {DATE_SHORT})
 STR_202E_OFFER_OF_SUBSIDY_EXPIRED                               :{BLACK}{BIGFONT}Nabídka dotace přepravy vypršela:{}{}Dotace dopravy {STRING.gen} z{NBSP}{STRING} do {STRING} nebude dále nabízena.
 STR_202F_SUBSIDY_WITHDRAWN_SERVICE                              :{BLACK}{BIGFONT}Ukončení dotování dopravy:{}{}Dotace pro {STRING} z{NBSP}{STATION} do {STATION} již nebude dále poskytována.
-STR_2030_SERVICE_SUBSIDY_OFFERED                                :{BLACK}{BIGFONT}Nabídka dotace:{}{}Doprava {STRING} z{NBSP}{STRING} do {STRING} bude jeden rok dotována místní správou!
+STR_2030_SERVICE_SUBSIDY_OFFERED                                :{BLACK}{BIGFONT}Nabídka dotace:{}{}Doprava {STRING.gen} z{NBSP}{STRING} do {STRING} bude jeden rok dotována místní správou!
 STR_2031_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Dotace přidělena společnosti {COMPANY}.{}{}Doprava {STRING.gen} z {STATION} do {STATION} bude po jeden rok vynášet 150 % normální ceny.
 STR_2032_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Dotace přidělena společnosti {COMPANY}.{}{}Doprava {STRING.gen} z {STATION} do {STATION} bude po jeden rok vynášet dvojnásobek normální ceny!
 STR_2033_SERVICE_SUBSIDY_AWARDED                                :{BLACK}{BIGFONT}Dotace přidělena společnosti {COMPANY}.{}{}Doprava {STRING.gen} z {STATION} do {STATION} bude po jeden rok vynášet trojnásobek normální ceny!
@@ -2396,105 +2402,105 @@
 STR_8071_BATTERY_TRUCK                                          :Vagon na baterie
 STR_8072_FIZZY_DRINK_TRUCK                                      :Vagon na limonády
 STR_8073_PLASTIC_TRUCK                                          :Vagon na plast
-STR_8074_MPS_REGAL_BUS                                          :MPS Regal Bus
-STR_8075_HEREFORD_LEOPARD_BUS                                   :Hereford Leopard Bus
-STR_8076_FOSTER_BUS                                             :Foster Bus
-STR_8077_FOSTER_MKII_SUPERBUS                                   :Foster MkII Superbus
-STR_8078_PLODDYPHUT_MKI_BUS                                     :Ploddyphut MkI Bus
-STR_8079_PLODDYPHUT_MKII_BUS                                    :Ploddyphut MkII Bus
-STR_807A_PLODDYPHUT_MKIII_BUS                                   :Ploddyphut MkIII Bus
-STR_807B_BALOGH_COAL_TRUCK                                      :Balogh vůz na uhlí
-STR_807C_UHL_COAL_TRUCK                                         :Uhl vůz na uhlí
-STR_807D_DW_COAL_TRUCK                                          :DW vůz na uhlí
-STR_807E_MPS_MAIL_TRUCK                                         :MPS poštovní vůz
-STR_807F_REYNARD_MAIL_TRUCK                                     :Reynard poštovní vůz
-STR_8080_PERRY_MAIL_TRUCK                                       :Perry poštovní vůz
-STR_8081_MIGHTYMOVER_MAIL_TRUCK                                 :MightyMover poštovní vůz
-STR_8082_POWERNAUGHT_MAIL_TRUCK                                 :Powernaught poštovní vůz
-STR_8083_WIZZOWOW_MAIL_TRUCK                                    :Wizzowow poštovní vůz
-STR_8084_WITCOMBE_OIL_TANKER                                    :Witcombe cisterna na ropu
-STR_8085_FOSTER_OIL_TANKER                                      :Foster cisterna na ropu
-STR_8086_PERRY_OIL_TANKER                                       :Perry cisterna na ropu
-STR_8087_TALBOTT_LIVESTOCK_VAN                                  :Talbott vůz na dobytek
-STR_8088_UHL_LIVESTOCK_VAN                                      :Uhl vůz na dobytek
-STR_8089_FOSTER_LIVESTOCK_VAN                                   :Foster vůz na dobytek
-STR_808A_BALOGH_GOODS_TRUCK                                     :Balogh vůz na zboží
-STR_808B_CRAIGHEAD_GOODS_TRUCK                                  :Craighead vůz na zboží
-STR_808C_GOSS_GOODS_TRUCK                                       :Goss vůz na zboží
-STR_808D_HEREFORD_GRAIN_TRUCK                                   :Hereford vůz na zrní
-STR_808E_THOMAS_GRAIN_TRUCK                                     :Thomas vůz na zrní
-STR_808F_GOSS_GRAIN_TRUCK                                       :Goss vůz na zrní
-STR_8090_WITCOMBE_WOOD_TRUCK                                    :Witcombe vůz na dřevo
-STR_8091_FOSTER_WOOD_TRUCK                                      :Foster vůz na dřevo
-STR_8092_MORELAND_WOOD_TRUCK                                    :Moreland vůz na dřevo
-STR_8093_MPS_IRON_ORE_TRUCK                                     :MPS vůz na železnou rudu
-STR_8094_UHL_IRON_ORE_TRUCK                                     :Uhl vůz na železnou rudu
-STR_8095_CHIPPY_IRON_ORE_TRUCK                                  :Chippy vůz na železnou rudu
-STR_8096_BALOGH_STEEL_TRUCK                                     :Balogh vůz na ocel
-STR_8097_UHL_STEEL_TRUCK                                        :Uhl vůz na ocel
-STR_8098_KELLING_STEEL_TRUCK                                    :Kelling vůz na ocel
-STR_8099_BALOGH_ARMORED_TRUCK                                   :Balogh obrněný vůz
-STR_809A_UHL_ARMORED_TRUCK                                      :Uhl obrněný vůz
-STR_809B_FOSTER_ARMORED_TRUCK                                   :Foster obrněný vůz
-STR_809C_FOSTER_FOOD_VAN                                        :Foster vůz na jídlo
-STR_809D_PERRY_FOOD_VAN                                         :Perry vůz na jídlo
-STR_809E_CHIPPY_FOOD_VAN                                        :Chippy vůz na jídlo
-STR_809F_UHL_PAPER_TRUCK                                        :Uhl vůz na papír
-STR_80A0_BALOGH_PAPER_TRUCK                                     :Balogh vůz na papír
-STR_80A1_MPS_PAPER_TRUCK                                        :MPS vůz na papír
-STR_80A2_MPS_COPPER_ORE_TRUCK                                   :MPS vůz na měděnou rudu
-STR_80A3_UHL_COPPER_ORE_TRUCK                                   :Uhl vůz na měděnou rudu
-STR_80A4_GOSS_COPPER_ORE_TRUCK                                  :Goss vůz na měděnou rudu
-STR_80A5_UHL_WATER_TANKER                                       :Uhl cisterna na vodu
-STR_80A6_BALOGH_WATER_TANKER                                    :Balogh cisterna na vodu
-STR_80A7_MPS_WATER_TANKER                                       :MPS cisterna na vodu
-STR_80A8_BALOGH_FRUIT_TRUCK                                     :Balogh vůz na ovoce
-STR_80A9_UHL_FRUIT_TRUCK                                        :Uhl vůz na ovoce
-STR_80AA_KELLING_FRUIT_TRUCK                                    :Kelling vůz na ovoce
-STR_80AB_BALOGH_RUBBER_TRUCK                                    :Balogh vůz na kaučuk
-STR_80AC_UHL_RUBBER_TRUCK                                       :Uhl vůz na kaučuk
-STR_80AD_RMT_RUBBER_TRUCK                                       :RMT vůz na kaučuk
-STR_80AE_MIGHTYMOVER_SUGAR_TRUCK                                :MightyMover vůz na cukr
-STR_80AF_POWERNAUGHT_SUGAR_TRUCK                                :Powernaught vůz na cukr
-STR_80B0_WIZZOWOW_SUGAR_TRUCK                                   :Wizzowow vůz na cukr
-STR_80B1_MIGHTYMOVER_COLA_TRUCK                                 :MightyMover cisterna na kolu
-STR_80B2_POWERNAUGHT_COLA_TRUCK                                 :Powernaught cisterna na kolu
-STR_80B3_WIZZOWOW_COLA_TRUCK                                    :Wizzowow cisterna na kolu
-STR_80B4_MIGHTYMOVER_COTTON_CANDY                               :MightyMover vůz na cukrovou vatu
-STR_80B5_POWERNAUGHT_COTTON_CANDY                               :Powernaught vůz na cukrovou vatu
-STR_80B6_WIZZOWOW_COTTON_CANDY_TRUCK                            :Wizzowow vůz na cukrovou vatu
-STR_80B7_MIGHTYMOVER_TOFFEE_TRUCK                               :MightyMover vůz na karamel
-STR_80B8_POWERNAUGHT_TOFFEE_TRUCK                               :Powernaught vůz na karamel
-STR_80B9_WIZZOWOW_TOFFEE_TRUCK                                  :Wizzowow vůz na karamel
-STR_80BA_MIGHTYMOVER_TOY_VAN                                    :MightyMover vůz na hračky
-STR_80BB_POWERNAUGHT_TOY_VAN                                    :Powernaught vůz na hračky
-STR_80BC_WIZZOWOW_TOY_VAN                                       :Wizzowow vůz na hračky
-STR_80BD_MIGHTYMOVER_CANDY_TRUCK                                :MightyMover vůz na bonbony
-STR_80BE_POWERNAUGHT_CANDY_TRUCK                                :Powernaught vůz na bonbony
-STR_80BF_WIZZOWOW_CANDY_TRUCK                                   :Wizzowow vůz na bonbony
-STR_80C0_MIGHTYMOVER_BATTERY_TRUCK                              :MightyMover vůz na baterie
-STR_80C1_POWERNAUGHT_BATTERY_TRUCK                              :Powernaught vůz na baterie
-STR_80C2_WIZZOWOW_BATTERY_TRUCK                                 :Wizzowow vůz na baterie
-STR_80C3_MIGHTYMOVER_FIZZY_DRINK                                :MightyMover vůz na limonády
-STR_80C4_POWERNAUGHT_FIZZY_DRINK                                :Powernaught vůz na limonády
-STR_80C5_WIZZOWOW_FIZZY_DRINK_TRUCK                             :Wizzowow vůz na limonády
-STR_80C6_MIGHTYMOVER_PLASTIC_TRUCK                              :MightyMover vůz na plast
-STR_80C7_POWERNAUGHT_PLASTIC_TRUCK                              :Powernaught vůz na plast
-STR_80C8_WIZZOWOW_PLASTIC_TRUCK                                 :Wizzowow vůz na plast
-STR_80C9_MIGHTYMOVER_BUBBLE_TRUCK                               :MightyMover vůz na bubliny
-STR_80CA_POWERNAUGHT_BUBBLE_TRUCK                               :Powernaught vůz na bubliny
-STR_80CB_WIZZOWOW_BUBBLE_TRUCK                                  :Wizzowow vůz na bubliny
-STR_80CC_MPS_OIL_TANKER                                         :MPS ropný tanker
-STR_80CD_CS_INC_OIL_TANKER                                      :CS-Inc. ropný tanker
-STR_80CE_MPS_PASSENGER_FERRY                                    :MPS trajekt pro cestující
-STR_80CF_FFP_PASSENGER_FERRY                                    :FFP trajekt pro cestující
-STR_80D0_BAKEWELL_300_HOVERCRAFT                                :Bakewell 300 vznášedlo
-STR_80D1_CHUGGER_CHUG_PASSENGER                                 :Chugger-Chug trajekt pro cestující
-STR_80D2_SHIVERSHAKE_PASSENGER_FERRY                            :Shivershake trajekt pro cestující
-STR_80D3_YATE_CARGO_SHIP                                        :Yate nákladní loď
-STR_80D4_BAKEWELL_CARGO_SHIP                                    :Bakewell nákladní loď
-STR_80D5_MIGHTYMOVER_CARGO_SHIP                                 :Mightymover nákladní loď
-STR_80D6_POWERNAUT_CARGO_SHIP                                   :Powernaut nákladní loď
+STR_8074_MPS_REGAL_BUS                                          :Autobus MPS Regal
+STR_8075_HEREFORD_LEOPARD_BUS                                   :Autobus Hereford Leopard
+STR_8076_FOSTER_BUS                                             :Autobus Foster
+STR_8077_FOSTER_MKII_SUPERBUS                                   :Autobus Foster MkII Superbus
+STR_8078_PLODDYPHUT_MKI_BUS                                     :Autobus Ploddyphut MkI
+STR_8079_PLODDYPHUT_MKII_BUS                                    :Autobus Ploddyphut MkII
+STR_807A_PLODDYPHUT_MKIII_BUS                                   :Autobus Ploddyphut MkIII
+STR_807B_BALOGH_COAL_TRUCK                                      :Vůz na uhlí Balogh
+STR_807C_UHL_COAL_TRUCK                                         :Vůz na uhlí Uhl
+STR_807D_DW_COAL_TRUCK                                          :Vůz na uhlí DW
+STR_807E_MPS_MAIL_TRUCK                                         :Poštovní vůz MPS
+STR_807F_REYNARD_MAIL_TRUCK                                     :Poštovní vůz Reynard
+STR_8080_PERRY_MAIL_TRUCK                                       :Poštovní vůz Perry
+STR_8081_MIGHTYMOVER_MAIL_TRUCK                                 :Poštovní vůz MightyMover
+STR_8082_POWERNAUGHT_MAIL_TRUCK                                 :Poštovní vůz Powernaught
+STR_8083_WIZZOWOW_MAIL_TRUCK                                    :Poštovní vůz Wizzowow
+STR_8084_WITCOMBE_OIL_TANKER                                    :Cisterna na ropu Witcombe
+STR_8085_FOSTER_OIL_TANKER                                      :Cisterna na ropu Foster
+STR_8086_PERRY_OIL_TANKER                                       :Cisterna na ropu Perry
+STR_8087_TALBOTT_LIVESTOCK_VAN                                  :Vůz na dobytek Talbott
+STR_8088_UHL_LIVESTOCK_VAN                                      :Vůz na dobytek Uhl
+STR_8089_FOSTER_LIVESTOCK_VAN                                   :Vůz na dobytek Foster
+STR_808A_BALOGH_GOODS_TRUCK                                     :Vůz na zboží Balogh
+STR_808B_CRAIGHEAD_GOODS_TRUCK                                  :Vůz na zboží Craighead
+STR_808C_GOSS_GOODS_TRUCK                                       :Vůz na zboží Goss
+STR_808D_HEREFORD_GRAIN_TRUCK                                   :Vůz na zrní Hereford
+STR_808E_THOMAS_GRAIN_TRUCK                                     :Vůz na zrní Thomas
+STR_808F_GOSS_GRAIN_TRUCK                                       :Vůz na zrní Goss
+STR_8090_WITCOMBE_WOOD_TRUCK                                    :Vůz na dřevo Witcombe
+STR_8091_FOSTER_WOOD_TRUCK                                      :Vůz na dřevo Foster
+STR_8092_MORELAND_WOOD_TRUCK                                    :Vůz na dřevo Moreland
+STR_8093_MPS_IRON_ORE_TRUCK                                     :Vůz na železnou rudu MPS
+STR_8094_UHL_IRON_ORE_TRUCK                                     :Vůz na železnou rudu Uhl
+STR_8095_CHIPPY_IRON_ORE_TRUCK                                  :Vůz na železnou rudu Chippy
+STR_8096_BALOGH_STEEL_TRUCK                                     :Vůz na ocel Balogh
+STR_8097_UHL_STEEL_TRUCK                                        :Vůz na ocel Uhl
+STR_8098_KELLING_STEEL_TRUCK                                    :Vůz na ocel Kelling
+STR_8099_BALOGH_ARMORED_TRUCK                                   :Obrněný vůz Balogh
+STR_809A_UHL_ARMORED_TRUCK                                      :Obrněný vůz Uhl
+STR_809B_FOSTER_ARMORED_TRUCK                                   :Obrněný vůz Foster
+STR_809C_FOSTER_FOOD_VAN                                        :Vůz na jídlo Foster
+STR_809D_PERRY_FOOD_VAN                                         :Vůz na jídlo Perry
+STR_809E_CHIPPY_FOOD_VAN                                        :Vůz na jídlo Chippy
+STR_809F_UHL_PAPER_TRUCK                                        :Vůz na papír Uhl
+STR_80A0_BALOGH_PAPER_TRUCK                                     :Vůz na papír Balogh
+STR_80A1_MPS_PAPER_TRUCK                                        :Vůz na papír MPS
+STR_80A2_MPS_COPPER_ORE_TRUCK                                   :Vůz na měděnou rudu MPS
+STR_80A3_UHL_COPPER_ORE_TRUCK                                   :Vůz na měděnou rudu Uhl
+STR_80A4_GOSS_COPPER_ORE_TRUCK                                  :Vůz na měděnou rudu Goss
+STR_80A5_UHL_WATER_TANKER                                       :Cisterna na vodu Uhl
+STR_80A6_BALOGH_WATER_TANKER                                    :Cisterna na vodu Balogh
+STR_80A7_MPS_WATER_TANKER                                       :Cisterna na vodu MPS
+STR_80A8_BALOGH_FRUIT_TRUCK                                     :Vůz na ovoce Balogh
+STR_80A9_UHL_FRUIT_TRUCK                                        :Vůz na ovoce Uhl
+STR_80AA_KELLING_FRUIT_TRUCK                                    :Vůz na ovoce Kelling
+STR_80AB_BALOGH_RUBBER_TRUCK                                    :Vůz na kaučuk Balogh
+STR_80AC_UHL_RUBBER_TRUCK                                       :Vůz na kaučuk Uhl
+STR_80AD_RMT_RUBBER_TRUCK                                       :Vůz na kaučuk RMT
+STR_80AE_MIGHTYMOVER_SUGAR_TRUCK                                :Vůz na cukr MightyMover
+STR_80AF_POWERNAUGHT_SUGAR_TRUCK                                :Vůz na cukr Powernaught
+STR_80B0_WIZZOWOW_SUGAR_TRUCK                                   :Vůz na cukr Wizzowow
+STR_80B1_MIGHTYMOVER_COLA_TRUCK                                 :Cisterna na kolu MightyMover
+STR_80B2_POWERNAUGHT_COLA_TRUCK                                 :Cisterna na kolu Powernaught
+STR_80B3_WIZZOWOW_COLA_TRUCK                                    :Cisterna na kolu Wizzowow
+STR_80B4_MIGHTYMOVER_COTTON_CANDY                               :Vůz na cukrovou vatu MightyMover
+STR_80B5_POWERNAUGHT_COTTON_CANDY                               :Vůz na cukrovou vatu Powernaught
+STR_80B6_WIZZOWOW_COTTON_CANDY_TRUCK                            :Vůz na cukrovou vatu Wizzowow
+STR_80B7_MIGHTYMOVER_TOFFEE_TRUCK                               :Vůz na karamel MightyMover
+STR_80B8_POWERNAUGHT_TOFFEE_TRUCK                               :Vůz na karamel Powernaught
+STR_80B9_WIZZOWOW_TOFFEE_TRUCK                                  :Vůz na karamel Wizzowow
+STR_80BA_MIGHTYMOVER_TOY_VAN                                    :Vůz na hračky MightyMover
+STR_80BB_POWERNAUGHT_TOY_VAN                                    :Vůz na hračky Powernaught
+STR_80BC_WIZZOWOW_TOY_VAN                                       :Vůz na hračky Wizzowow
+STR_80BD_MIGHTYMOVER_CANDY_TRUCK                                :Vůz na bonbony MightyMover
+STR_80BE_POWERNAUGHT_CANDY_TRUCK                                :Vůz na bonbony Powernaught
+STR_80BF_WIZZOWOW_CANDY_TRUCK                                   :Vůz na bonbony Wizzowow
+STR_80C0_MIGHTYMOVER_BATTERY_TRUCK                              :Vůz na baterie MightyMover
+STR_80C1_POWERNAUGHT_BATTERY_TRUCK                              :Vůz na baterie Powernaught
+STR_80C2_WIZZOWOW_BATTERY_TRUCK                                 :Vůz na baterie Wizzowow
+STR_80C3_MIGHTYMOVER_FIZZY_DRINK                                :Vůz na limonády MightyMover
+STR_80C4_POWERNAUGHT_FIZZY_DRINK                                :Vůz na limonády Powernaught
+STR_80C5_WIZZOWOW_FIZZY_DRINK_TRUCK                             :Vůz na limonády Wizzowow
+STR_80C6_MIGHTYMOVER_PLASTIC_TRUCK                              :Vůz na plast MightyMover
+STR_80C7_POWERNAUGHT_PLASTIC_TRUCK                              :Vůz na plast Powernaught
+STR_80C8_WIZZOWOW_PLASTIC_TRUCK                                 :Vůz na plast Wizzowow
+STR_80C9_MIGHTYMOVER_BUBBLE_TRUCK                               :Vůz na bubliny MightyMover
+STR_80CA_POWERNAUGHT_BUBBLE_TRUCK                               :Vůz na bubliny Powernaught
+STR_80CB_WIZZOWOW_BUBBLE_TRUCK                                  :Vůz na bubliny Wizzowow
+STR_80CC_MPS_OIL_TANKER                                         :Ropný tanker MPS
+STR_80CD_CS_INC_OIL_TANKER                                      :Ropný tanker CS-Inc.
+STR_80CE_MPS_PASSENGER_FERRY                                    :Trajekt pro cestující MPS
+STR_80CF_FFP_PASSENGER_FERRY                                    :Trajekt pro cestující FFP
+STR_80D0_BAKEWELL_300_HOVERCRAFT                                :Vznášedlo Bakewell 300
+STR_80D1_CHUGGER_CHUG_PASSENGER                                 :Trajekt pro cestující Chugger-Chug
+STR_80D2_SHIVERSHAKE_PASSENGER_FERRY                            :Trajekt pro cestující Shivershake
+STR_80D3_YATE_CARGO_SHIP                                        :Nákladní loď Yate
+STR_80D4_BAKEWELL_CARGO_SHIP                                    :Nákladní loď Bakewell
+STR_80D5_MIGHTYMOVER_CARGO_SHIP                                 :Nákladní loď Mightymover
+STR_80D6_POWERNAUT_CARGO_SHIP                                   :Nákladní loď Powernaut
 STR_80D7_SAMPSON_U52                                            :Sampson U52
 STR_80D8_COLEMAN_COUNT                                          :Coleman Count
 STR_80D9_FFP_DART                                               :FFP Dart
@@ -2533,23 +2539,23 @@
 STR_80FA_FLASHBANG_X1                                           :Flashbang X1
 STR_80FB_JUGGERPLANE_M1                                         :Juggerplane M1
 STR_80FC_FLASHBANG_WIZZER                                       :Flashbang Wizzer
-STR_80FD_TRICARIO_HELICOPTER                                    :Vrtulník Tricairo
+STR_80FD_TRICARIO_HELICOPTER                                    :Vrtulník Tricario
 STR_80FE_GURU_X2_HELICOPTER                                     :Vrtulník Guru X2
 STR_80FF_POWERNAUT_HELICOPTER                                   :Vrtulník Powernaut
 STR_8100_MESSAGE_FROM_VEHICLE_MANUFACTURE                       :{WHITE}Zpráva od výrobce dopravních prostředků
-STR_8101_WE_HAVE_JUST_DESIGNED_A                                :{GOLD}Právě jsme vyvinuli nov{G ý ou é} {STRING.acc}. Měl byste zájem o roční výhradní právo na používání tohoto prostředku, aby byl otestován před uvedením na trh?
+STR_8101_WE_HAVE_JUST_DESIGNED_A                                :{GOLD}Právě jsme vyvinuli nov{G ou ý é} {STRING.acc}. Měl byste zájem o roční výhradní právo na používání tohoto prostředku, aby byl otestován před uvedením na trh?
 STR_8102_RAILROAD_LOCOMOTIVE                                    :{G=f}lokomotiva
 STR_8102_RAILROAD_LOCOMOTIVE.acc                                :{G=f}lokomotivu
-STR_8102_RAILROAD_LOCOMOTIVE.dat                                :{G=f}lokomotivu
+STR_8102_RAILROAD_LOCOMOTIVE.dat                                :
 STR_8103_ROAD_VEHICLE                                           :{G=n}silniční vozidlo
 STR_8104_AIRCRAFT                                               :{G=n}letadlo
 STR_8105_SHIP                                                   :{G=f}loď
 STR_8106_MONORAIL_LOCOMOTIVE                                    :{G=f}lokomotiva pro monorail
 STR_8106_MONORAIL_LOCOMOTIVE.acc                                :{G=f}lokomotivu pro monorail
-STR_8106_MONORAIL_LOCOMOTIVE.dat                                :{G=f}lokomotivu pro monorail
+STR_8106_MONORAIL_LOCOMOTIVE.dat                                :
 STR_8107_MAGLEV_LOCOMOTIVE                                      :{G=f}lokomotiva Maglev
 STR_8107_MAGLEV_LOCOMOTIVE.acc                                  :{G=f}lokomotivu Maglev
-STR_8107_MAGLEV_LOCOMOTIVE.dat                                  :{G=f}lokomotivu Maglev
+STR_8107_MAGLEV_LOCOMOTIVE.dat                                  :
 
 ##id 0x8800
 STR_8800_TRAIN_DEPOT                                            :{WHITE}Železniční depo {TOWN}
@@ -2971,6 +2977,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Neplatný parametr pro {STRING}: parametr {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} musí být nahráván před {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} musí být nahráván po {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF soubor, který se měl přeložit
 
 STR_NEWGRF_ADD                                                  :{BLACK}Přidat
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Přidat NewGRF soubor do seznamu
--- a/src/lang/danish.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/danish.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...ejes af {STRING}
 STR_013C_CARGO                                                  :{BLACK}Last
@@ -725,7 +726,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Placér fyrtårn
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Placér sender
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Definer ørkenområde.{}Hold CTRL nede for at fjerne det
-STR_CREATE_LAKE                                                 :{BLACK}Definer vandområde.{}Vil oversvømme nærlæggende land i samme plan
 STR_0290_DELETE                                                 :{BLACK}Slet
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Slet denne by fuldstændigt
 STR_0292_SAVE_SCENARIO                                          :Gem scenarie
@@ -1205,7 +1205,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Placer træer af tilfældig type
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Kan ikke bygge en kanal her...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Byg kanaler
 STR_LANDINFO_CANAL                                              :Kanal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Kan ikke bygge en sluse her...
@@ -2631,6 +2630,9 @@
 STR_TRAIN_NO_POWER                                              :{RED}Ingen strøm
 STR_TRAIN_START_NO_CATENARY                                     :Toget kan ikke køre, fordi sporet ikke har køreledninger
 
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}Ny {STRING} er nu tilgængelig!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{STRING}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Ny {STRING} er nu tilgængelig!  -  {STRING}
 
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Køretøj i vejen
--- a/src/lang/dutch.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/dutch.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...is van {STRING}
 STR_013C_CARGO                                                  :{BLACK}Lading
@@ -590,6 +591,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Eerste voertuig bij concurrerend station
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Ongelukken/rampen
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Bedrijfsinformatie
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Openen / sluiten van industrieën
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Veranderingen in de economie
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Advies/informatie over voertuigen van de speler
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nieuwe voertuigen
@@ -725,7 +727,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Plaats vuurtoren
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Plaats radiomast
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Definieer woestijn gebied.{}Gebruik CTRL om het te verwijderen
-STR_CREATE_LAKE                                                 :{BLACK}Definieer watergebied.{}Het zal de omgeving overstromen als deze op zeeniveau ligt
+STR_CREATE_LAKE                                                 :{BLACK}Definiëer water gebied.{}Maak een kanaal, tenzij CTRL wordt vastgehouden op zee niveau, dan zal de omgeving overstromen
 STR_0290_DELETE                                                 :{BLACK}Verwijder
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Verwijder deze hele stad
 STR_0292_SAVE_SCENARIO                                          :Scenario opslaan
@@ -1088,6 +1090,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Eigen bedrijf
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Alle bedrijven
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Voorkeur voor team chat met <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Functie van muiswiel: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom kaart
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scroll kaart
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Uit
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Kaart muiswiel snelheid: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Maximaal aantal treinen per speler: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Maximaal aantal wegvoertuigen per speler: {ORANGE}{STRING}
@@ -1206,7 +1213,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Plant bomen van willekeurig type
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Kan hier geen kanaal bouwen...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Bouw kanaal
+STR_BUILD_CANALS_TIP                                            :{BLACK}Bouw kanalen.
 STR_LANDINFO_CANAL                                              :Kanaal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Kan hier geen sluis bouwen...
@@ -2906,6 +2913,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Ongeldide parameter voor {STRING}: parameter {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} moet geladen zijn voor {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} moet geladen zijn na {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :het GRF bestand is bedoelt voor het vertalen van
 
 STR_NEWGRF_ADD                                                  :{BLACK}Toevoegen
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Voeg een NewGRF bestand toe aan te lijst
--- a/src/lang/english.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/english.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -593,6 +593,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arrival of first vehicle at competitor's station
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Accidents / disasters
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Company information
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Open / close of industries
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Economy changes
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Advice / information on player's vehicles
 STR_020C_NEW_VEHICLES                                           :{YELLOW}New vehicles
@@ -728,7 +729,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Place lighthouse
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Place transmitter
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Define desert area.{}Press and hold CTRL to remove it
-STR_CREATE_LAKE                                                 :{BLACK}Define water area.{}It will flood its surroundings if at sea level
+STR_CREATE_LAKE                                                 :{BLACK}Define water area.{}Make a canal, unless CTRL is held down at sea level, when it will flood the surroundings instead
 STR_0290_DELETE                                                 :{BLACK}Delete
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Delete this town completely
 STR_0292_SAVE_SCENARIO                                          :Save scenario
@@ -1091,6 +1092,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Own company
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :All companies
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Prefer team chat with <ENTER>: {ORANGE}{STRING1}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Function of scrollwheel: {ORANGE}{STRING1}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom map
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scroll map
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Off
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Map scrollwheel speed: {ORANGE}{STRING1}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Max trains per player: {ORANGE}{STRING1}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Max road vehicles per player: {ORANGE}{STRING1}
@@ -1209,7 +1215,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Place trees of random type
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Can't build canals here...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Build canals. Press CTRL to place sea tiles (at sea-level only.)
+STR_BUILD_CANALS_TIP                                            :{BLACK}Build canals.
 STR_LANDINFO_CANAL                                              :Canal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Can't build locks here...
@@ -2918,6 +2924,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Invalid parameter for {STRING}: parameter {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} must be loaded before {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} must be loaded after {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :the GRF file it was designed to translate
 
 STR_NEWGRF_ADD                                                  :{BLACK}Add
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Add a NewGRF file to the list
--- a/src/lang/esperanto.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/esperanto.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -281,6 +281,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...posedata de {STRING}
 STR_013C_CARGO                                                  :{BLACK}Ŝarĝo
@@ -726,7 +727,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Metu lumturon
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Metu transmitilon
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Difinu dezertan regionon.{}Premu kaj tenu CTRL por forigi ĝin
-STR_CREATE_LAKE                                                 :{BLACK}Difinu akvoregionon.{}Inundos la ĉirkaŭon se marnivele
 STR_0290_DELETE                                                 :{BLACK}Forigu
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Plene forigu ĉi tiun urbon
 STR_0292_SAVE_SCENARIO                                          :Konservu scenaron
@@ -1207,7 +1207,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Metu arbojn de hazardaj tipoj
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Ne povas konstrui kanalojn ĉi tie...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Konstruu kanalojn. Premu CTRL por meti mar-kvadratojn (nur marnivele.)
 STR_LANDINFO_CANAL                                              :Kanalo
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Ne povas konstrui kluzojn ĉi tie...
@@ -2633,6 +2632,10 @@
 STR_TRAIN_NO_POWER                                              :{RED}Senforte
 STR_TRAIN_START_NO_CATENARY                                     :Mankas ĉi-trake supera elektro, do la trajno ne povas starti
 
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}Nova {STRING} nun haveblas!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{STRING}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Nova {STRING} nun haveblas!  -  {STRING}
+
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Vojveturilo okupas la lokon
 STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - {COMMA} Vojveturilo{P "" j}
@@ -2903,6 +2906,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Nevalida parametro por {STRING}: parametro{STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} estu ŝarĝata antaŭ {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} estu ŝarĝata post {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :la GRF-dosiero estas farita por traduki
 
 STR_NEWGRF_ADD                                                  :{BLACK}Aldonu
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Aldonu NewGRF-dosieron al la listo
@@ -3135,3 +3139,5 @@
 STR_DATE_LONG                                                   :{STRING} {STRING} {NUM}
 
 ########
+
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Transigaj Kreditoj: {LTBLUE}{CURRENCY}
--- a/src/lang/estonian.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/estonian.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -823,7 +823,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Ehita tuletorn
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Paigalda saatjamast
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Loo kõrbealad.{}Eemaldamiseks klõpsa hoides all CTRL nuppu
-STR_CREATE_LAKE                                                 :{BLACK}Märgi vee ala.{}See uputab kogu läheduse kui on mereveetasemel
 STR_0290_DELETE                                                 :{BLACK}Kustuta
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Hävita see linn täielikult
 STR_0292_SAVE_SCENARIO                                          :Salvesta kaart
@@ -1303,7 +1302,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Istutab suvalisi puid
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Siia ei saa kanaleid ehitada...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Kanali ehitamine. Veeruutude ehitamiseks vajuta CTRL (ainult merepinna kõrgusel)
 STR_LANDINFO_CANAL                                              :Kanal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Siia ei saa lüüse ehitada...
--- a/src/lang/finnish.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/finnish.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -725,7 +725,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Sijoita majakka.
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Sijoita lähetin.
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Määrittele aavikon alue.{}Paina ja pidä pohjassa CTRL-nappia poistaaksesi aavikkoa.
-STR_CREATE_LAKE                                                 :{BLACK}Määrittele veden alue.{}Vesi tulvii ympäröivään maastoon, jos se on merenpinnan tasolla.
 STR_0290_DELETE                                                 :{BLACK}Poista
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Poista tämä kaupunki kokonaan.
 STR_0292_SAVE_SCENARIO                                          :Tallenna skenaario
@@ -1206,7 +1205,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Aseta sattumanvaraisia puita
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Kanaalia ei voi rakentaa tähän...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Rakenna kanaali
 STR_LANDINFO_CANAL                                              :Kanaali
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Sulkua ei voi rakentaa tähän...
--- a/src/lang/french.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/french.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -281,6 +281,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...appartient à {STRING}
 STR_013C_CARGO                                                  :{BLACK}Cargaison
@@ -591,6 +592,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}1er véhicule dans la station d'un competiteur
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Accidents / désastres
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informations corporatives
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Ouvertures/fermetures d'industries
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Changements économiques
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Conseils / information sur les véhicules du joueur
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nouveaux véhicules
@@ -726,7 +728,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Placer un Phare
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Placer un Transmetteur
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Définir une zone désertique.{}Garder Ctrl enfoncé pour retrait
-STR_CREATE_LAKE                                                 :{BLACK}Définir une zone d'eau.{}Inondera ses abords si au niveau de la mer
+STR_CREATE_LAKE                                                 :{BLACK}Définir une zone d'eau.{}Construit un canal, si Ctrl est enfoncé au niveau de la mer, le voisinage sera innondé.
 STR_0290_DELETE                                                 :{BLACK}Supprimer
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Supprimer complètement cette ville
 STR_0292_SAVE_SCENARIO                                          :Sauvegarder scénario
@@ -1089,6 +1091,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Propre compagnie
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Toutes les compagnies
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Préférer le chat d'équipe avec <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Fonction de la molette: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom de la carte
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Défilement de la carte
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Désactivé
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Vitesse de défilement avec molette: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Nombre de trains max. par joueur: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Nombre de véhicules routiers max. par joueur: {ORANGE}{STRING}
@@ -1207,7 +1214,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Planter des arbres de types choisis au hasard
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Impossible de construire un canal ici...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Construire des canaux. Appuyer sur Ctrl pour placer de l'eau non canalisée (seulement au niveau de la mer).
+STR_BUILD_CANALS_TIP                                            :{BLACK}Construire des canaux.
 STR_LANDINFO_CANAL                                              :Canal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Impossible de construire un écluse ici...
@@ -2907,6 +2914,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Paramètre invalide pour {STRING}: paramètre {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} doit être chargé avant {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} doit être chargé après {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :le fichier GRF qu'il doit traduire
 
 STR_NEWGRF_ADD                                                  :{BLACK}Ajouter
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Ajouter un fichier NewGRF à la liste
--- a/src/lang/galician.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/galician.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -706,7 +706,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Colocar faro
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Colocar transmisor
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Definir área de deserto
-STR_CREATE_LAKE                                                 :{BLACK}Definir área de auga.{}Inundará os arredores se está a nivel do mar
 STR_0290_DELETE                                                 :{BLACK}Borrar
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Borrar completamente esta cidade
 STR_0292_SAVE_SCENARIO                                          :Grabar Escenario
@@ -1159,7 +1158,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Colocar árbores dun tipo aleatorio
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Non se pode construí-los canais aí...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Construír canais
 STR_LANDINFO_CANAL                                              :Canal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Non se pode construí-lo peche aí...
--- a/src/lang/german.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/german.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -281,6 +281,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...Eigentum von {STRING}
 STR_013C_CARGO                                                  :{BLACK}Fracht
@@ -591,6 +592,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Ankunft des ersten Fahrzeugs in einer Station eines Gegners
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Unfälle / Katastrophen
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Firmendaten
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Öffnen und Schließen von Industrien
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Änderungen der Wirtschaftslage
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Rat / Informationen zu Fahrzeugen des Spielers
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Neue Fahrzeuge
@@ -726,7 +728,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Leuchtturm errichten
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Sender errichten
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Lege Wüstengebiet an.{}STRG drücken zum entfernen
-STR_CREATE_LAKE                                                 :{BLACK}Gebiet fluten.{}Auf Meereshöhe entsteht ein Gewässer
 STR_0290_DELETE                                                 :{BLACK}Löschen
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Diese Stadt vollständig löschen
 STR_0292_SAVE_SCENARIO                                          :Szenario speichern
@@ -1207,7 +1208,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Zufällige Baumart pflanzen
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Kann hier keinen Kanal bauen...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Kanal bauen
 STR_LANDINFO_CANAL                                              :Kanal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Kann hier keine Schleuse bauen...
--- a/src/lang/hungarian.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/hungarian.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -346,6 +346,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}... {STRING} tulajdona
 STR_013C_CARGO                                                  :{BLACK}Rakomány
@@ -656,6 +657,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Első jármű megérkezése az ellenfél megállójába
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Balesetek / természeti csapások
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Céginformációk
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Ipari létesítmények létrejötte / bezárása
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Gazdasági változások
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Tanácsok / információk a játékos járműveiről
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Új járművek
@@ -791,7 +793,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Világítótorony építése
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Rádióadó építése
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Sivatagot hoz létre.{}Nyomj CTRL-t az eltávolításához
-STR_CREATE_LAKE                                                 :{BLACK}Vizet hoz létre.{}A tengerszinten lévő elemeket elárasztja
+STR_CREATE_LAKE                                                 :{BLACK}Vizi terület definiálása.{}Csatornát készít, kivéve ha tengerszinten CTRL-t lenyomva hívod meg, ekkor elárasztja a területet
 STR_0290_DELETE                                                 :{BLACK}Töröl
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}A város teljes eltüntetése
 STR_0292_SAVE_SCENARIO                                          :Pálya mentése
@@ -1154,6 +1156,10 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Csak a sajátét
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Minden cégét
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Alapesetben csapatban beszélsz <ENTER>-re: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Scrollgomb funkció: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Térkép nagyítás
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Térkép mozgatás
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Scrollgomb sebessége a térképen: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Maximum vonat játékosonként: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Maximum közúti jármű játékosonként: {ORANGE}{STRING}
@@ -1272,7 +1278,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Véletlenszerűen kiválasztott fákat helyez el
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Nem lehet csatornát építeni ide...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Csatorna építése. Nyomj CTRL-t hogy tengert csinálj (tengerszinten csak).
+STR_BUILD_CANALS_TIP                                            :{BLACK}Csatorna építése (vagy rosszabb esetben terület elárasztása!)
 STR_LANDINFO_CANAL                                              :Csatorna
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Nem lehet zsilipet építeni ide...
@@ -3009,6 +3015,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Hibás paraméterérték ehhez: {STRING}: paraméter {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} muszáj hogy betöltődjön ezelőtt: {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} muszáj hogy ezután töltődjön be: {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :az adott GRF fájl célja egy másik lefordítása
 
 STR_NEWGRF_ADD                                                  :{BLACK}Hozzáad
 STR_NEWGRF_ADD_TIP                                              :{BLACK}A NewGRF-et hozzáadja a listához
--- a/src/lang/icelandic.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/icelandic.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -726,7 +726,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Setja vita
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Setja sendi
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Afmarkaðu eyðimörk.{}Smelltu og haltu CTRL til að fjarlægja hana
-STR_CREATE_LAKE                                                 :{BLACK}Afmarkaðu vantssvæði.{}Það mun flæða yfir aðlægt svæði ef það er við sjávarmál
 STR_0290_DELETE                                                 :{BLACK}Eyða
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Eyða þessum bæ algjörlega
 STR_0292_SAVE_SCENARIO                                          :Vista kort
@@ -1207,7 +1206,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Gróðursetja tré af handahófskenndri gerð
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Ekki hægt að grafa skipaskurð hér...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Grafa skipaskurð
 STR_LANDINFO_CANAL                                              :Skipaskurður
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Ekki hægt að gera skurðgátt hér
--- a/src/lang/italian.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/italian.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...posseduto da {STRING}
 STR_013C_CARGO                                                  :{BLACK}Carico
@@ -398,7 +399,7 @@
 STR_AVAILABLE_TRAINS                                            :{BLACK}Treni Disponibili
 STR_AVAILABLE_ROAD_VEHICLES                                     :{BLACK}Veicoli Disponibili
 STR_AVAILABLE_SHIPS                                             :{BLACK}Navi Disponibili
-STR_AVAILABLE_AIRCRAFT                                          :{BLACK}Aerei Disponibili
+STR_AVAILABLE_AIRCRAFT                                          :{BLACK}Available Aircraft
 STR_AVAILABLE_ENGINES_TIP                                       :{BLACK}Mostra una lista di motrici disponibili per quel tipo di veicolo
 STR_MANAGE_LIST                                                 :{BLACK}Gestisci lista
 STR_MANAGE_LIST_TIP                                             :{BLACK}Manda istruzioni a tutti i veicoli in questa lista
@@ -590,6 +591,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Arrivo del primo veicolo alle stazioni della concorrenza
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Incidenti / disastri
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informazioni sulla società
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Apertura / chiusura delle industrie
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Cambiamenti economici
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Avvisi / informazioni sui veicoli del giocatore
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nuovi veicoli
@@ -725,7 +727,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Piazza faro
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Piazza trasmettitore
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Definisce area desertica.{}Clicca premendo CTRL per rimuoverla
-STR_CREATE_LAKE                                                 :{BLACK}Definisce area d'acqua.{}Si espande se definita a livello del mare
+STR_CREATE_LAKE                                                 :{BLACK}Definisci la zona d'acqua.{}Crei un canale, a meno che CTRL non venga premuto a livello del mare, allagando così i dintorni
 STR_0290_DELETE                                                 :{BLACK}Elimina
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Elimina completamente questa città
 STR_0292_SAVE_SCENARIO                                          :Salva scenario
@@ -1088,6 +1090,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Propria società
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Tutte le società
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Preferisce team chat con <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Funzione della rotellina: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom mappa
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scrolla mappa
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Off
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Velocità rotellina mappa: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Max treni per giocatore: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Max veicoli stradali per giocatore: {ORANGE}{STRING}
@@ -1206,7 +1213,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Pianta alberi di tipo casuale
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Non puoi costruire qui un canale...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Costruisci canali
+STR_BUILD_CANALS_TIP                                            :{BLACK}Costruisci canali.
 STR_LANDINFO_CANAL                                              :Canale
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Non puoi costruire qui una chiusa...
@@ -2780,7 +2787,7 @@
 STR_CLONE_AIRCRAFT_INFO                                         :{BLACK}Costruisce una copia dell'aereo. Premere contemporaneamente Control per condividere gli ordini
 STR_CLONE_AIRCRAFT_INFO_HANGAR_WINDOW                           :{BLACK}Costruisce una copia di un aereo. Cliccare su questo pulsante e poi sull'aereo (dentro o fuori dal deposito) da copiare. Premere contemporaneamente Control per condividere gli ordini
 STR_A005_NEW_AIRCRAFT                                           :{WHITE}Nuovo Aereo
-STR_A006_BUILD_AIRCRAFT                                         :{BLACK}Construisci Aereo
+STR_A006_BUILD_AIRCRAFT                                         :{BLACK}Costruisci Aereo
 STR_A008_CAN_T_BUILD_AIRCRAFT                                   :{WHITE}Non puoi costruire l'aereo
 STR_A009_AIRCRAFT                                               :{WHITE}{COMPANY} - {COMMA} Aereo
 STR_A00A                                                        :{WHITE}{VEHICLE}
@@ -2997,8 +3004,8 @@
 STR_REPLACE_HELP_STOP_BUTTON                                    :{BLACK}Premi per fermare il rimpiazzo delle locomotive del tipo selezionato a sinistra
 STR_REPLACE_HELP_START_BUTTON                                   :{BLACK}Premi per iniziare il rimpiazzo delle locomotive del tipo selezionato a sinistra con quello selezionato a destra
 STR_REPLACE_HELP_RAILTYPE                                       :{BLACK}Seleziona il tipo di binario per la quale vuoi rimpiazzare le locomotive
-STR_REPLACE_HELP_REPLACE_INFO_TAB                               :{BLACK}Mostra con quale locomotiva verrà rimpiazzato il tipo selezionato a sinistra, se qualcuna
-STR_REPLACE_HELP                                                :{BLACK}Permette di rimpiazzare un locomotere con uno di un'altro tipo, quando il treno entra in un deposito
+STR_REPLACE_HELP_REPLACE_INFO_TAB                               :{BLACK}Mostra con quale locomotore verrà rimpiazzato il tipo selezionato a sinistra, se disponibile
+STR_REPLACE_HELP                                                :{BLACK}Permette di rimpiazzare un locomotore con uno di un altro tipo, quando i treni con quel locomotore entrano in un deposito
 STR_REPLACE_REMOVE_WAGON                                        :{BLACK}Rimozione vagoni: {ORANGE}{SKIP}{STRING}
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}La autosostituzione mantiene la lunghezza del treno togliendo vagoni (iniziando dalla testa), se la sostituzione della locomotiva lo farebbe piu lungo.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Sostituzione: {ORANGE}{SKIP}{SKIP}{STRING}
@@ -3078,7 +3085,7 @@
 STR_SNOW_LINE_QUERY_CAPT                                        :{WHITE}Cambia l'altezza delle nevi perenni
 STR_START_DATE_QUERY_CAPT                                       :{WHITE}Cambia l'anno di partenza
 STR_HEIGHTMAP_SCALE_WARNING_CAPTION                             :{WHITE}Avviso scala
-STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Ridimenzionare di molto la mappa sorgente non è consigliabile. Continuo con la generazione?
+STR_HEIGHTMAP_SCALE_WARNING_MESSAGE                             :{YELLOW}Ridimensionare di molto la mappa sorgente non è consigliabile. Continuo con la generazione?
 STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
 STR_HEIGHTMAP_NAME                                              :{BLACK}Nome Heightmap:
 STR_HEIGHTMAP_SIZE                                              :{BLACK}Dim.: {ORANGE}{NUM} x {NUM}
@@ -3091,7 +3098,7 @@
 STR_WORLD_GENERATION                                            :{BLACK}Generazione mondo
 STR_TREE_GENERATION                                             :{BLACK}Generazione alberi
 STR_UNMOVABLE_GENERATION                                        :{BLACK}Generazione oggetti non spostabili
-STR_CLEARING_TILES                                              :{BLACK}generazione aree brulle e rocciose
+STR_CLEARING_TILES                                              :{BLACK}Generazione aree brulle e rocciose
 STR_SETTINGUP_GAME                                              :{BLACK}Settaggio del gioco
 STR_PREPARING_TILELOOP                                          :{BLACK}Loop generazione tile del terreno
 STR_PREPARING_GAME                                              :{BLACK}Preparazione del gioco
@@ -3118,7 +3125,7 @@
 STR_INTERCONTINENTAL_AIRPORT                                    :{BLACK}Intercontinentale
 STR_HELIPORT                                                    :{BLACK}Eliporto
 STR_HELIDEPOT                                                   :{BLACK}Elideposito
-STR_HELISTATION                                                 :{BLACK}Elistatione
+STR_HELISTATION                                                 :{BLACK}Elistazione
 
 STR_SMALL_AIRPORTS                                              :{BLACK}Aeroporti piccoli
 STR_LARGE_AIRPORTS                                              :{BLACK}Aeroporti grandi
--- a/src/lang/japanese.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/japanese.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...所有者は {STRING}
 STR_013C_CARGO                                                  :{BLACK}貨物
@@ -590,6 +591,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}競争者の駅へ車両の初めての到着
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}事故/災害
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}会社情報
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}産業の開業/閉業
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}経済の変化
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}プレヤーの車両についての情報
 STR_020C_NEW_VEHICLES                                           :{YELLOW}車両の新登場
@@ -725,7 +727,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}灯台を建設します
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}送信機を建設します
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}砂漠を作成します。{}Control+クリックすると消去します
-STR_CREATE_LAKE                                                 :{BLACK}湖を作成します。{}海水位の場合は周辺地域を水浸します
+STR_CREATE_LAKE                                                 :{BLACK}。水を作成します。{}通常の使用時に運河を建設します。Controlをクリックすると、海水位にある地域が浸水できます。
 STR_0290_DELETE                                                 :{BLACK}破壊
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}この町を完全に破壊します
 STR_0292_SAVE_SCENARIO                                          :シナリオを保存
@@ -1088,6 +1090,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :プレヤーの会社
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :すべての会社
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}<ENTER>でのチームチャットを優先:{ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}マウススクロールの動作:{ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :地図をズーム
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :地図をスクロール
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :切
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}地図のスクロール速度:{ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}一人のプレヤーの列車数上限:{ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}一人のプレヤーの道路車両数上限:{ORANGE}{STRING}
@@ -1206,7 +1213,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}ランドムな木を植林します
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}ここに運河が建設できません...
-STR_BUILD_CANALS_TIP                                            :{BLACK}運河を建設します。Control+クリックすると海のタイルも建設できます(海水位にのみ)
+STR_BUILD_CANALS_TIP                                            :{BLACK}運河を建設します
 STR_LANDINFO_CANAL                                              :運河
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}ここに水門が建設できません...
@@ -2632,6 +2639,10 @@
 STR_TRAIN_NO_POWER                                              :{RED}電源はありません
 STR_TRAIN_START_NO_CATENARY                                     :線路は懸垂線がないため、この列車が動けません
 
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}{STRING}が新登場!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{STRING}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}{STRING}が新登場!ー{STRING}
+
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}道路車両があります
 STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - 道路車両{COMMA}両
@@ -2892,6 +2903,16 @@
 STR_NEWGRF_MD5SUM                                               :{BLACK}MD5sum:{SILVER}{STRING}
 STR_NEWGRF_CONFIRMATION_TEXT                                    :{YELLOW}実行中のゲームに変更を適用して、クラッシュのリスクがあります。{}続けてもよろしいですか?
 
+STR_NEWGRF_ERROR_MSG_INFO                                       :{SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_WARNING                                    :{RED}警告:{SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_ERROR                                      :{RED}エラー:{SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_FATAL                                      :{RED}エラー:{SILVER}{STRING}
+STR_NEWGRF_ERROR_VERSION_NUMBER                                 :{STRING}はOpenTTDのTTDPatchバージョンに対応していません。
+STR_NEWGRF_ERROR_DOS_OR_WINDOWS                                 :{STRING}はTTDの{STRING}バージョンのみに対応しています。
+STR_NEWGRF_ERROR_UNSET_SWITCH                                   :{STRING}を使用時に、{STRING}を入にしなければなりません
+STR_NEWGRF_ERROR_INVALID_PARAMETER                              :{STRING}のパラメータが不正:パラメータ {STRING}({NUM})
+STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{1:STRING}を読み込む前、{0:STRING}を読み込まなければなりません。
+STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING}は{STRING}の読み込み後のみに読み込めます。
 
 STR_NEWGRF_ADD                                                  :{BLACK}追加
 STR_NEWGRF_ADD_TIP                                              :{BLACK}NewGRFファイルをリストに追加します
@@ -3119,5 +3140,9 @@
 STR_MEASURE_AREA_HEIGHTDIFF                                     :{BLACK}地域:{NUM} x {NUM}{}高さの違い:{NUM} m
 
 ############ Date formatting
+STR_DATE_TINY                                                   :{2:NUM}-{1:STRING}-{0:STRING}
+STR_DATE_SHORT                                                  :{1:NUM}年{0:STRING}
+STR_DATE_LONG                                                   :{2:NUM}年{1:STRING}{0:STRING}
 
 ########
+
--- a/src/lang/korean.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/korean.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -281,6 +281,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}... {STRING}의 소유입니다.
 STR_013C_CARGO                                                  :{BLACK}화물
@@ -591,6 +592,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}경쟁사의 첫 차량 도착
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}사고 / 재앙
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}회사 정보
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}산업 띄우기 / 끄기
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}경제적 변화
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}조언 / 당신 차량에 대한 정보
 STR_020C_NEW_VEHICLES                                           :{YELLOW}새로운 차량
@@ -726,7 +728,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}등대를 놓습니다.
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}송신기를 놓습니다.
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}사막 지역을 지정합니다.{}CTRL키를 누른채로 지우십시오.
-STR_CREATE_LAKE                                                 :{BLACK}물을 지정합니다.{}해수면에 둘러싸이면 물로 채워질 것입니다.
+STR_CREATE_LAKE                                                 :{BLACK}수면 지역을 정의하세요.{}바다 높이에서 CTRL이 눌려 있지 않으면, 운하를 만들때 침수할 것입니다.
 STR_0290_DELETE                                                 :{BLACK}삭제
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}이 도시를 완전히 삭제
 STR_0292_SAVE_SCENARIO                                          :시나리오 저장
@@ -1089,6 +1091,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :내 회사
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :모든 회사
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}<ENTER>키로 우리 팀원끼리 채팅 : {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}스크롤의 역할: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :맵 줌
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :맵 스크롤
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :끄기
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}맵 스크롤 속도: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}최대 열차 수: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}최대 자동차 수: {ORANGE}{STRING}
@@ -1207,7 +1214,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}모든 종류의 나무를 무작위로 심습니다.
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}여기에 운하를 건설할 수 없습니다...
-STR_BUILD_CANALS_TIP                                            :{BLACK}운하를 건설합니다. CTRL키를 눌러 바다 타일을 건설하십시오 (해수면 높이에서만)
+STR_BUILD_CANALS_TIP                                            :{BLACK}운하 만들기
 STR_LANDINFO_CANAL                                              :운하
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}여기에 갑문을 지을 수 없습니다...
@@ -2633,6 +2640,10 @@
 STR_TRAIN_NO_POWER                                              :{RED}기관차 없음
 STR_TRAIN_START_NO_CATENARY                                     :연결고리가 모자라 운행을 시작할 수 없습니다.
 
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}신형 {STRING} 자동차가 출시되었습니다!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{STRING}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}신형 {STRING} 자동차가 출시되었습니다!  -  {STRING}
+
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}중간에 자동차가 있습니다.
 STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - {COMMA}대의 자동차
@@ -2893,9 +2904,17 @@
 STR_NEWGRF_MD5SUM                                               :{BLACK}MD5sum: {SILVER}{STRING}
 STR_NEWGRF_CONFIRMATION_TEXT                                    :{YELLOW}게임이 진행중인데 설정을 변경하려고 하면 게임과 충돌할 수도 있습니다.{}정말로 설정을 변경하시겠습니까?
 
+STR_NEWGRF_ERROR_MSG_INFO                                       :{SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_WARNING                                    :{RED}경고: {SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_ERROR                                      :{RED}오류: {SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_FATAL                                      :{RED}치명적 오류: {SILVER}{STRING}
+STR_NEWGRF_ERROR_VERSION_NUMBER                                 :{STRING}은 OpenTTD에서 보고된 TTD패치 버전에서 작동하지 않을 것입니다.
 STR_NEWGRF_ERROR_DOS_OR_WINDOWS                                 :{STRING}은/는 {STRING} 버젼의 TTD를 위한 것입니다.
+STR_NEWGRF_ERROR_UNSET_SWITCH                                   :{STRING}(은)는 {STRING}(와)과 사용되도록 디자인되었습니다
+STR_NEWGRF_ERROR_INVALID_PARAMETER                              :{STRING}의 부적절한 파라미터: 파라미터 {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING}은/는 반드시 {STRING}이전에 불러와야 합니다.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING}은/는 반드시 {STRING}다음에 불러와야 합니다.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF 파일 자체는 번역용으로 디자인됨
 
 STR_NEWGRF_ADD                                                  :{BLACK}추가
 STR_NEWGRF_ADD_TIP                                              :{BLACK}NewGRF 파일을 목록에 추가
@@ -3123,5 +3142,10 @@
 STR_MEASURE_AREA_HEIGHTDIFF                                     :{BLACK}넓이: {NUM} x {NUM}{}고도차: {NUM} m
 
 ############ Date formatting
+STR_DATE_TINY                                                   :{STRING}-{STRING}-{NUM}
+STR_DATE_SHORT                                                  :{STRING} {NUM}
+STR_DATE_LONG                                                   :{STRING} {STRING} {NUM}
 
 ########
+
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}환승 단위: {LTBLUE}{CURRENCY}
--- a/src/lang/lithuanian.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/lithuanian.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -759,7 +759,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Statyti švyturį
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Statyti siųstuvą
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Nurodyti dykumos plotus{}Laikant nuspaustą VALD (CTRL) galima ją pašalinti
-STR_CREATE_LAKE                                                 :{BLACK}Pazymeti kaip vandeni, aplinkines zemes bus uztvindytos, jei bus juros lygyje
 STR_0290_DELETE                                                 :{BLACK}Šalinti
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Šalinti šį miestą
 STR_0292_SAVE_SCENARIO                                          :Išsaugoti scenarijų
@@ -1239,7 +1238,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Sodina atsitiktinės rūšies medžius
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Neimanoma cia iskasti kanalu...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Kasti kanalus
 STR_LANDINFO_CANAL                                              :Kanalas
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Neimanoma cia irengti sliuzu...
--- a/src/lang/norwegian_bokmal.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/norwegian_bokmal.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -725,7 +725,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Plasser fyrtårn
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Plasser radiosender
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Definer ørkenområde.{}Trykk og hold inne CTRL for å fjerne den
-STR_CREATE_LAKE                                                 :{BLACK}Definer vannområde.{}Det vil oversvømme området rundt hvis det er på sjønivå
 STR_0290_DELETE                                                 :{BLACK}Slett
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Slett denne byen fullstendig
 STR_0292_SAVE_SCENARIO                                          :Lagre scenario
@@ -1206,7 +1205,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Plasser trær av tilfeldig type
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Kan ikke bygge kanaler her...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Bygg kanaler. Trykk CTRL for å plassere sjøområder (kun på havnivå).
 STR_LANDINFO_CANAL                                              :Kanal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Kan ikke bygge sluser her...
--- a/src/lang/norwegian_nynorsk.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/norwegian_nynorsk.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -281,6 +281,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...ått av {STRING}
 STR_013C_CARGO                                                  :{BLACK}Last
@@ -591,6 +592,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Første køyretøy kjem fram på stasjonen til motstandaren
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Ulykker/katastrofar
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Firma informasjon
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Opning / stenging av industriar
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Økonomiske endringar
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Råd/informasjon om køyretøya til spelaren
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nye køyretøy
@@ -726,7 +728,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Plasser fyrtårn
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Plasser radiosendar
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Definer ørkenområde.{}Trykk og held inne CTRL for å fjerne det
-STR_CREATE_LAKE                                                 :{BLACK}Definer vassområde.{}Det vil fløyme landa rundt dersom det er på høgd med sjøen.
 STR_0290_DELETE                                                 :{BLACK}Slett
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Slett byen heilt
 STR_0292_SAVE_SCENARIO                                          :Lagre scenario
@@ -1089,6 +1090,9 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Eige firma
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Alle firma
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Foretrekk lagchat med <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Funksjonen til scrollhjulet: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom kart
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scroll kart
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Maks antal tog per speler: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Maks antal køyretøy per spelar: {ORANGE}{STRING}
@@ -1207,7 +1211,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Plasser tre av tilfeldig type
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Kan ikkje byggje kanalar her...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Bygg kanalar. Trykk CTRL for å plassere sjøområde (kun på havnivå)
+STR_BUILD_CANALS_TIP                                            :{BLACK}Lag kanalar
 STR_LANDINFO_CANAL                                              :Kanal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Kan ikkje byggje sluser her...
@@ -2907,6 +2911,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Ugyldig parameter for {STRING}: parameter {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} må være lasta før{STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} må være lasta etter {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF fila den var laga for å omsetje
 
 STR_NEWGRF_ADD                                                  :{BLACK}Legg til
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Legg ei ny NewGRF-fil til lista
--- a/src/lang/polish.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/polish.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -333,6 +333,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...w posiadaniu {STRING}
 STR_013C_CARGO                                                  :{BLACK}Ładunek
@@ -643,6 +644,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Przybycie pierwszego pojazdu do stacji przeciwnika
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Wypadki / klęski
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informacja firmy
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Otwarcie / zamknięcie przedsiębiorstw
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Zmiany ekonomiczne
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Porady / informacje o pojazdach gracza
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nowe pojazdy
@@ -812,7 +814,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Umieść latarnię morską
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Umieść nadajnik
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Definiuj obszar pustyni.{}Wciśnij i trzymaj CTRL by usunąć
-STR_CREATE_LAKE                                                 :{BLACK}Definiuj akwen wodny.{}Okolice będą zalane jeśli są na poziomie morza
+STR_CREATE_LAKE                                                 :{BLACK}Stwórz akwen wodny.{}Tworzy kanał, chyba że przyrzymany jest CTRL na poziomie morza, wtedy pobliski teren zostanie zatopiony
 STR_0290_DELETE                                                 :{BLACK}Skasuj
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Skasuj to miasto
 STR_0292_SAVE_SCENARIO                                          :Zapisz scenariusz
@@ -1175,6 +1177,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Własnej firmy
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Wszystkich firm
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Preferuj czat drużynowy po użyciu <ENTER> lub <T>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Funkcja rolki myszy: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Powiększ widok
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Przesuń widok
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Rolka wyłączona
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Prędkość przesuwania widoku: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Maks. liczba pociągów na gracza: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Maks. liczba samochodów na gracza: {ORANGE}{STRING}
@@ -1293,7 +1300,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Sadzenie drzew rożnych rodzajów
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Nie można tutaj wybudować kanału...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Buduj kanały
+STR_BUILD_CANALS_TIP                                            :{BLACK}Buduj kanały.
 STR_LANDINFO_CANAL                                              :Kanał
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Nie można tutaj wybudować śluzy...
@@ -2482,7 +2489,7 @@
 STR_8087_TALBOTT_LIVESTOCK_VAN                                  :Ciężarówka na żywiec Talbott
 STR_8088_UHL_LIVESTOCK_VAN                                      :Ciężarówka na żywiec Uhl
 STR_8089_FOSTER_LIVESTOCK_VAN                                   :Ciężarówka na żywiec Foster
-STR_808A_BALOGH_GOODS_TRUCK                                     :Ciężarówka towarowy Balogh
+STR_808A_BALOGH_GOODS_TRUCK                                     :Ciężarówka towarowa Balogh
 STR_808B_CRAIGHEAD_GOODS_TRUCK                                  :Ciężarówka towarowa Craighead
 STR_808C_GOSS_GOODS_TRUCK                                       :Ciężarówka towarowa Goss
 STR_808D_HEREFORD_GRAIN_TRUCK                                   :Ciężarówka na ziarno Hereford
@@ -2520,7 +2527,7 @@
 STR_80AD_RMT_RUBBER_TRUCK                                       :Ciężarówka na kauczuk RMT
 STR_80AE_MIGHTYMOVER_SUGAR_TRUCK                                :Ciężarówka na cukier MightyMover
 STR_80AF_POWERNAUGHT_SUGAR_TRUCK                                :Ciężarówka na cukier Powernaught
-STR_80B0_WIZZOWOW_SUGAR_TRUCK                                   :Ciężarówka do cukier Wizzowow
+STR_80B0_WIZZOWOW_SUGAR_TRUCK                                   :Ciężarówka na cukier Wizzowow
 STR_80B1_MIGHTYMOVER_COLA_TRUCK                                 :Cysterna na Colę MightyMover
 STR_80B2_POWERNAUGHT_COLA_TRUCK                                 :Cysterna na Colę Powernaught
 STR_80B3_WIZZOWOW_COLA_TRUCK                                    :Cysterna na Colę Wizzowow
@@ -3035,6 +3042,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Niewłaściwy parametr dla {STRING}: parametr {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} musi być wczytany przed {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} musi być wczytany po {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :pliku GRF który miał być tłumaczony
 
 STR_NEWGRF_ADD                                                  :{BLACK}Dodaj
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Dodaj plik NewGRF do listy
--- a/src/lang/portuguese.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/portuguese.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :SO/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...propriedade de {STRING}
 STR_013C_CARGO                                                  :{BLACK}Carga
@@ -590,6 +591,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Chegada do primeiro veículo à estação de um oponente
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Acidentes / desastres
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informações da empresa
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Abertura / Fecho de indústrias
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Alterações económicas
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Avisos / informações dos veículos do jogador
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Novos veículos
@@ -725,7 +727,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Colocar farol
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Colocar transmissor
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Definir área de deserto.{}Manter a tecla CTRL pressionada para remover
-STR_CREATE_LAKE                                                 :{BLACK}Definir área de água.{}A área adjacente será inundada se estiver ao nível do mar
 STR_0290_DELETE                                                 :{BLACK}Apagar
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Apagar completamente esta cidade
 STR_0292_SAVE_SCENARIO                                          :Guardar cenário
@@ -1206,7 +1207,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Colocar árvores de tipo aleatório
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Não é possível construir canais aqui...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Construir canais
 STR_LANDINFO_CANAL                                              :Canal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Não é possível construir diques aqui...
--- a/src/lang/romanian.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/romanian.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -724,7 +724,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Plaseazã far
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Plaseazã transmitãtor
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Defineste suprafata de desert.{}Apasã si mentine apasat CTRL pentru a o sterge
-STR_CREATE_LAKE                                                 :{BLACK}Defineste suprafata cu apã.{}Împrejurimile aflate la acelasi nivel vor fi inundate
 STR_0290_DELETE                                                 :{BLACK}Sterge
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Sterge acest oras
 STR_0292_SAVE_SCENARIO                                          :Salveazã scenariul
@@ -1205,7 +1204,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Planteazã arbori din diverse specii la întâmplare
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Nu pot construi un canal aici...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Construieste canale
 STR_LANDINFO_CANAL                                              :Canal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Nu pot construi o ecluzã aici...
--- a/src/lang/russian.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/russian.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -282,6 +282,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...принадлежащий {STRING}
 STR_013C_CARGO                                                  :{BLACK}Груз
@@ -592,6 +593,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Первое трансп. средство противника на станции
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Аварии/Катастрофы
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Информация о Компании
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Открытие / закрытие промышленности
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Изменения в экономике
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Сообщения о транспорте игрока
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Новый транспорт
@@ -727,7 +729,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Поставить маяк
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Поставить передатчик
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Задать площадь пустыни.{}Нажмите и держите CTRL для удаления
-STR_CREATE_LAKE                                                 :{BLACK}Определить водный простор.{} Затопит землю, если на уровне моря
+STR_CREATE_LAKE                                                 :{BLACK}Указать водную область.{}Создать канал, или наводнить всю окружающую область при зажатом CTRL на уровне моря.
 STR_0290_DELETE                                                 :{BLACK}Уничтожить
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Полностью уничтожить этот город
 STR_0292_SAVE_SCENARIO                                          :Сохранить сценарий
@@ -1021,7 +1023,7 @@
 STR_CONFIG_PATCHES_EXTRADYNAMITE                                :{LTBLUE}Разрешить удаление всех городских объектов: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAMMOTHTRAINS                                :{LTBLUE}Разрешить строительство очень длинных поездов: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_REALISTICACCEL                               :{LTBLUE}Включить реалистичное ускорение для поездов: {ORANGE}{STRING}
-STR_CONFIG_PATCHES_FORBID_90_DEG                                :{LTBLUE}Запретить резкие повороты поездам и кораблям: {ORANGE}{STRING} {LTBLUE}(NPF/YAPF)
+STR_CONFIG_PATCHES_FORBID_90_DEG                                :{LTBLUE}Запретить резкие повороты поездам и кораблям: {ORANGE}{STRING} {LTBLUE}(NPF)
 STR_CONFIG_PATCHES_JOINSTATIONS                                 :{LTBLUE}Объединять построенные рядом ж/д станции: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_FULLLOADANY                                  :{LTBLUE}Покидать станцию, когда любой груз полностью загружен: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_IMPROVEDLOAD                                 :{LTBLUE}Использовать улучшенный алгоритм загрузки: {ORANGE}{STRING}
@@ -1090,6 +1092,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :только для своей компании
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :для всех компаний
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Предпочитать командный чат при нажатии Enter: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Использовать колесо прокрутки: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :для масштабирования
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :для смещения обзора
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :не использовать
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Скорость смещения обзора прокруткой колеса мыши: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Максимальное количество поездов на игрока: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Максимальное количество автомобилей на игрока: {ORANGE}{STRING}
@@ -1208,7 +1215,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Разместить деревья случайного типа
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Невозможно построить канал здесь...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Проложить канал
+STR_BUILD_CANALS_TIP                                            :{BLACK}Строить каналы.
 STR_LANDINFO_CANAL                                              :Канал
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Невозможно построить шлюз здесь...
--- a/src/lang/simplified_chinese.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/simplified_chinese.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}归 {STRING} 所有
 STR_013C_CARGO                                                  :{BLACK}货物
@@ -725,7 +726,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}放置灯塔
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}放置转播塔
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}定义沙漠区域。{}摁住 CTRL 可以去掉沙漠区域。
-STR_CREATE_LAKE                                                 :{BLACK}定义睡眠。{}在海平面高度的水面将淹没周围的区域。
 STR_0290_DELETE                                                 :{BLACK}删除
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}完全删除这座城镇
 STR_0292_SAVE_SCENARIO                                          :保存场景
@@ -1206,7 +1206,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}种植随机类型的树木
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}不能在这里兴建运河……
-STR_BUILD_CANALS_TIP                                            :{BLACK}兴建运河。点击 CTRL 可以增加海面 (仅在平面有效)。
 STR_LANDINFO_CANAL                                              :运河
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}不能在这里兴建船闸……
@@ -2632,6 +2631,9 @@
 STR_TRAIN_NO_POWER                                              :{RED}没有电力
 STR_TRAIN_START_NO_CATENARY                                     :这不是电气化铁路,电力机车不能启动
 
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}新 {STRING} 上市了!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{STRING}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}新 {STRING} 上市了!  -  {STRING}
 
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}指定的位置有汽车
@@ -3136,3 +3138,4 @@
 
 ########
 
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}转运评分: {LTBLUE}{CURRENCY}
--- a/src/lang/slovak.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/slovak.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -344,6 +344,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}... vlastníkom je {STRING}
 STR_013C_CARGO                                                  :{BLACK}Náklad
@@ -654,6 +655,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Prijazd prveho vozidla do stanice konkurencie
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Havarie / Katastrofy
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informacie o spolocnosti
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Vznik a zánik priemyslu
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Zmeny v ekonomike
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Oznamenia / Informacie o vozidlach hraca
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nove vozidla
@@ -789,7 +791,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Umiestnit majak
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Umiestnit vysielac
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Vytvorit oblast puste.{}Drzanim CTRL ju odstranite
-STR_CREATE_LAKE                                                 :{BLACK}Vytvorit oblast vody.{}Okolie bude tiez zaplavene, ak je na urovni mora
+STR_CREATE_LAKE                                                 :{BLACK}Definovat oblast vody.{}Vytvorí kanál, pri stlacení CTRL na úrovni mora zaplaví okolie
 STR_0290_DELETE                                                 :{BLACK}Vymazat
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Kompletne vymazat toto mesto
 STR_0292_SAVE_SCENARIO                                          :Ulozit scenar
@@ -1152,6 +1154,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Vlastna spolocnost
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Vsetky spolocnosti
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Preferovaný teamový chat: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Funkcia scrolovacieho kolieska: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zvacšit mapu
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Posúvat mapu
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Vypnuté
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Rychlost posúvania mapy: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Maximalny pocet vlakov hraca: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Maximalny pocet automobilov hraca: {ORANGE}{STRING}
@@ -1270,7 +1277,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Umiestnit nahodne stromy
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Tu sa neda postavit prieplav ...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Postavit prieplavy
+STR_BUILD_CANALS_TIP                                            :{BLACK}Stavba kanálov.
 STR_LANDINFO_CANAL                                              :Prieplav
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Tu sa neda postavit stavidlo ...
@@ -2970,6 +2977,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Neplatný parameter {STRING}: parameter {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} musí byt nahratý pred {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} musí byt nahratý po {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF súbor bol navrhnutý na preklad
 
 STR_NEWGRF_ADD                                                  :{BLACK}Pridat
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Pridat NewGRF súbor do zoznamu
--- a/src/lang/slovenian.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/slovenian.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -322,6 +322,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE} ... v lasti {STRING}
 STR_013C_CARGO                                                  :{BLACK}Tovor
@@ -632,6 +633,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Prihod prvega vozila na nasprotnikovo postajo
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Nesreče / katastrofe
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Informacije o podjetju
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Odpiranje / zapiranje industrij
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Ekonomske spremembe
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Nasveti / informacije o igralčevem vozilu
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nova vozila
@@ -767,7 +769,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Postavi svetilnik
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Postavi oddajnik
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Določi območja puščave.{}Pritisni in drži CTRL za odstranitev
-STR_CREATE_LAKE                                                 :{BLACK}Določi vodno območje.{}Voda bo poplavila okolico, če bo na višini morja
 STR_0290_DELETE                                                 :{BLACK}Izbriši
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Popolnoma izbriši mesto
 STR_0292_SAVE_SCENARIO                                          :Shrani scenarij
@@ -1130,6 +1131,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Lastno podjetje
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Vsa podjetja
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Izberi skupinski pogovor z <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Funkcija kolesca miške: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Približaj zemljevid
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Premikaj zemljevid
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Izklopljeno
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Hitrost premika s kolescem miške: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Največ vlakov na igralca: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Največ cestnih vozil na igralca: {ORANGE}{STRING}
@@ -1248,7 +1254,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Postavi drevesa naključne vrste
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Ni mogoče zgraditi kanalov tukaj ...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Gradnja kanalov. CTRL+klik za postavitev morskih kvadratkov{}(samo na višini gladine morja)
 STR_LANDINFO_CANAL                                              :Kanal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Ni mogoče zgraditi zapornic tukaj ...
@@ -2986,6 +2991,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Neveljavna nastavitev za {STRING}: nastavitev {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} je potrebno naložiti pred {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} je potrebno naložiti po {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF datoteka je bila narejena za prevod
 
 STR_NEWGRF_ADD                                                  :{BLACK}Dodaj
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Dodaj NewGRF datoteko na seznam
--- a/src/lang/spanish.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/spanish.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -281,6 +281,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...propiedad de {STRING}
 STR_013C_CARGO                                                  :{BLACK}Carga
@@ -591,6 +592,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Llegada del 1er veh. estación de la competencia
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Accidentes / desastres
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Información de la empresa
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Aperturas/ cierres de industrias
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Cambios en la economía
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Sugerencias/info. sobre vehículos del jugador
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nuevos vehículos
@@ -726,7 +728,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Colocar faro
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Colocar transmisor
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Define área desertica.{}Pulsa y mantén CTRL para quitarla
-STR_CREATE_LAKE                                                 :{BLACK}Define zona de água.{}Inundará los alrededores hasta nivel del mar
+STR_CREATE_LAKE                                                 :{BLACK}Define el area de agua.{}Haz un canal, a menos que mantengas pulsado CTRL a nivel del mar, entonces se inundarán los alrededores del lugar
 STR_0290_DELETE                                                 :{BLACK}Borrar
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Borrar esta población completamente
 STR_0292_SAVE_SCENARIO                                          :Guardar escenario
@@ -1089,6 +1091,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Propia empresa
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Todas las empresas
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Charla de equipo preferida con <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Función de la rueda de scroll: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom sobre el mapa
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scroll sobre el mapa
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Nada
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Velocidad del scroll sobre el mapa: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Máx trenes por jugador: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Máx vehículos de carretera por jugador: {ORANGE}{STRING}
@@ -1207,7 +1214,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Colocar distintos árboles al azar
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}No se pueden construir canales aquí...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Construir canales
+STR_BUILD_CANALS_TIP                                            :{BLACK}Construir canales.
 STR_LANDINFO_CANAL                                              :Canal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}No se pueden construir dársenas aquí...
@@ -2633,6 +2640,10 @@
 STR_TRAIN_NO_POWER                                              :{RED}Sin potencia
 STR_TRAIN_START_NO_CATENARY                                     :Esta vía carece la catenaria, así que el tren no puede comenzar
 
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}Nuevo{STRING} ahora disponible!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{STRING}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Nuevo {STRING} ahora disponible!  -  {STRING}
+
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Vehículo de carretera en camino
 STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - {COMMA} Vehículos de Carretera
@@ -2903,6 +2914,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Parámetro incorrecto para {STRING}: parametro {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} debe ser cargado antes de {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} debe ser cargado después de {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :el fichero GRF ha sido diseñado para ser traducido
 
 STR_NEWGRF_ADD                                                  :{BLACK}Añadir
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Añadir un NewGRF a la lista
@@ -3135,3 +3147,5 @@
 STR_DATE_LONG                                                   :{STRING} {STRING} {NUM}
 
 ########
+
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Transferir Créditos: {LTBLUE}{CURRENCY}
--- a/src/lang/swedish.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/swedish.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...ägs av {STRING}
 STR_013C_CARGO                                                  :{BLACK}Gods
@@ -590,6 +591,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Ankomst av första fordonet vid konkurrenternas stn.
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Olyckor / katastrofer
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Företagsinformation
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Öppning / stängning av industrier
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Förändringar av ekonomin
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Råd / information om spelarens fordon
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Nya fordon
@@ -725,7 +727,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Placera fyrtorn
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Placera radiosändare
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Definiera ökenområde.{}Tryck och håll CTRL för att ta bort
-STR_CREATE_LAKE                                                 :{BLACK}Definiera vattenområde.{}Den fyller närområdet om det ligger i sjönivå
+STR_CREATE_LAKE                                                 :{BLACK}Definiera vattenyta.{}Skapa en kanal, om inte CTRL är nedhållen vid havsnivå, då den kommer att översvämma närliggande områden istället
 STR_0290_DELETE                                                 :{BLACK}Ta bort
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Ta bort staden helt och hållet
 STR_0292_SAVE_SCENARIO                                          :Spara scenario
@@ -1088,6 +1090,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Egna företaget
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Alla företag
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Prioritera lagchat med <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Mushjulsfunktion: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zooma kartan
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Scrolla kartan
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Avstängd
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Mushjulshastighet: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Max antal tåg per spelare: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Max antal vägfordon per spelare: {ORANGE}{STRING}
@@ -1206,7 +1213,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Placera träd av olika typ
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Kan inte bygga kanaler här...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Bygg kanaler. Håll ner CTRL för att bygga vid angränsande vatten.
+STR_BUILD_CANALS_TIP                                            :{BLACK}Bygg kanaler.
 STR_LANDINFO_CANAL                                              :Kanal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Kan inte bygga slussar här...
@@ -2632,6 +2639,10 @@
 STR_TRAIN_NO_POWER                                              :{RED}Ingen Kraft
 STR_TRAIN_START_NO_CATENARY                                     :Detta spår saknar kedjekurva, så tåget kan inte starta
 
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}Nya {STRING} är nu tillgänglig!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{STRING}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}Nya {STRING} är nu tillgänglig  -  {STRING}
+
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Vägfordon i vägen
 STR_9001_ROAD_VEHICLES                                          :{WHITE}{COMPANY} - {COMMA} Vägfordon
@@ -2902,6 +2913,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Felaktig parameter för {STRING}: parameter {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} måste laddas innan {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} måste laddas efter {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF-filen den var designad att översätta
 
 STR_NEWGRF_ADD                                                  :{BLACK}Lägg till
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Lägg till en ny NewGRF-fil till listan
@@ -3134,3 +3146,5 @@
 STR_DATE_LONG                                                   :{STRING} {STRING} {NUM}
 
 ########
+
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Överföringingskredit: {LTBLUE}{CURRENCY}
--- a/src/lang/traditional_chinese.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/traditional_chinese.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -280,6 +280,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...已被{STRING}擁有
 STR_013C_CARGO                                                  :{BLACK}貨物
@@ -410,16 +411,16 @@
 STR_SEND_FOR_SERVICING                                          :送去維護
 
 ############ range for months starts
-STR_0162_JAN                                                    :一月
-STR_0163_FEB                                                    :二月
-STR_0164_MAR                                                    :三月
-STR_0165_APR                                                    :四月
-STR_0166_MAY                                                    :五月
-STR_0167_JUN                                                    :六月
-STR_0168_JUL                                                    :七月
-STR_0169_AUG                                                    :八月
-STR_016A_SEP                                                    :九月
-STR_016B_OCT                                                    :十月
+STR_0162_JAN                                                    :1
+STR_0163_FEB                                                    :2
+STR_0164_MAR                                                    :3
+STR_0165_APR                                                    :4
+STR_0166_MAY                                                    :5
+STR_0167_JUN                                                    :6
+STR_0168_JUL                                                    :7
+STR_0169_AUG                                                    :8
+STR_016A_SEP                                                    :9
+STR_016B_OCT                                                    :10
 STR_016C_NOV                                                    :十一月
 STR_016D_DEC                                                    :十二月
 ############ range for months ends
@@ -495,37 +496,37 @@
 STR_01AB                                                        :{BLACK}{TINYFONT}{STRING}
 
 ############ range for days starts
-STR_01AC_1ST                                                    :一日
-STR_01AD_2ND                                                    :二日
-STR_01AE_3RD                                                    :三日
-STR_01AF_4TH                                                    :四日
-STR_01B0_5TH                                                    :五日
-STR_01B1_6TH                                                    :六日
-STR_01B2_7TH                                                    :七日
-STR_01B3_8TH                                                    :八日
-STR_01B4_9TH                                                    :九日
-STR_01B5_10TH                                                   :十日
-STR_01B6_11TH                                                   :十一日
-STR_01B7_12TH                                                   :十二日
-STR_01B8_13TH                                                   :十三日
-STR_01B9_14TH                                                   :十四日
-STR_01BA_15TH                                                   :十五日
-STR_01BB_16TH                                                   :十六日
-STR_01BC_17TH                                                   :十七日
-STR_01BD_18TH                                                   :十八日
-STR_01BE_19TH                                                   :十九日
-STR_01BF_20TH                                                   :二十日
-STR_01C0_21ST                                                   :二十一日
-STR_01C1_22ND                                                   :二十二日
-STR_01C2_23RD                                                   :二十三日
-STR_01C3_24TH                                                   :二十四日
-STR_01C4_25TH                                                   :二十五日
-STR_01C5_26TH                                                   :二十六日
-STR_01C6_27TH                                                   :二十七日
-STR_01C7_28TH                                                   :二十八日
-STR_01C8_29TH                                                   :二十九日
-STR_01C9_30TH                                                   :三十日
-STR_01CA_31ST                                                   :三十一日
+STR_01AC_1ST                                                    :1
+STR_01AD_2ND                                                    :2
+STR_01AE_3RD                                                    :3
+STR_01AF_4TH                                                    :4
+STR_01B0_5TH                                                    :5
+STR_01B1_6TH                                                    :6
+STR_01B2_7TH                                                    :7
+STR_01B3_8TH                                                    :8
+STR_01B4_9TH                                                    :9
+STR_01B5_10TH                                                   :10
+STR_01B6_11TH                                                   :11
+STR_01B7_12TH                                                   :12
+STR_01B8_13TH                                                   :13
+STR_01B9_14TH                                                   :14
+STR_01BA_15TH                                                   :15
+STR_01BB_16TH                                                   :16
+STR_01BC_17TH                                                   :17
+STR_01BD_18TH                                                   :18
+STR_01BE_19TH                                                   :19
+STR_01BF_20TH                                                   :20
+STR_01C0_21ST                                                   :21
+STR_01C1_22ND                                                   :22
+STR_01C2_23RD                                                   :23
+STR_01C3_24TH                                                   :24
+STR_01C4_25TH                                                   :25
+STR_01C5_26TH                                                   :26
+STR_01C6_27TH                                                   :27
+STR_01C7_28TH                                                   :28
+STR_01C8_29TH                                                   :29
+STR_01C9_30TH                                                   :30
+STR_01CA_31ST                                                   :31
 ############ range for days ends
 
 STR_01CB                                                        :{TINYFONT}{COMMA}
@@ -590,6 +591,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}首個交通工具已到達競爭對手的車站
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}意外 / 災難
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}公司資訊
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}工業開張/倒閉消息
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}經濟氣候變化
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}給玩家的載具的建議或資訊
 STR_020C_NEW_VEHICLES                                           :{YELLOW}新載具
@@ -725,7 +727,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}建立燈塔
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}建立發射站
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}定義沙漠區。{}請按住 CTRL 移除
-STR_CREATE_LAKE                                                 :{BLACK}定義水區。{}如果在海平面的話會淹沒周圍地區
 STR_0290_DELETE                                                 :{BLACK}刪除
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}完全移除這個市鎮
 STR_0292_SAVE_SCENARIO                                          :儲存場景
@@ -738,7 +739,7 @@
 STR_0298_LOAD_SCENARIO                                          :{WHITE}載入場景
 STR_0299_SAVE_SCENARIO                                          :{WHITE}儲存場景
 STR_029A_PLAY_SCENARIO                                          :{BLACK}以此場景開始
-STR_PLAY_HEIGHTMAP                                              :{BLACK}玩高度圖
+STR_PLAY_HEIGHTMAP                                              :{BLACK}載入高度圖
 STR_PLAY_HEIGHTMAP_HINT                                         :{BLACK}以高度圖為地形開始新遊戲
 STR_QUIT_SCENARIO_QUERY                                         :{YELLOW}你要離開這個場景嗎?
 STR_029C_QUIT_EDITOR                                            :{WHITE}離開編輯器
@@ -1088,6 +1089,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :自己的公司
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :所有公司
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}按 <ENTER> 鍵與小隊交談: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}滑鼠滾輪作用: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :放大地圖
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :捲動地圖
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :關閉
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}滾輪地圖捲動速度: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}每位玩家可擁有列車數目: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}每位玩家可擁有車輛數目: {ORANGE}{STRING}
@@ -1205,8 +1211,7 @@
 STR_TREES_RANDOM_TYPE                                           :{BLACK}隨機種類樹木
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}種植隨機種類樹木
 
-STR_CANT_BUILD_CANALS                                           :{WHITE}不可以在這裏興建運河...
-STR_BUILD_CANALS_TIP                                            :{BLACK}興建運河。按 CTRL 鍵 (只限於海平面)
+STR_CANT_BUILD_CANALS                                           :{WHITE}不可以在這裏開鑿運河...
 STR_LANDINFO_CANAL                                              :運河
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}不可以在這裏興建水閘...
@@ -2497,13 +2502,13 @@
 STR_8807_GO_TO_TRANSFER                                         :前往 {STATION} (轉運,僅載不卸)
 STR_8808_GO_TO_UNLOAD                                           :前往 {STATION} (卸客貨)
 STR_8809_GO_TO_TRANSFER_UNLOAD                                  :前往 {STATION} (轉運,卸客貨清空離站)
-STR_880A_GO_TO_LOAD                                             :前往 {STATION} (載客貨)
+STR_880A_GO_TO_LOAD                                             :前往 {STATION} (載貨)
 STR_880B_GO_TO_TRANSFER_LOAD                                    :前往 {STATION} (轉運,等待滿載)
 STR_880C_GO_NON_STOP_TO                                         :前往 {STATION} 不停靠/中途不停
 STR_880D_GO_TO_NON_STOP_TRANSFER                                :前往 {STATION} (轉運,僅載不卸) 中途不停
 STR_880E_GO_NON_STOP_TO_UNLOAD                                  :前往 {STATION} (卸客貨) 中途不停
 STR_880F_GO_TO_NON_STOP_TRANSFER_UNLOAD                         :前往 {STATION} (轉運,卸客貨清空離站) 中途不停
-STR_8810_GO_NON_STOP_TO_LOAD                                    :前往 {STATION} (載客貨) 中途不停
+STR_8810_GO_NON_STOP_TO_LOAD                                    :前往 {STATION} (載貨) 中途不停
 STR_8811_GO_TO_NON_STOP_TRANSFER_LOAD                           :前往 {STATION} (轉運,等待滿載) 中途不停
 STR_GO_TO_TRAIN_DEPOT                                           :前往 {TOWN} 機廠
 STR_SERVICE_AT_TRAIN_DEPOT                                      :在 {TOWN} 機廠維護
@@ -2632,6 +2637,9 @@
 STR_TRAIN_NO_POWER                                              :{RED}沒有電力
 STR_TRAIN_START_NO_CATENARY                                     :這個軌道沒有電氣化,所以列車無法起動
 
+STR_NEW_VEHICLE_NOW_AVAILABLE                                   :{BLACK}{BIGFONT}{STRING} 問世了!
+STR_NEW_VEHICLE_TYPE                                            :{BLACK}{BIGFONT}{STRING}
+STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE                         :{BLACK}{STRING} 問世了! -  {STRING}
 
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}前方有汽車
@@ -2903,6 +2911,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              : {STRING} 的參數無效: {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :載入前 {1:STRING} 必須先載入 {0:STRING}。
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} 必須在 {STRING} 之後載入。
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF 檔案翻譯後出現錯誤
 
 STR_NEWGRF_ADD                                                  :{BLACK}新增
 STR_NEWGRF_ADD_TIP                                              :{BLACK}為清單加入新的 NewGRF 檔
@@ -3131,6 +3140,9 @@
 
 ############ Date formatting
 STR_DATE_TINY                                                   :{STRING}-{STRING}-{NUM}
+STR_DATE_SHORT                                                  :{STRING} {NUM}
+STR_DATE_LONG                                                   :{2:NUM} 年 {1:STRING} 月 {0:STRING} 日
 
 ########
 
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}轉運進帳: {LTBLUE}{CURRENCY}
--- a/src/lang/turkish.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/turkish.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -725,7 +725,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Deniz feneri koy
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Verici koy
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Çöl yap, kaldırmak için CTRL'ye basılı tut
-STR_CREATE_LAKE                                                 :{BLACK}Su yap, deniz seviyesindeki yerler suyla dolar
 STR_0290_DELETE                                                 :{BLACK}Sil
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Sehri tamamen sil
 STR_0292_SAVE_SCENARIO                                          :Kaydet
@@ -1206,7 +1205,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Rastgele türde ağaçlar koy
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Buraya kanal yapılamaz...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Kanal Yap
 STR_LANDINFO_CANAL                                              :Kanal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Buraya kilit yapılamaz...
--- a/src/lang/ukrainian.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/ukrainian.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -406,6 +406,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...власність {STRING}
 STR_013C_CARGO                                                  :{BLACK}Вантаж
@@ -716,6 +717,7 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Прибуття першого транспорту на станцію конкурента
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Нещасні випадки/стихійні лиха
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Інформація компанії
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Відкриття / закриття підприємств
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Зміни в економіці
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Поради/інформація про транспорт гравця
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Новий транспорт
@@ -851,7 +853,7 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Поставити маяк
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Поставити ретранслятор
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Позначити територію пустелі.{}Натисніть і утримуйте CTRL, щоб відмінити
-STR_CREATE_LAKE                                                 :{BLACK}Позначити територію води.{}Заповниться водою, якщо на рівні моря
+STR_CREATE_LAKE                                                 :{BLACK}Позначити, де буде вода.{}Make a canal, unless CTRL is held down at sea level, when it will flood the surroundings instead
 STR_0290_DELETE                                                 :{BLACK}Видалити
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Видалити місто повністю
 STR_0292_SAVE_SCENARIO                                          :Зберегти сценарій
@@ -1214,6 +1216,11 @@
 STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Моя компанія
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Всі компанії
 STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Командний чат по <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Функція колеса миші: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Масштаб карти
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Прокрутка карти
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Відкл.
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Швидкість прокрутки колесом миші: {ORANGE}{STRING}
 
 STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Макс. поїздів у гравця: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Макс. авто у гравця: {ORANGE}{STRING}
@@ -1332,7 +1339,7 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Садити дерева випадкового типу
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Неможливо будувати канал тут...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Будувати канал
+STR_BUILD_CANALS_TIP                                            :{BLACK}Будувати канали.
 STR_LANDINFO_CANAL                                              :Канал
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Неможливо будувати шлюз тут...
@@ -3069,6 +3076,7 @@
 STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Помилковий параметр для {STRING}: параметр {STRING} ({NUM})
 STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} має бути завантажений до {STRING}.
 STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} має бути завантажений після {STRING}.
+STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE                          :GRF-файл, для якого це призначалось перекласти
 
 STR_NEWGRF_ADD                                                  :{BLACK}Додати
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Додати файли NewGRF до списку
--- a/src/lang/unfinished/afrikaans.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/unfinished/afrikaans.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -717,7 +717,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Plaas vuurtoring
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Plaas sender
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Bepaal woestyn area.{}Druk en hou CTRL om te verwyder
-STR_CREATE_LAKE                                                 :{BLACK}Bepaal water area.{}Dit sal die omgewing vloed as dit teen seevlak is
 STR_0290_DELETE                                                 :{BLACK}Uitwis
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Uitwis hele stad
 STR_0292_SAVE_SCENARIO                                          :Bewaar draaiboek
@@ -1136,7 +1135,6 @@
 
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Kan nie kanaale hier bou nie...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Bou kanaale. Druk CRTL om see blokkies te plaas (slegs op see-vlak)
 STR_LANDINFO_CANAL                                              :Kanaal
 
 STR_CANT_BUILD_LOCKS                                            :{WHITE}Kan nie sluite hier bou nie...
--- a/src/lang/unfinished/croatian.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/unfinished/croatian.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -114,6 +114,7 @@
 STR_QUANTITY_TOFFEE                                             :{WEIGHT} mliječne karamele
 STR_QUANTITY_BATTERIES                                          :{COMMA} baterij{P a e a}
 STR_QUANTITY_PLASTIC                                            :{VOLUME} plastike
+STR_QUANTITY_FIZZY_DRINKS                                       :{COMMA} Gaziran{P o a a} pić{P e a a}
 STR_ABBREV_NOTHING                                              :
 STR_ABBREV_PASSENGERS                                           :{TINYFONT}PU
 STR_ABBREV_COAL                                                 :{TINYFONT}UG
@@ -142,8 +143,10 @@
 STR_ABBREV_COLA                                                 :{TINYFONT}CL
 STR_ABBREV_CANDYFLOSS                                           :{TINYFONT}ŠV
 STR_ABBREV_BUBBLES                                              :{TINYFONT}BL
+STR_ABBREV_TOFFEE                                               :{TINYFONT}MČ
 STR_ABBREV_BATTERIES                                            :{TINYFONT}BA
 STR_ABBREV_PLASTIC                                              :{TINYFONT}PL
+STR_ABBREV_FIZZY_DRINKS                                         :{TINYFONT}GP
 STR_ABBREV_NONE                                                 :{TINYFONT}NI
 STR_ABBREV_ALL                                                  :{TINYFONT}SVE
 STR_00AE                                                        :{WHITE}{DATE_SHORT}
@@ -278,6 +281,7 @@
 STR_OSNAME_MORPHOS                                              :MorphOS
 STR_OSNAME_AMIGAOS                                              :AmigaOS
 STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...u vlasništvu {STRING}
 STR_013C_CARGO                                                  :{BLACK}Teret
@@ -392,10 +396,17 @@
 STR_NO_WAITING_CARGO                                            :{BLACK}Nijedna vrsta tereta ne čeka
 STR_SELECT_ALL_FACILITIES                                       :{BLACK}Izaberi sva sredstva
 STR_SELECT_ALL_TYPES                                            :{BLACK}Izaberi sve vrste tereta (uključujući i teret koji ne čeka)
+STR_AVAILABLE_TRAINS                                            :{BLACK}Dostupni vlakovi
+STR_AVAILABLE_ROAD_VEHICLES                                     :{BLACK}Dostupna vozila
+STR_AVAILABLE_SHIPS                                             :{BLACK}Dostupni brodovi
+STR_AVAILABLE_AIRCRAFT                                          :{BLACK}Dostupni zrakoplovi
 STR_AVAILABLE_ENGINES_TIP                                       :{BLACK}Pogledaj popis dostupnih dizajna motora za ovu vrstu vozila.
 STR_MANAGE_LIST                                                 :{BLACK}Uredi popis
 STR_MANAGE_LIST_TIP                                             :{BLACK}Pošalji upute svim vozilima na ovoj listi
 STR_REPLACE_VEHICLES                                            :Zamjeni vozila
+STR_SEND_TRAIN_TO_DEPOT                                         :Pošalji u spremište
+STR_SEND_ROAD_VEHICLE_TO_DEPOT                                  :
+STR_SEND_SHIP_TO_DEPOT                                          :
 STR_SEND_AIRCRAFT_TO_HANGAR                                     :Pošalji u hangar
 STR_SEND_FOR_SERVICING                                          :Pošalji na servis
 
@@ -712,11 +723,11 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Postavi svjetionik
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Postavi odašiljač
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Odredi pustinjsko područje.{}Pritisni i drži CTRL za uklanjanje
-STR_CREATE_LAKE                                                 :{BLACK}Odredi vodeno područje.{}Poplaviti će okolno područje ako je na razini mora
 STR_0290_DELETE                                                 :{BLACK}Obriši
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Obriši ovaj grad u cjelosti
 STR_0292_SAVE_SCENARIO                                          :Spremi scenarij
 STR_0293_LOAD_SCENARIO                                          :Učitaj secenarij
+STR_LOAD_HEIGHTMAP                                              :Učitaj visinsku kartu
 STR_0294_QUIT_EDITOR                                            :Završi s uređivanjem
 STR_0295                                                        :
 STR_0296_QUIT                                                   :Završi
@@ -962,6 +973,7 @@
 
 STR_TRAIN_IS_LOST                                               :{WHITE}Vlak {COMMA} se izgubio.
 STR_TRAIN_IS_UNPROFITABLE                                       :{WHITE}Prošlogodišnja zarada vlaka  {COMMA} bila je {CURRENCY}
+STR_EURO_INTRODUCE                                              :{BLACK}{BIGFONT}Europska Monetarna Unija!{}{}Euro je predstavljen kao jedinstvena valuta za svakodnevnu uporabu  u tvojoj zemlji!
 
 # Start of order review system.
 # DON'T ADD OR REMOVE LINES HERE
@@ -983,7 +995,9 @@
 STR_AIRCRAFT_HAS_INVALID_ENTRY                                  :{WHITE}Zrakoplov {COMMA} ima nevažeću stanicu u voznom redu
 # end of order system
 
+STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}Neuspješna automatska obnova vlaka {COMMA} (ograničena količina novca)
 STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}Automatska zamjena nije izvršena na cestovnom vozilu {COMMA} (money limit)
+STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}Neuspješna automatska obnova broda {COMMA} (ograničena količina novca)
 STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}Neuspjela automatska zamjena zrakoplova {COMMA} (novčano ograničenje)
 STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT                            :{WHITE}Nakon zamjene, vlak {COMMA} je postao predug
 
@@ -1000,10 +1014,13 @@
 STR_CONFIG_PATCHES_REALISTICACCEL                               :{LTBLUE}Omogući realno ubrzanje za vlakove: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_FORBID_90_DEG                                :{LTBLUE}Zabrani vlakovima i brodovima skretanja pod 90 stupnjeva: {ORANGE}{STRING} {LTBLUE} (requires NPF)
 STR_CONFIG_PATCHES_JOINSTATIONS                                 :{LTBLUE}Spoji željezničke stanice koje se izgrade jedna kraj druge: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_FULLLOADANY                                  :{LTBLUE}Napusti stanicu ako je bilo koji teret u potpunosti natovaren pri 'punom utovaru': {ORANGE}{STRING}
 STR_CONFIG_PATCHES_IMPROVEDLOAD                                 :{LTBLUE}Koristi unaprijeđen algoritam ukrcavanja: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_GRADUAL_LOADING                              :{LTBLUE}Postupno utovaruj vozila: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_INFLATION                                    :{LTBLUE}Inflacija: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SELECTGOODS                                  :{LTBLUE}Dostavi teret u stanicu samo ako u njoj postoji potražnja: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_LONGBRIDGES                                  :{LTBLUE}Dopusti izgradnju vrlo dugačkih mostova: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_GOTODEPOT                                    :{LTBLUE}Dopusti naredbe za slanje u spremište: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_BUILDXTRAIND                                 :{LTBLUE}Dopusti izgadnju industrija koje proizvode sirovine: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_MULTIPINDTOWN                                :{LTBLUE}Dopusti više sličnih industrija po gradu: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_SAMEINDCLOSE                                 :{LTBLUE}Moguće je graditi spojene industrije iste vrste: {ORANGE}{STRING}
@@ -1151,7 +1168,6 @@
 STR_TREES_RANDOM_TYPE_TIP                                       :{BLACK}Stavi drveće nasumičnog tipa
 
 STR_CANT_BUILD_CANALS                                           :{WHITE}Ovdje ne možeš graditi kanale...
-STR_BUILD_CANALS_TIP                                            :{BLACK}Izgradi kanale. Pritisni CTRL kako bi smjestio vodene pločice (samo na razini mora).
 STR_LANDINFO_CANAL                                              :Kanal
 
 
@@ -1670,6 +1686,7 @@
 STR_3031_CAN_T_RENAME_STATION                                   :{WHITE}Ne možeš preimenovati stanicu...
 STR_3032_RATINGS                                                :{BLACK}Ocjene
 STR_3033_ACCEPTS                                                :{BLACK}Prihvaća
+STR_3034_LOCAL_RATING_OF_TRANSPORT                              :{BLACK}Lokalna ocjena usluge prijevoza:
 
 ############ range for rating starts
 STR_3035_APPALLING                                              :Užasno
@@ -1689,24 +1706,24 @@
 STR_3041_NOW_ACCEPTS_AND                                        :{WHITE}{STATION} od sada prihvaća {STRING} i {STRING}
 STR_3042_BUS_STATION_ORIENTATION                                :{WHITE}Smjer autobusne stanice
 STR_3043_TRUCK_STATION_ORIENT                                   :{WHITE}Smjer kamionskog terminala
-STR_3046_MUST_DEMOLISH_BUS_STATION                              :{WHITE}Moraš uništiti autobusnu stanicu prvo
-STR_3047_MUST_DEMOLISH_TRUCK_STATION                            :{WHITE}Moraš uništiti kamionski terminal prvo
-STR_3048_STATIONS                                               :{WHITE}{COMPANY} - {COMMA} Station{P a e a}
+STR_3046_MUST_DEMOLISH_BUS_STATION                              :{WHITE}Prvo moraš uništiti autobusnu stanicu
+STR_3047_MUST_DEMOLISH_TRUCK_STATION                            :{WHITE}Prvo moraš uništiti kamionski terminal
+STR_3048_STATIONS                                               :{WHITE}{COMPANY} - {COMMA} Stanic{P a e a}
 STR_3049_0                                                      :{YELLOW}{STATION} {STATIONFEATURES}
 STR_304A_NONE                                                   :{YELLOW}- Ništa -
-STR_304B_SITE_UNSUITABLE                                        :{WHITE}...mjesto neprikladno
+STR_304B_SITE_UNSUITABLE                                        :{WHITE}...neprikladno mjesto
 STR_304C_TOO_CLOSE_TO_ANOTHER_DOCK                              :{WHITE}Preblizu drugom pristaništu
 STR_304D_MUST_DEMOLISH_DOCK_FIRST                               :{WHITE}Prvo moraš srušiti pristanište
 STR_304E_SELECT_RAILROAD_STATION                                :{BLACK}Izaberi smjer željezničke stanice
-STR_304F_SELECT_NUMBER_OF_PLATFORMS                             :{BLACK}Izaberi broj platformi na željezničkoj stanici
+STR_304F_SELECT_NUMBER_OF_PLATFORMS                             :{BLACK}Izaberi broj perona na željezničkoj stanici
 STR_3050_SELECT_LENGTH_OF_RAILROAD                              :{BLACK}Izaberi dužinu željezničke stanice
 STR_3051_SELECT_BUS_STATION_ORIENTATION                         :{BLACK}Izaberi smjer autobusne stanice
 STR_3052_SELECT_TRUCK_LOADING_BAY                               :{BLACK}Izaberi smjer kamionskog terminala
 STR_3053_CENTER_MAIN_VIEW_ON_STATION                            :{BLACK}Centriraj glavni pogled na lokaciju stanice
-STR_3054_SHOW_STATION_RATINGS                                   :{BLACK}Pokazi ocjene stanice
+STR_3054_SHOW_STATION_RATINGS                                   :{BLACK}Pokaži ocjene stanice
 STR_3055_CHANGE_NAME_OF_STATION                                 :{BLACK}Promijeni ime stanice
 STR_3056_SHOW_LIST_OF_ACCEPTED_CARGO                            :{BLACK}Prikaži popis prihvaćenog tereta
-STR_3057_STATION_NAMES_CLICK_ON                                 :{BLACK}Imena stanica - klikni na ime kako bi centrirao glavni pogled na stanicu
+STR_3057_STATION_NAMES_CLICK_ON                                 :{BLACK}Imena stanica - pritisni ime da bi centrirao glavni pogled na stanicu
 STR_3058_SELECT_SIZE_TYPE_OF_AIRPORT                            :{BLACK}Izaberi veličinu/tip zračne luke
 STR_305C_0                                                      :{STATION} {STATIONFEATURES}
 STR_STATION_SIGN_TINY                                           :{TINYFONT}{STATION}
@@ -1716,11 +1733,14 @@
 STR_3061_TRUCK_LOADING_AREA                                     :Ukrcajno područje
 STR_3062_BUS_STATION                                            :Autobusna stanica
 STR_3063_SHIP_DOCK                                              :Brodsko pristanište
+STR_3064_HIGHLIGHT_COVERAGE_AREA                                :{BLACK}Označi područje koje pokriva željeno mjesto
+STR_3065_DON_T_HIGHLIGHT_COVERAGE                               :{BLACK}Nemoj označiti područje koje pokriva željeno mjesto
+STR_3066_COVERAGE_AREA_HIGHLIGHT                                :{BLACK}Označavanje područja pokrivanja
 STR_3068_DOCK                                                   :{WHITE}Pristanište
 STR_3069_BUOY                                                   :Plutača
 STR_306A_BUOY_IN_THE_WAY                                        :{WHITE}...plutača na putu
 STR_306C_STATION_TOO_SPREAD_OUT                                 :{WHITE}...stanica previše proširena
-STR_306D_NONUNIFORM_STATIONS_DISALLOWED                         :{WHITE}...neuniformne stanice zabranjene
+STR_306D_NONUNIFORM_STATIONS_DISALLOWED                         :{WHITE}...neujednačene stanice onemogućene
 STR_USE_CTRL_TO_SELECT_MORE                                     :{BLACK}Drži CTRL kako bi izabrao više od jednog itema
 
 STR_UNDEFINED                                                   :(neodređen znakovni niz)
@@ -1730,8 +1750,8 @@
 ##id 0x3800
 STR_3800_SHIP_DEPOT_ORIENTATION                                 :{WHITE}Smjer brodskog spremišta
 STR_3801_MUST_BE_BUILT_ON_WATER                                 :{WHITE}...mora biti izgrađen na vodi
-STR_3802_CAN_T_BUILD_SHIP_DEPOT                                 :{WHITE}Ne možeš graditi brodsko spremište ovdje...
-STR_3803_SELECT_SHIP_DEPOT_ORIENTATION                          :{BLACK}Izaberi smjer brodsko spremišta
+STR_3802_CAN_T_BUILD_SHIP_DEPOT                                 :{WHITE}Ovdje ne možeš graditi brodsko spremište...
+STR_3803_SELECT_SHIP_DEPOT_ORIENTATION                          :{BLACK}Izaberi smjer brodskog spremišta
 STR_3804_WATER                                                  :Voda
 STR_3805_COAST_OR_RIVERBANK                                     :Obala ili riječni nasip
 STR_3806_SHIP_DEPOT                                             :Brodsko spremište
@@ -1743,7 +1763,7 @@
 STR_4002_SAVE                                                   :{BLACK}Spremi
 STR_4003_DELETE                                                 :{BLACK}Obriši
 STR_4004                                                        :{COMPANY}, {DATE_LONG}
-STR_4005_BYTES_FREE                                             :{BLACK}{COMMA} megabajt{P "" a a} free
+STR_4005_BYTES_FREE                                             :{BLACK}{COMMA} megabajt{P "" a a} slobod{P an na no}
 STR_4006_UNABLE_TO_READ_DRIVE                                   :{BLACK}Ne mogu pročitati disk
 STR_4007_GAME_SAVE_FAILED                                       :{WHITE}Spremanje igre nije uspjelo
 STR_4008_UNABLE_TO_DELETE_FILE                                  :{WHITE}Ne mogu obrisati datoteku
@@ -1754,7 +1774,7 @@
 STR_400D_SAVE_THE_CURRENT_GAME_USING                            :{BLACK}Spremi ovu igru, koristeći odabrano ime
 STR_400E_SELECT_NEW_GAME_TYPE                                   :{WHITE}Odaberi vrstu nove igre
 STR_400F_SELECT_SCENARIO_GREEN_PRE                              :{BLACK}Odaberi scenarij (zeleno), namještenu igru (plavo), ili nasumičnu novu igru
-STR_4010_GENERATE_RANDOM_NEW_GAME                               :Generiraj nasumičnu novu igru
+STR_4010_GENERATE_RANDOM_NEW_GAME                               :Izradi nasumičnu novu igru
 STR_4011_LOAD_HEIGHTMAP                                         :{WHITE}Učitaj visinsku kartu
 
 ##id 0x4800
@@ -1806,21 +1826,21 @@
 
 STR_482A_PRODUCTION_LAST_MONTH                                  :{BLACK}Prošlomjesečna proizvodnja:
 STR_482B_TRANSPORTED                                            :{YELLOW}{CARGO}{BLACK} ({COMMA}% prevezeno)
-STR_482C_CENTER_THE_MAIN_VIEW_ON                                :{BLACK}Centriraj glavni pogled na lokaciju gospodarstva
-STR_482D_NEW_UNDER_CONSTRUCTION                                 :{BLACK}{BIGFONT}Nova {STRING} pod konstrukcijom blizu grada {TOWN}!
-STR_482E_NEW_BEING_PLANTED_NEAR                                 :{BLACK}{BIGFONT}Nova {STRING} se trenutno sadi blizu grada {TOWN}!
+STR_482C_CENTER_THE_MAIN_VIEW_ON                                :{BLACK}Centriraj glavni pogled na položaj industrije
+STR_482D_NEW_UNDER_CONSTRUCTION                                 :{BLACK}{BIGFONT}Započela je izgradnja nove industrije ( {STRING} ) u blizini grada {TOWN}!
+STR_482E_NEW_BEING_PLANTED_NEAR                                 :{BLACK}{BIGFONT}Nova {STRING} trenutno se sadi blizu grada {TOWN}!
 STR_482F_COST                                                   :{BLACK}Trošak: {YELLOW}{CURRENCY}
-STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY                          :{WHITE}Ne možeš konstruirati ovaj tip gospodarstva ovdje...
+STR_4830_CAN_T_CONSTRUCT_THIS_INDUSTRY                          :{WHITE}Ovdje ne možeš izgraditi ovu vrstu industrije ovdje...
 STR_4831_FOREST_CAN_ONLY_BE_PLANTED                             :{WHITE}...šume mogu jedino biti posađene iznad linije snijega
 STR_4832_ANNOUNCES_IMMINENT_CLOSURE                             :{BLACK}{BIGFONT}{INDUSTRY} objavljuje skoro zatvaranje!
-STR_4833_SUPPLY_PROBLEMS_CAUSE_TO                               :{BLACK}{BIGFONT}Nabavni problemi uzrokuju {INDUSTRY} da objavi skoro zatvaranje!
-STR_4834_LACK_OF_NEARBY_TREES_CAUSES                            :{BLACK}{BIGFONT}Manjak drveća u blizini uzrokuje {INDUSTRY} da objavi skoro zatvaranje!
-STR_4835_INCREASES_PRODUCTION                                   :{BLACK}{BIGFONT}{INDUSTRY} povećava produkciju!
-STR_4836_NEW_COAL_SEAM_FOUND_AT                                 :{BLACK}{BIGFONT}Nova pukotina ugljena pronađena kod {INDUSTRY}!{}Očekuje se udvostručenje proizvodnje!
-STR_4837_NEW_OIL_RESERVES_FOUND                                 :{BLACK}{BIGFONT}Nove rezerve nafte pronađene kod:{INDUSTRY}!{}Očekuje se udvostručenje proizvodnje!
-STR_4838_IMPROVED_FARMING_METHODS                               :{BLACK}{BIGFONT}Poboljšane metode uzgoja u {INDUSTRY}, očekuje se udvostručenje proizvodnje!
-STR_4839_PRODUCTION_DOWN_BY_50                                  :{BLACK}{BIGFONT}{INDUSTRY} proizvodnja pala za 50%
-STR_483A_INSECT_INFESTATION_CAUSES                              :{BLACK}{BIGFONT}Najezda kukaca uzrokovala havariju kod {INDUSTRY}!{}Proizvodnja pala za 50%
+STR_4833_SUPPLY_PROBLEMS_CAUSE_TO                               :{BLACK}{BIGFONT}Zbog problema u nabavi {INDUSTRY} se uskoro zatvara!
+STR_4834_LACK_OF_NEARBY_TREES_CAUSES                            :{BLACK}{BIGFONT}Manjak drveća u glavni je razlog što se {INDUSTRY} se uskoro zatvara!
+STR_4835_INCREASES_PRODUCTION                                   :{BLACK}{BIGFONT}{INDUSTRY} povećava proizvodnju!
+STR_4836_NEW_COAL_SEAM_FOUND_AT                                 :{BLACK}{BIGFONT}{INDUSTRY} očekuje udvostručenje proizvodnje!{}Pronađena je nova pukotina ugljena!
+STR_4837_NEW_OIL_RESERVES_FOUND                                 :{BLACK}{BIGFONT}{INDUSTRY} očekuje udvostručenje proizvodnje!{}Pronađene su nove rezerve nafte!
+STR_4838_IMPROVED_FARMING_METHODS                               :{BLACK}{BIGFONT}{INDUSTRY} poboljšava metode uzgoja, očekuje se udvostručenje proizvodnje!
+STR_4839_PRODUCTION_DOWN_BY_50                                  :{BLACK}{BIGFONT}{INDUSTRY} smanjuje proizvodnju za 50%
+STR_483A_INSECT_INFESTATION_CAUSES                              :{BLACK}{BIGFONT}{INDUSTRY} pod najezdom kukaca! Havarija!{}Proizvodnja je pala za 50%
 STR_483B_CAN_ONLY_BE_POSITIONED                                 :{WHITE}...može se postaviti samo blizu rubova karte
 STR_INDUSTRY_PROD_GOUP                                          :{BLACK}{BIGFONT}{STRING} prozivodnja u {INDUSTRY} povećana je {COMMA}%!
 STR_INDUSTRY_PROD_GODOWN                                        :{BLACK}{BIGFONT}{STRING} prozivodnja u {INDUSTRY} smanjena je {COMMA}%!
@@ -1829,7 +1849,7 @@
 STR_5000_TRAIN_IN_TUNNEL                                        :{WHITE}Vlak u tunelu
 STR_5001_ROAD_VEHICLE_IN_TUNNEL                                 :{WHITE}Cestovno vozilo u tunelu
 STR_5003_ANOTHER_TUNNEL_IN_THE_WAY                              :{WHITE}Smeta drugi tunel
-STR_5005_UNABLE_TO_EXCAVATE_LAND                                :{WHITE}Ne mogu iskopoati zemlju na drugoj strani tunela
+STR_5005_UNABLE_TO_EXCAVATE_LAND                                :{WHITE}Ne moguće iskopoati zemlju na drugoj strani tunela
 STR_5006_MUST_DEMOLISH_TUNNEL_FIRST                             :{WHITE}Moraš prvo srušiti tunel
 STR_5007_MUST_DEMOLISH_BRIDGE_FIRST                             :{WHITE}Moraš prvo srušiti most
 STR_5008_CANNOT_START_AND_END_ON                                :{WHITE}Početak i kraj ne mogu biti na istom mjestu
@@ -2418,6 +2438,7 @@
 STR_TRAIN_STOPPING                                              :{RED}Zaustavljam
 STR_TRAIN_STOPPING_VEL                                          :{RED}Zaustavljam, {VELOCITY}
 
+
 ##id 0x9000
 STR_9000_ROAD_VEHICLE_IN_THE_WAY                                :{WHITE}Cestovno vozilo na putu
 STR_9002                                                        :{WHITE}{VEHICLE}
@@ -2455,12 +2476,12 @@
 STR_9023_BUILD_NEW_ROAD_VEHICLE                                 :{BLACK}Izgradi novo cestovno vozilo
 STR_9024_DRAG_ROAD_VEHICLE_TO_HERE                              :{BLACK}Povuci cestovno vozilo ovdje kako bi ga prodao
 STR_9025_CENTER_MAIN_VIEW_ON_ROAD                               :{BLACK}Centriraj glavni pogled na lokaciju spremišta cestovnih vozila
-STR_9026_ROAD_VEHICLE_SELECTION                                 :{BLACK}Popis cestovnih vozila - klikni na vozilo za informacije
+STR_9026_ROAD_VEHICLE_SELECTION                                 :{BLACK}Popis cestovnih vozila - pritisni na vozilo za informacije
 STR_9027_BUILD_THE_HIGHLIGHTED_ROAD                             :{BLACK}Izgradi označeno cestovno vozilo
 STR_902A_COST_SPEED_RUNNING_COST                                :{BLACK}Trošak: {CURRENCY}{}Brzina: {VELOCITY}{}Trošak uporabe: {CURRENCY}/god{}Kapacitet: {CARGO}
 
 STR_902C_NAME_ROAD_VEHICLE                                      :{WHITE}Imenuj cestovno vozilo
-STR_902D_CAN_T_NAME_ROAD_VEHICLE                                :{WHITE}Ne mogu preimenovati cestovno vozilo...
+STR_902D_CAN_T_NAME_ROAD_VEHICLE                                :{WHITE}Ne mogu imenovati cestovno vozilo...
 STR_902E_NAME_ROAD_VEHICLE                                      :{BLACK}Imenuj cestovno vozilo
 STR_902F_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Građani slave . . .{}Prvi bus stiže na {STATION}!
 STR_9030_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Građani slave . . .{}Prvi kamion stiže na {STATION}!
@@ -2472,7 +2493,7 @@
 STR_9035_RENAME_ROAD_VEHICLE_TYPE                               :{BLACK}Preimenuj vrstu cestovnog vozila
 STR_9036_RENAME_ROAD_VEHICLE_TYPE                               :{WHITE}Preimenuj vrstu cestovnog vozila
 STR_9037_CAN_T_RENAME_ROAD_VEHICLE                              :{WHITE}Ne mogu preimenovati vrstu cestovnog vozila...
-STR_9038_GO_TO_ROADVEH_DEPOT                                    :Idi prema {TOWN} spremištu cestovnih vozila
+STR_9038_GO_TO_ROADVEH_DEPOT                                    :Idi prema spremištu cestovnih vozila {TOWN}
 STR_SERVICE_AT_ROADVEH_DEPOT                                    :Servisiranje pri {TOWN} spremištu cestovnih vozila
 
 STR_REFIT_ROAD_VEHICLE_TO_CARRY                                 :{BLACK}Prenamijeni cestovno vozilo za prijevoz druge vrste tereta
@@ -2484,9 +2505,10 @@
 ##id 0x9800
 STR_9800_DOCK_CONSTRUCTION                                      :Izgradnja pristaništa
 STR_9801_DOCK_CONSTRUCTION                                      :{WHITE}Izgradnja pristaništa
-STR_9802_CAN_T_BUILD_DOCK_HERE                                  :{WHITE}Ne mogu izgraditi pristanište ovdje...
+STR_9802_CAN_T_BUILD_DOCK_HERE                                  :{WHITE}Ovdje ne mogu izgraditi pristanište...
 STR_9803_SHIP_DEPOT                                             :{WHITE}{TOWN} Spremište brodova
 STR_9804_NEW_SHIPS                                              :{BLACK}Novi brodovi
+STR_9805_SHIPS                                                  :{WHITE}{COMPANY} - {COMMA} Brod{P "" a ova}
 STR_9808_NEW_SHIPS                                              :{WHITE}Novi brodovi
 STR_9809_BUILD_SHIP                                             :{BLACK}Izgradi brod
 STR_CLONE_SHIP                                                  :{BLACK}Kloniraj brod
@@ -2494,15 +2516,15 @@
 STR_980B_SHIP_MUST_BE_STOPPED_IN                                :{WHITE}Brod mora biti zaustavljen u spremištu
 STR_980C_CAN_T_SELL_SHIP                                        :{WHITE}Ne mogu prodati brod...
 STR_980D_CAN_T_BUILD_SHIP                                       :{WHITE}Ne mogu izgraditi brod...
-STR_980E_SHIP_IN_THE_WAY                                        :{WHITE}Brod smeta
+STR_980E_SHIP_IN_THE_WAY                                        :{WHITE}Smeta brod
 STR_980F                                                        :{WHITE}{VEHICLE}
 STR_9811_DETAILS                                                :{WHITE}{VEHICLE} (Detalji)
 STR_9812_AGE_RUNNING_COST_YR                                    :{BLACK}Starost: {LTBLUE}{STRING}{BLACK}   Trošak uporabe: {LTBLUE}{CURRENCY}/god
-STR_9813_MAX_SPEED                                              :{BLACK}Maks brzina: {LTBLUE}{VELOCITY}
+STR_9813_MAX_SPEED                                              :{BLACK}Maks. brzina: {LTBLUE}{VELOCITY}
 STR_9814_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Zarada ove godine: {LTBLUE}{CURRENCY}  (prošle godine: {CURRENCY})
 STR_9815_RELIABILITY_BREAKDOWNS                                 :{BLACK}Pouzdanost: {LTBLUE}{COMMA}%  {BLACK}Kvarova od posljednjeg servisa: {LTBLUE}{COMMA}
 STR_9816_BUILT_VALUE                                            :{LTBLUE}{STRING}{BLACK}   Izgrađeno: {LTBLUE}{NUM}{BLACK} Vrijednost: {LTBLUE}{CURRENCY}
-STR_9817_CAPACITY                                               :{BLACK}Kapacitet: {LTBLUE}{CARGO}
+STR_9817_CAPACITY                                               :{BLACK}Zapremnina: {LTBLUE}{CARGO}
 STR_9818_CAN_T_STOP_START_SHIP                                  :{WHITE}Ne mogu pokrenuti/zaustaviti brod...
 STR_9819_CAN_T_SEND_SHIP_TO_DEPOT                               :{WHITE}Ne mogu poslati brod u skladište...
 STR_981A_UNABLE_TO_FIND_LOCAL_DEPOT                             :{WHITE}Ne mogu naći lokalno spremište
@@ -2519,12 +2541,16 @@
 STR_9822_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Centriraj glavni pogled na lokaciju spremišta brodova
 STR_9823_SHIPS_CLICK_ON_SHIP_FOR                                :{BLACK}Brodovi - klikni na brod za informacije
 STR_9824_BUILD_NEW_SHIPS_REQUIRES                               :{BLACK}Izgradi nove brodove (zahtijeva spremište brodova)
-STR_9825_SHIP_SELECTION_LIST_CLICK                              :{BLACK}Popis brodova - klikni na brod za informacije
+STR_9825_SHIP_SELECTION_LIST_CLICK                              :{BLACK}Popis brodova - pritisni na brod za informacije
 STR_9826_BUILD_THE_HIGHLIGHTED_SHIP                             :{BLACK}Izgradi označeni brod
-STR_9827_CURRENT_SHIP_ACTION_CLICK                              :{BLACK}Trenutna radnja broda - klikni ovdje za zaustavljanje/pokretanje broda
+STR_9827_CURRENT_SHIP_ACTION_CLICK                              :{BLACK}Trenutna radnja broda - pritisni ovdje za zaustavljanje/pokretanje broda
 STR_9828_SHOW_SHIP_S_ORDERS                                     :{BLACK}Prikaži naredbe broda
 STR_9829_CENTER_MAIN_VIEW_ON_SHIP                               :{BLACK}Centriraj glavni pogled na lokaciju broda
+STR_982B_SHOW_SHIP_DETAILS                                      :{BLACK}Prikaži detalje broda
+STR_982F_NAME_SHIP                                              :{BLACK}Imenuj brod
 
+STR_9831_NAME_SHIP                                              :{WHITE}Imenuj brod
+STR_9832_CAN_T_NAME_SHIP                                        :{WHITE}Ne mogu imenovati brod...
 STR_9833_CITIZENS_CELEBRATE_FIRST                               :{BLACK}{BIGFONT}Građani slave . . .{}Prvi brod stigao do {STATION}!
 STR_9834_POSITION_BUOY_WHICH_CAN                                :{BLACK}Smjesti plutaču koja može biti korištena kao pokazatelj puta
 STR_9835_CAN_T_POSITION_BUOY_HERE                               :{WHITE}Ne mogu staviti plutaču ovdje...
@@ -2535,6 +2561,10 @@
 STR_983A_REFIT_CARGO_SHIP_TO_CARRY                              :{BLACK}Prenamijeni teretni brod da nosi neku drugu vrstu tereta
 STR_983B_REFIT                                                  :{WHITE}{VEHICLE} (Prenamijeni)
 STR_983C_REFIT_SHIP                                             :{BLACK}Prenamijeni brod
+STR_983D_SELECT_TYPE_OF_CARGO_FOR                               :{BLACK}Odabri vrstu tereta za prijevoz brodom:
+STR_983E_REFIT_SHIP_TO_CARRY_HIGHLIGHTED                        :{BLACK}Prenamjeni brod za prijevoz označene vrste tereta
+STR_983F_SELECT_CARGO_TYPE_TO_CARRY                             :{GOLD}Odabri vrstu tereta za prijevoz:
+STR_9840_NEW_CAPACITY_COST_OF_REFIT                             :{BLACK}Nova zapremnina: {GOLD}{CARGO}{}{BLACK}Cijena prenamjene: {GOLD}{CURRENCY}
 STR_9841_CAN_T_REFIT_SHIP                                       :{WHITE}Ne mogu prenamijeniti brod...
 STR_9842_REFITTABLE                                             :(prenamjenjiv)
 SERVICE_AT_SHIP_DEPOT                                           :Servis u brodskom spremištu grada {TOWN}
@@ -2542,6 +2572,7 @@
 ##id 0xA000
 STR_A000_AIRPORTS                                               :{WHITE}Zračne luke
 STR_A001_CAN_T_BUILD_AIRPORT_HERE                               :{WHITE}Ne možeš graditi zračnu luku ovdje...
+STR_A002_AIRCRAFT_HANGAR                                        :{WHITE}{STATION} Spremište zrakoplova
 STR_A003_NEW_AIRCRAFT                                           :{BLACK}Novi zrakoplov
 STR_CLONE_AIRCRAFT                                              :{BLACK}Kloniraj zrakoplov
 STR_CLONE_AIRCRAFT_INFO                                         :{BLACK}Ovo će izgraditi kopiju zrakoplova. Control-klik će dijeliti naredbe
@@ -2552,8 +2583,15 @@
 STR_A00A                                                        :{WHITE}{VEHICLE}
 STR_A00B_ORDERS                                                 :{WHITE}{VEHICLE} (Naredbe)
 STR_A00C_DETAILS                                                :{WHITE}{VEHICLE} (Detalji)
+STR_A00D_AGE_RUNNING_COST_YR                                    :{BLACK}Starost: {LTBLUE}{STRING}{BLACK}   Troškovi uporabe {LTBLUE}{CURRENCY}/god
 STR_A00E_MAX_SPEED                                              :{BLACK}Maks brzina: {LTBLUE}{VELOCITY}
 STR_A00F_PROFIT_THIS_YEAR_LAST_YEAR                             :{BLACK}Zarada ove godine: {LTBLUE}{CURRENCY}  (prošle godine: {CURRENCY})
+STR_A010_RELIABILITY_BREAKDOWNS                                 :{BLACK}Pouzdanost: {LTBLUE}{COMMA}%  {BLACK}Kvarova od poslijednjeg servisa: {LTBLUE}{COMMA}
+STR_A011_BUILT_VALUE                                            :{LTBLUE}{STRING}{BLACK}   Izgrađen: {LTBLUE}{NUM}{BLACK} Vrijednost: {LTBLUE}{CURRENCY}
+STR_A012_CAN_T_SEND_AIRCRAFT_TO                                 :{WHITE}Ne mogu poslati zrakoplov u hangar
+STR_A014_AIRCRAFT_IS_WAITING_IN                                 :{WHITE}Zrakoplov {COMMA} čeka u hangaru
+STR_A015_AIRCRAFT_IN_THE_WAY                                    :{WHITE}Smeta zrakoplov
+STR_A016_CAN_T_STOP_START_AIRCRAFT                              :{WHITE}Ne mogu zaustaviti/pokrenuti zrakoplov...
 STR_A017_AIRCRAFT_IS_IN_FLIGHT                                  :{WHITE}Zrakoplov je u letu
 STR_A019_CAPACITY                                               :{BLACK}Nosivost: {LTBLUE}{CARGO}, {CARGO}
 STR_A01A_CAPACITY                                               :{BLACK}Nosivost: {LTBLUE}{CARGO}
@@ -2638,6 +2676,15 @@
 STR_NEWGRF_MD5SUM                                               :{BLACK}MD5 suma: {SILVER}{STRING}
 STR_NEWGRF_CONFIRMATION_TEXT                                    :{YELLOW}Spremate se napraviti izmjene na pokrenutoj igri; to može srušiti OpenTTD.{}Jeste li potpuno sigurni u to?
 
+STR_NEWGRF_ERROR_MSG_ERROR                                      :{RED}Greška: {SILVER}{STRING}
+STR_NEWGRF_ERROR_MSG_FATAL                                      :{RED}Kobno: {SILVER}{STRING}
+STR_NEWGRF_ERROR_VERSION_NUMBER                                 :{STRING} neće raditi sa inačicom zakrpe u OpenTTD-u.
+STR_NEWGRF_ERROR_DOS_OR_WINDOWS                                 :{STRING} je za {STRING} inačicu TTD-a.
+STR_NEWGRF_ERROR_UNSET_SWITCH                                   :{STRING} je napravljen da se koristi sa {STRING}
+STR_NEWGRF_ERROR_INVALID_PARAMETER                              :Nevažeći parametar za  {STRING}: parametar {STRING} ({NUM})
+STR_NEWGRF_ERROR_LOAD_BEFORE                                    :{STRING} se mora učitati prije {STRING}.
+STR_NEWGRF_ERROR_LOAD_AFTER                                     :{STRING} se mora učitati nakon {STRING}.
+
 STR_NEWGRF_ADD                                                  :{BLACK}Dodaj
 STR_NEWGRF_ADD_TIP                                              :{BLACK}Dodaj NewGRF datoteku u listu
 STR_NEWGRF_REMOVE                                               :{BLACK}Obriši
@@ -2664,6 +2711,7 @@
 
 STR_NEWGRF_COMPATIBLE_LOAD_WARNING                              :{WHITE}Kompatibilni GRF(ovi) učitani umjesto nepronađenih datoteka
 STR_NEWGRF_DISABLED_WARNING                                     :{WHITE}Nepronađene GRF datoteke su isključene
+STR_NEWGRF_NOT_FOUND_WARNING                                    :{WHITE}Nedostaje(u) datoteka(e) GRF za učitavanje igre
 
 STR_CURRENCY_WINDOW                                             :{WHITE}Proizvoljna valuta
 STR_CURRENCY_EXCHANGE_RATE                                      :{LTBLUE}Devizni tečaj: {ORANGE}{CURRENCY} = £ {COMMA}
@@ -2681,13 +2729,17 @@
 STR_PLANE                                                       :{BLACK}{PLANE}
 STR_SHIP                                                        :{BLACK}{SHIP}
 
+STR_SCHEDULED_TRAINS                                            :{WHITE}{STATION} - {COMMA} Vlak{P "" a ova}
+STR_SCHEDULED_ROAD_VEHICLES                                     :{WHITE}{STATION} - {COMMA} Cestovn{P o a ih} vozil{P o a a}
 STR_SCHEDULED_AIRCRAFT                                          :{WHITE}{STATION} - {COMMA} Zrakoplov
+STR_SCHEDULED_SHIPS                                             :{WHITE}{STATION} - {COMMA} Brod{P "" a ova}
 
 STR_SCHEDULED_TRAINS_TIP                                        :{BLACK}Prikaži sve vlakove koji imaju ovu stanicu u svom rasporedu
 STR_SCHEDULED_ROAD_VEHICLES_TIP                                 :{BLACK}Prikaži sva cestovna vozila koja imaju ovu stanicu u svom rasporedu
 STR_SCHEDULED_AIRCRAFT_TIP                                      :{BLACK}Prikaži sve zrakoplove koji imaju ovu stanicu u svom rasporedu
 STR_SCHEDULED_SHIPS_TIP                                         :{BLACK}Prikaži sve brodove koji imaju ovu stanicu u svom rasporedu
 
+STR_VEH_WITH_SHARED_ORDERS_LIST                                 :{WHITE}Djeljene naredbe za {COMMA} vozil{P o a a}
 STR_VEH_WITH_SHARED_ORDERS_LIST_TIP                             :{BLACK}Prikaži sva vozila koja dijele ovaj raspored.
 
 ### depot strings
@@ -2708,6 +2760,9 @@
 STR_DEPOT_AUTOREPLACE_SHIP_TIP                                  :{BLACK}Automatski zamijeni sve brodove u spremištu
 STR_DEPOT_AUTOREPLACE_AIRCRAFT_TIP                              :{BLACK}Automatski zamijeni sve zrakoplove u spremištu
 
+STR_VEHICLE_LIST_TRAIN_DEPOT                                    :{BLACK}{STRING} - {COMMA} Vlak{P "" a ova}
+STR_VEHICLE_LIST_ROADVEH_DEPOT                                  :{BLACK}{STRING} - {COMMA} Cestovn{P o a ih} vozil{P o a a}
+STR_VEHICLE_LIST_SHIP_DEPOT                                     :{BLACK}{STRING} - {COMMA} Brod{P "" a ova}
 STR_VEHICLE_LIST_AIRCRAFT_DEPOT                                 :{BLACK}{STRING} - {COMMA} Zrakoplov
 
 STR_REPLACE_VEHICLES_WHITE                                      :{WHITE}Zamijeni {STRING}
@@ -2726,25 +2781,38 @@
 STR_REPLACE_REMOVE_WAGON_HELP                                   :{BLACK}Neka automatska zamijena drži dužinu vlaka istom brišući vagone(počevši od naprijed), ako bi zamijena lokomotive vlak učinila dužim.
 STR_REPLACE_ENGINE_WAGON_SELECT                                 :{BLACK}Zamjenjujem:{ORANGE}{SKIP}{SKIP}{STRING}
 STR_REPLACE_ENGINE_WAGON_SELECT_HELP                            :{BLACK}EXPERIMENTALNA FUNKCIJA {} Prebaci između prozora za izmjenu lokomotiva i vagona.{}Izmjena vagona će se izvršiti samo ako novi vagon može biti prenamijenjen za prijevoz istog tipa tereta kao i stari vagon. Ovo se provjerava za svaki vagon kada se stvarna zamjena odvija.
+STR_ENGINE_NOT_BUILDABLE                                        :{WHITE}Lokomotiva se nemože izgraditi
 
+STR_ENGINES                                                     :Lokomotive
 STR_WAGONS                                                      :Vagoni
 
+STR_MASS_STOP_DEPOT_TRAIN_TIP                                   :{BLACK}Pritisni za zaustavljanje svih vlakova u spremištu
+STR_MASS_STOP_DEPOT_ROADVEH_TIP                                 :{BLACK}Pritisni za zaustavljanje svih cestovnih vozila u spremištu
+STR_MASS_STOP_DEPOT_SHIP_TIP                                    :{BLACK}Pritisni za zaustavljanje svih brodova u spremištu
+STR_MASS_STOP_HANGAR_TIP                                        :{BLACK}Pritisni za zaustavljanje svih zrakoplova u hangaru
 
+STR_MASS_START_DEPOT_TRAIN_TIP                                  :{BLACK}Pritisni za pokretanje svih vlakova u spremištu
+STR_MASS_START_DEPOT_ROADVEH_TIP                                :{BLACK}Pritisni za pokretanje svih cestovnih vozila u spremištu
+STR_MASS_START_DEPOT_SHIP_TIP                                   :{BLACK}Pritisni za pokretanje svih brodova u spremištu
 STR_MASS_START_HANGAR_TIP                                       :{BLACK}Klikni za pokretanje svih aviona u hangaru
 
 STR_MASS_STOP_LIST_TIP                                          :{BLACK}Klikni za zaustavljanje svih vozila na listi
 STR_MASS_START_LIST_TIP                                         :{BLACK}Klikni za pokretanje svih vozila na listi
 
 STR_SHORT_DATE                                                  :{WHITE}{DATE_TINY}
+STR_SIGN_LIST_CAPTION                                           :{WHITE}Popis znakova - {COMMA} Znak{P "" a ova}
 
 
 ############ Lists rail types
 
 STR_RAIL_VEHICLES                                               :Tračna Vozila
+STR_ELRAIL_VEHICLES                                             :Električna željeznička vozila
 STR_MONORAIL_VEHICLES                                           :Jednotračna vozila
+STR_MAGLEV_VEHICLES                                             :Maglev željeznička vozila
 
 ############ End of list of rail types
 
+STR_TINY_BLACK                                                  :{BLACK}{TINYFONT}{COMMA}
 
 STR_PURCHASE_INFO_COST_WEIGHT                                   :{BLACK}Trošak: {GOLD}{CURRENCY}{BLACK} Težina {GOLD}{WEIGHT_S}
 STR_PURCHASE_INFO_SPEED_POWER                                   :{BLACK}Brzina: {GOLD}{VELOCITY}{BLACK} Snaga: {GOLD}{POWER}
@@ -2756,6 +2824,7 @@
 STR_PURCHASE_INFO_COST                                          :{BLACK}Trošak: {GOLD}{CURRENCY}
 STR_PURCHASE_INFO_WEIGHT_CWEIGHT                                :{BLACK}Težina: {GOLD}{WEIGHT_S} ({WEIGHT_S})
 STR_PURCHASE_INFO_COST_SPEED                                    :{BLACK}Trošak: {GOLD}{CURRENCY}{BLACK} Brzina: {GOLD}{VELOCITY}
+STR_PURCHASE_INFO_AIRCRAFT_CAPACITY                             :{BLACK}Zapremnina: {GOLD}{COMMA} putnika, {COMMA} vreća s poštom
 STR_PURCHASE_INFO_REFITTABLE_TO                                 :{BLACK}Promjenjivo u: {GOLD}
 STR_PURCHASE_INFO_ALL_TYPES                                     :Svi tipovi tereta
 STR_PURCHASE_INFO_ALL_BUT                                       :Sve osim {GOLD}
@@ -2763,23 +2832,35 @@
 
 ########### String for New Landscape Generator
 
+STR_GENERATE                                                    :{WHITE}Izradi
 STR_RANDOM                                                      :{BLACK}Nasumično
 STR_RANDOM_HELP                                                 :{BLACK}Promijeni slučajni slijed koji se koristi za kreiranje terena
+STR_WORLD_GENERATION_CAPTION                                    :{WHITE}Izrada svijeta
 STR_RANDOM_SEED                                                 :{BLACK}Nasumični slijed:
 STR_RANDOM_SEED_HELP                                            :{BLACK}Klikni za unos nasumičnog slijeda
+STR_LAND_GENERATOR                                              :{BLACK}Izrađivač zemljišta:
 STR_TREE_PLACER                                                 :{BLACK} Algoritam za drveće:
 STR_TERRAIN_TYPE                                                :{BLACK}Tip terena:
 STR_QUANTITY_OF_SEA_LAKES                                       :{BLACK}Razina mora:
 STR_SMOOTHNESS                                                  :{BLACK}Graduacija:
 STR_SNOW_LINE_HEIGHT                                            :{BLACK}Visina linije snijega
+STR_DATE                                                        :{BLACK}Datum:
 STR_NUMBER_OF_TOWNS                                             :{BLACK}Broj gradova:
 STR_NUMBER_OF_INDUSTRIES                                        :{BLACK}Broj industrija:
+STR_GENERATE_DATE                                               :{BLACK}{DATE_LONG}
 STR_SNOW_LINE_UP                                                :{BLACK}Pomakni visinu linije snijega za jedan gore
 STR_SNOW_LINE_DOWN                                              :{BLACK}Pomakni visinu linije snijega za jedan dolje
 STR_SNOW_LINE_QUERY_CAPT                                        :{WHITE}Promijeni visinu linije snijega
 STR_START_DATE_QUERY_CAPT                                       :{WHITE}Promijeni početnu godinu
 STR_SNOW_LINE_HEIGHT_NUM                                        :{NUM}
+STR_HEIGHTMAP_SIZE                                              :{BLACK}Veličina: {ORANGE}{NUM} x {NUM}
+STR_GENERATION_WORLD                                            :{WHITE}Izrada svijeta u toku...
+STR_GENERATION_ABORT                                            :{BLACK}Prekini
+STR_GENERATION_ABORT_CAPTION                                    :{WHITE}Poništi izradu svijeta
+STR_GENERATION_ABORT_MESSAGE                                    :{YELLOW}Da li zaista želiš prekinuti izradu?
 STR_PROGRESS                                                    :{WHITE}{NUM}% gotovo
+STR_GENERATION_PROGRESS                                         :{BLACK}{NUM} / {NUM}
+STR_WORLD_GENERATION                                            :{BLACK}Izrada svijeta
 STR_TREE_GENERATION                                             :{BLACK}Generiranje drveća
 STR_CLEARING_TILES                                              :{BLACK}Generiranje grubog i stjenovitog područja
 STR_SETTINGUP_GAME                                              :{BLACK}Uspostavljam igru
@@ -2790,17 +2871,29 @@
 STR_SE_RANDOM_LAND                                              :{WHITE}Nasumični teren
 STR_SE_NEW_WORLD                                                :{BLACK}Kreiraj novi scenarij
 STR_SE_CAPTION                                                  :{WHITE}Vrsta scenarija
+STR_FLAT_WORLD_HEIGHT_DOWN                                      :{BLACK}Snizi ravnu površinu za jedan korak
+STR_FLAT_WORLD_HEIGHT_UP                                        :{BLACK}Povisi ravnu površinu za jedan korak
+STR_FLAT_WORLD_HEIGHT_QUERY_CAPT                                :{WHITE}Promijeni visinu ravne površine
+STR_FLAT_WORLD_HEIGHT                                           :{BLACK}Visina ravne površine:
+STR_FLAT_WORLD_HEIGHT_NUM                                       :{NUM}
 
 STR_SMALLMAP_CENTER                                             :{BLACK}Centriraj malu mapu na trenutni položaj
 
 ########### String for new airports
 STR_SMALL_AIRPORT                                               :{BLACK}Mala
 STR_CITY_AIRPORT                                                :{BLACK}Grad
+STR_METRO_AIRPORT                                               :{BLACK}Metropolitanski airport
 STR_INTERNATIONAL_AIRPORT                                       :{BLACK}Međunarodni aerodrom
 STR_COMMUTER_AIRPORT                                            :{BLACK}Redoviti putnik
+STR_INTERCONTINENTAL_AIRPORT                                    :{BLACK}Međukontinentalni
+STR_HELIPORT                                                    :{BLACK}Heliodrom
+STR_HELIDEPOT                                                   :{BLACK}Spremište za helikoptere
+STR_HELISTATION                                                 :{BLACK}Stanica za helikoptere
 
 STR_SMALL_AIRPORTS                                              :{BLACK}Mali aerodromi
 STR_LARGE_AIRPORTS                                              :{BLACK}Veliki aerodromi
+STR_HUB_AIRPORTS                                                :{BLACK}Središnje zračne luke
+STR_HELIPORTS                                                   :{BLACK}Helicopterske zračne luke
 
 ############ Tooltip measurment
 
@@ -2809,4 +2902,11 @@
 STR_MEASURE_LENGTH_HEIGHTDIFF                                   :{BLACK}Dužina:{NUM}{}Visinska razlika:{NUM} m
 STR_MEASURE_AREA_HEIGHTDIFF                                     :{BLACK}Područje:{NUM}x{NUM}Visinska razlika:{NUM} m
 
+############ Date formatting
+STR_DATE_TINY                                                   :{STRING}-{STRING}-{NUM}
+STR_DATE_SHORT                                                  :{STRING} {NUM}
+STR_DATE_LONG                                                   :{STRING} {STRING} {NUM}
+
 ########
+
+STR_FEEDER_CARGO_VALUE                                          :{BLACK}Prebaci novac: {LTBLUE}{CURRENCY}
--- a/src/lang/unfinished/greek.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/unfinished/greek.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -111,9 +111,44 @@
 STR_QUANTITY_COLA                                               :{VOLUME} κόλας
 STR_QUANTITY_CANDYFLOSS                                         :{WEIGHT} μαλλί της γριάς
 STR_QUANTITY_BUBBLES                                            :{COMMA} φυσαλίδ{P α ες}
+STR_QUANTITY_TOFFEE                                             :{WEIGHT} τόφυ
 STR_QUANTITY_BATTERIES                                          :{COMMA} μπαταρί{P α ες}
 STR_QUANTITY_PLASTIC                                            :{VOLUME} πλαστικού
 STR_QUANTITY_FIZZY_DRINKS                                       :{COMMA} αναψυκτικ{P ό ά}
+STR_ABBREV_NOTHING                                              :
+STR_ABBREV_PASSENGERS                                           :{TINYFONT}PS
+STR_ABBREV_COAL                                                 :{TINYFONT}CL
+STR_ABBREV_MAIL                                                 :{TINYFONT}ML
+STR_ABBREV_OIL                                                  :{TINYFONT}OL
+STR_ABBREV_LIVESTOCK                                            :{TINYFONT}LV
+STR_ABBREV_GOODS                                                :{TINYFONT}GD
+STR_ABBREV_GRAIN                                                :{TINYFONT}GR
+STR_ABBREV_WOOD                                                 :{TINYFONT}WD
+STR_ABBREV_IRON_ORE                                             :{TINYFONT}OR
+STR_ABBREV_STEEL                                                :{TINYFONT}ST
+STR_ABBREV_VALUABLES                                            :{TINYFONT}VL
+STR_ABBREV_COPPER_ORE                                           :{TINYFONT}CO
+STR_ABBREV_MAIZE                                                :{TINYFONT}MZ
+STR_ABBREV_FRUIT                                                :{TINYFONT}FT
+STR_ABBREV_DIAMONDS                                             :{TINYFONT}DM
+STR_ABBREV_FOOD                                                 :{TINYFONT}FD
+STR_ABBREV_PAPER                                                :{TINYFONT}PR
+STR_ABBREV_GOLD                                                 :{TINYFONT}GD
+STR_ABBREV_WATER                                                :{TINYFONT}WR
+STR_ABBREV_WHEAT                                                :{TINYFONT}WH
+STR_ABBREV_RUBBER                                               :{TINYFONT}RB
+STR_ABBREV_SUGAR                                                :{TINYFONT}SG
+STR_ABBREV_TOYS                                                 :{TINYFONT}TY
+STR_ABBREV_SWEETS                                               :{TINYFONT}SW
+STR_ABBREV_COLA                                                 :{TINYFONT}CL
+STR_ABBREV_CANDYFLOSS                                           :{TINYFONT}CF
+STR_ABBREV_BUBBLES                                              :{TINYFONT}BU
+STR_ABBREV_TOFFEE                                               :{TINYFONT}TF
+STR_ABBREV_BATTERIES                                            :{TINYFONT}BA
+STR_ABBREV_PLASTIC                                              :{TINYFONT}PL
+STR_ABBREV_FIZZY_DRINKS                                         :{TINYFONT}FZ
+STR_ABBREV_NONE                                                 :{TINYFONT}NO
+STR_ABBREV_ALL                                                  :{TINYFONT}ALL
 STR_00AE                                                        :{WHITE}{DATE_SHORT}
 STR_00AF                                                        :{WHITE}{DATE_LONG}
 STR_00B0_MAP                                                    :{WHITE}Χάρτης - {STRING}
@@ -242,6 +277,11 @@
 STR_0133_WINDOWS                                                :Windows
 STR_0134_UNIX                                                   :Unix
 STR_0135_OSX                                                    :OS X
+STR_OSNAME_BEOS                                                 :BeOS
+STR_OSNAME_MORPHOS                                              :MorphOS
+STR_OSNAME_AMIGAOS                                              :AmigaOS
+STR_OSNAME_OS2                                                  :OS/2
+STR_OSNAME_SUNOS                                                :SunOS
 
 STR_013B_OWNED_BY                                               :{WHITE}...ιδιοκτησία του {STRING}
 STR_013C_CARGO                                                  :{BLACK}Φορτίο
@@ -252,10 +292,12 @@
 STR_CAPACITY_MULT                                               :{BLACK}Χωριτηκότητα: {LTBLUE}{CARGO} (x{NUM})
 STR_013F_TOTAL_CAPACITY_TEXT                                    :{BLACK}Συνολική χωρητικότητα φορτίου του τραίνου:
 STR_013F_TOTAL_CAPACITY                                         :{LTBLUE}- {CARGO} ({SHORTCARGO})
+STR_TOTAL_CAPACITY_MULT                                         :{LTBLUE}- {CARGO} ({SHORTCARGO}) (x{NUM})
 STR_0140_NEW_GAME                                               :{BLACK}Νέο Παιχνίδι
 STR_0141_LOAD_GAME                                              :{BLACK}Φόρτωση Παιχνιδιού
 STR_SINGLE_PLAYER                                               :{BLACK}Ένας παίκτης
 STR_MULTIPLAYER                                                 :{BLACK}Πολοί παίκτες
+STR_SCENARIO_EDITOR                                             :{BLACK}Διαμόρφωση Σεναρίου
 
 STR_64                                                          :64
 STR_128                                                         :128
@@ -264,6 +306,7 @@
 STR_1024                                                        :1024
 STR_2048                                                        :2048
 STR_MAPSIZE                                                     :{BLACK}Διάσταση χάρτη:
+STR_BY                                                          :{BLACK}*
 STR_0148_GAME_OPTIONS                                           :{BLACK}Επιλογές Παιχνιδιού
 
 STR_0150_SOMEONE                                                :κάποιος{SKIP}{SKIP}
@@ -271,14 +314,37 @@
 STR_0152_TOWN_DIRECTORY                                         :Κατάλογος Πόλεων
 STR_0153_SUBSIDIES                                              :Επιχορηγήσεις
 
-
-STR_UNITS_VELOCITY_METRIC                                       :{COMMA} χλμ/ώρα
-
+STR_UNITS_IMPERIAL                                              :Αυτοκρατορικό
+STR_UNITS_METRIC                                                :Μετρικό
+STR_UNITS_SI                                                    :SI
 
-
+STR_UNITS_VELOCITY_IMPERIAL                                     :{COMMA} μαω
+STR_UNITS_VELOCITY_METRIC                                       :{COMMA} χλμ/ώρα
+STR_UNITS_VELOCITY_SI                                           :{COMMA} μ/δ
 
+STR_UNITS_POWER_IMPERIAL                                        :{COMMA}hp
+STR_UNITS_POWER_METRIC                                          :{COMMA}hp
+STR_UNITS_POWER_SI                                              :{COMMA}kW
 
+STR_UNITS_WEIGHT_SHORT_IMPERIAL                                 :{COMMA}t
+STR_UNITS_WEIGHT_SHORT_METRIC                                   :{COMMA}t
+STR_UNITS_WEIGHT_SHORT_SI                                       :{COMMA}kg
 
+STR_UNITS_WEIGHT_LONG_IMPERIAL                                  :{COMMA} τονος{P "" s}
+STR_UNITS_WEIGHT_LONG_METRIC                                    :{COMMA} τόνοι{P "" s}
+STR_UNITS_WEIGHT_LONG_SI                                        :{COMMA} kg
+
+STR_UNITS_VOLUME_SHORT_IMPERIAL                                 :{COMMA}γαλ
+STR_UNITS_VOLUME_SHORT_METRIC                                   :{COMMA}λ
+STR_UNITS_VOLUME_SHORT_SI                                       :{COMMA}m³
+
+STR_UNITS_VOLUME_LONG_IMPERIAL                                  :{COMMA} γαλλόνι{P "" s}
+STR_UNITS_VOLUME_LONG_METRIC                                    :{COMMA} λίτρα{P "" s}
+STR_UNITS_VOLUME_LONG_SI                                        :{COMMA} m³
+
+STR_UNITS_FORCE_IMPERIAL                                        :{COMMA}x10³ lbf
+STR_UNITS_FORCE_METRIC                                          :{COMMA} δύναμη τόνου
+STR_UNITS_FORCE_SI                                              :{COMMA} kN
 
 ############ range for menu starts
 STR_0154_OPERATING_PROFIT_GRAPH                                 :Γράφημα λειτουργικού κέρδους
@@ -288,6 +354,7 @@
 STR_0158_COMPANY_VALUE_GRAPH                                    :Γράφημα εταιρικής αξίας
 STR_0159_CARGO_PAYMENT_RATES                                    :Ποσοστά πληρωμής φορτίου
 STR_015A_COMPANY_LEAGUE_TABLE                                   :Πίνακας κατάταξης επιχείρησης
+STR_PERFORMANCE_DETAIL_MENU                                     :Λεπτομερής εκτίμηση απόδοσης
 ############ range for menu ends
 
 STR_015B_OPENTTD                                                :{WHITE}Σχετικά με το OpenTTD
@@ -295,10 +362,16 @@
 STR_015D_LOAD_GAME                                              :Φόρτωση παιχνιδιού
 STR_015E_QUIT_GAME                                              :Παραίτηση από το παιχνίδι
 STR_015F_QUIT                                                   :Έξοδος
+STR_ABANDON_GAME_QUERY                                          :{YELLOW}Είστε σίγουρος ότι θέλετε να εγκαταλείψετε το παιχνίδι;
 STR_0161_QUIT_GAME                                              :{WHITE}Παραίτηση από το Παιχνίδι
+STR_SORT_ORDER_TIP                                              :{BLACK}Επιλογή σειράς ταξινόμησης  (καθοδικά/ανοδικά)
+STR_SORT_CRITERIA_TIP                                           :{BLACK}Επιλογή κριτηρίου ταξινόμησης
+STR_SORT_BY                                                     :{BLACK}Ταξινόμηση κατά
 
+STR_SORT_BY_POPULATION                                          :{BLACK}Πληθυσμός
 STR_SORT_BY_PRODUCTION                                          :{BLACK}Παραγωγή
 STR_SORT_BY_TYPE                                                :{BLACK}Τύπος
+STR_SORT_BY_TRANSPORTED                                         :{BLACK}Μεταφέρθηκαν
 STR_SORT_BY_NAME                                                :{BLACK}Όνομα
 STR_SORT_BY_DROPDOWN_NAME                                       :Όνομα
 STR_SORT_BY_DATE                                                :{BLACK}Μέρα
@@ -307,13 +380,29 @@
 STR_SORT_BY_PROFIT_THIS_YEAR                                    :Κέρδος αυτού του χρόνου
 STR_SORT_BY_AGE                                                 :Ηλικία
 STR_SORT_BY_RELIABILITY                                         :αξιοπιστία
+STR_SORT_BY_TOTAL_CAPACITY_PER_CARGOTYPE                        :Συνολική χωρητικότητα ανά τύπο φορτίου
 STR_SORT_BY_MAX_SPEED                                           :Μέγιστη ταχύτητα
 STR_SORT_BY_MODEL                                               :Μοντέλο
 STR_SORT_BY_VALUE                                               :Αξία
 STR_SORT_BY_FACILITY                                            :Τύπος σταθμού
+STR_SORT_BY_WAITING                                             :Αξία φορτίου σε αναμονή
+STR_SORT_BY_RATING_MAX                                          :Εκτίμηση φορτίου
+STR_ENGINE_SORT_ENGINE_ID                                       :EngineID (κλασσική ταξινόμηση)
 STR_ENGINE_SORT_COST                                            :Κόστος
 STR_ENGINE_SORT_POWER                                           :Δύναμη
+STR_ENGINE_SORT_INTRO_DATE                                      :Ημέρα Κυκλοφορίας
+STR_ENGINE_SORT_RUNNING_COST                                    :Κόστος Συντήρησης
+STR_ENGINE_SORT_POWER_VS_RUNNING_COST                           :Δύναμη/Κόστος Συντήρησης
+STR_ENGINE_SORT_CARGO_CAPACITY                                  :Χωρητικότητα Φορτίου
 STR_NO_WAITING_CARGO                                            :{BLACK}Κανένα εμπόρευμα κανενός τύπου δεν περιμένει
+STR_SELECT_ALL_FACILITIES                                       :{BLACK}Επιλογή όλων των εγκαταστάσεων
+STR_SELECT_ALL_TYPES                                            :{BLACK}Επιλογή όλων των τύπων φορτίου (συμπεριλαμβανομένου φορτίου μη-αναμονής)
+STR_AVAILABLE_TRAINS                                            :{BLACK}Διαθέσιμα Τρένα
+STR_AVAILABLE_ROAD_VEHICLES                                     :{BLACK}Διαθέσιμα Οχήματα
+STR_AVAILABLE_SHIPS                                             :{BLACK}Διαθέσιμα Πλοία
+STR_AVAILABLE_AIRCRAFT                                          :{BLACK}Διαθέσιμα Αεροσκάφη
+STR_AVAILABLE_ENGINES_TIP                                       :{BLACK}Προβολή λίστας διαθέσιμων σχεδίων μηχανών για τον τύπο οχήματος.
+STR_MANAGE_LIST                                                 :{BLACK}Διαχείριση λίστας
 STR_MANAGE_LIST_TIP                                             :{BLACK}Στείλε οδηγίες σε όλα τα οχήματα σε αυτή λίστα
 STR_REPLACE_VEHICLES                                            :Αντικατέστησε τα οχήματα
 STR_SEND_TRAIN_TO_DEPOT                                         :Στείλε στο υπόστεγο
@@ -368,10 +457,14 @@
 STR_018A_CAN_T_CHANGE_SERVICING                                 :{WHITE}Δεν μπορεί να αλλάξει το διάστημα της συντήρησης...
 STR_018B_CLOSE_WINDOW                                           :{BLACK}Κλείσιμο παραθύρου
 STR_018C_WINDOW_TITLE_DRAG_THIS                                 :{BLACK}Τίτλος παραθύρου - σύρετε για να το μετακινήσετε
+STR_STICKY_BUTTON                                               :{BLACK}Σημείωση αυτού του παραθύρου να μην κλείνει από το πλήκτρο 'Κλείσιμο Παραθύρων'
+STR_RESIZE_BUTTON                                               :{BLACK}Κάντε κλίκ και σύρετε για να αλλάξετε το μέγεθος του παραθύρου
+STR_SAVELOAD_HOME_BUTTON                                        :{BLACK}Κάντε κλίκ εδώ για να πάτε στον τρέχων φάκελλο αποθήκευσης
 STR_018D_DEMOLISH_BUILDINGS_ETC                                 :{BLACK}Κατεδάφιση των κτηρίων κ.λπ. σε ένα τετράγωνο εδάφους
 STR_018E_LOWER_A_CORNER_OF_LAND                                 :{BLACK}Χαμηλώστε μια γωνία του εδάφους
 STR_018F_RAISE_A_CORNER_OF_LAND                                 :{BLACK}Ανυψώστε μια γωνία του εδάφους
 STR_0190_SCROLL_BAR_SCROLLS_LIST                                :{BLACK}Μπάρα Κύλισης - μετακινεί την λίστα πάνω/κάτω
+STR_HSCROLL_BAR_SCROLLS_LIST                                    :{BLACK}Μπάρα κίνησης - κινεί τη λίστα  αριστερά/δεξιά
 STR_0191_SHOW_LAND_CONTOURS_ON_MAP                              :{BLACK}Εμφάνιση περιγραμμάτων εδάφους στο χάρτη
 STR_0192_SHOW_VEHICLES_ON_MAP                                   :{BLACK}Εμφάνιση οχημάτων στο χάρτη
 STR_0193_SHOW_INDUSTRIES_ON_MAP                                 :{BLACK}Εμφάνιση βιομηχανιών στο χάρτη
@@ -483,6 +576,7 @@
 STR_01F8_CLEAR_CURRENT_PROGRAM_CUSTOM1                          :{BLACK}Καθαρισμός τρέχοντος προγράμματος (Προσαρμοσμένο1 ή Προσαρμοσμένο2 μόνο)
 STR_01F9_SAVE_MUSIC_SETTINGS                                    :{BLACK}Αποθήκευση επιλογών μουσικής
 STR_01FA_CLICK_ON_MUSIC_TRACK_TO                                :{BLACK}Κάντε κλίκ στο μουσικό κομμάτι για προσθήκη στο τρέχον πρόγραμμα (Προσαρμοσμένο1 ή Προσαρμοσμένο2 μόνο)
+STR_CLICK_ON_TRACK_TO_REMOVE                                    :{BLACK}Κάντε κλικ στο τραγούδι για να το αφαιρέσετε από το πρόγραμμα (Προσαρμοσμένο 1 ή 2 μόνο)
 STR_01FB_TOGGLE_PROGRAM_SHUFFLE                                 :{BLACK}Εναλλαγή τυχαίας αναπαραγωγής on/off στο πρόγραμμα
 STR_01FC_SHOW_MUSIC_TRACK_SELECTION                             :{BLACK}Εμφάνιση παραθύρου επιλογής μουσικού κομματιού
 STR_01FD_CLICK_ON_SERVICE_TO_CENTER                             :{BLACK}Κάντε κλίκ στην υπηρεσία για κεντράρισμα στην βιομηχανία/πόλη
@@ -497,14 +591,18 @@
 STR_0207_ARRIVAL_OF_FIRST_VEHICLE                               :{YELLOW}Άφιξη του πρώτου οχήματος το σταθμό του αντιπάλου
 STR_0208_ACCIDENTS_DISASTERS                                    :{YELLOW}Ατυχήματα / καταστροφές
 STR_0209_COMPANY_INFORMATION                                    :{YELLOW}Πληροφορίες εταιρείας
+STR_NEWS_OPEN_CLOSE                                             :{YELLOW}Άνοιγμα / κλείσιμο  των βιομηχανιών
 STR_020A_ECONOMY_CHANGES                                        :{YELLOW}Οικονομικές αλλαγές
 STR_020B_ADVICE_INFORMATION_ON_PLAYER                           :{YELLOW}Συμβουλές / πληροφορίες για τα οχήματα του παίκτη
 STR_020C_NEW_VEHICLES                                           :{YELLOW}Νέα οχήματα
 STR_020D_CHANGES_OF_CARGO_ACCEPTANCE                            :{YELLOW}Αλλαγές στην αποδοχή φορτίου
 STR_020E_SUBSIDIES                                              :{YELLOW}Επιχορηγήσεις
 STR_020F_GENERAL_INFORMATION                                    :{YELLOW}Γενικές πληροφορίες
+STR_MESSAGES_ALL                                                :{YELLOW}Ρύθμιση όλων των μηνυμάτων σε: Κλειστά / Περιγραφή / Ολόκληρα
+STR_MESSAGE_SOUND                                               :{YELLOW}Αναπαραγωγή ήχου για μηνύματα σε περιγραφή
 STR_0210_TOO_FAR_FROM_PREVIOUS_DESTINATIO                       :{WHITE}...πολύ μακριά από τον προηγούμενο προορισμό
 STR_0211_TOP_COMPANIES_WHO_REACHED                              :{BIGFONT}{BLACK}Οι καλύτερες εταιρείες που έφτασαν το {NUM}{}({STRING} Επίπεδο)
+STR_TOP_COMPANIES_NETWORK_GAME                                  :{BIGFONT}{BLACK}Πίνακας Πρωταθλήματος Εταιρειών σε {NUM}
 STR_0212                                                        :{BIGFONT}{COMMA},
 STR_0213_BUSINESSMAN                                            :Επαγγελματίας
 STR_0214_ENTREPRENEUR                                           :Επιχειρηματίας
@@ -528,6 +626,8 @@
 STR_022A_GENERATE_RANDOM_LAND                                   :{BLACK}Δημιουργία τυχαίου εδάφους
 STR_022B_RESET_LANDSCAPE                                        :{BLACK}Επαναφορά τοπίου
 STR_022C_RESET_LANDSCAPE                                        :{WHITE}Επαναφορά Τοπίου
+STR_RESET_LANDSCAPE_TOOLTIP                                     :{BLACK}Αφαίρεση όλων των ιδιοκτησιών παικτών από το χάρτη
+STR_RESET_LANDSCAPE_CONFIRMATION_TEXT                           :{WHITE}Είστε σίγουρος ότι θέλετε να αφαιρέσετε όλες τις ιδιοκτησίες παικτών;
 STR_022E_LANDSCAPE_GENERATION                                   :{BLACK}Δημιουργία τοπίου
 STR_022F_TOWN_GENERATION                                        :{BLACK}Δημιουργία πόλης
 STR_0230_INDUSTRY_GENERATION                                    :{BLACK}Δημιουργία Βιομηχανίας
@@ -540,6 +640,7 @@
 STR_0238_TOO_CLOSE_TO_ANOTHER_TOWN                              :{WHITE}...πολύ κοντά σε άλλη πόλη
 STR_0239_SITE_UNSUITABLE                                        :{WHITE}...ακατάλληλη περιοχή
 STR_023A_TOO_MANY_TOWNS                                         :{WHITE}...πάρα πολλές πόλεις
+STR_CANNOT_GENERATE_TOWN                                        :{WHITE}Αδύνατο να χτιστούν πόλεις
 STR_NO_SPACE_FOR_TOWN                                           :{WHITE}...δεν υπάρχει αλλος χώρος στον χάρτη
 STR_023B_INCREASE_SIZE_OF_TOWN                                  :{BLACK}Αύξηση μεγέθους πόλεως
 STR_023C_EXPAND                                                 :{BLACK}Επέκταση
@@ -630,6 +731,7 @@
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Πλήρης διαγραφή πόλεως
 STR_0292_SAVE_SCENARIO                                          :Απποθήκευση σεναρίου
 STR_0293_LOAD_SCENARIO                                          :Φόρτωση σεναρίου
+STR_LOAD_HEIGHTMAP                                              :Φόρτωση heightmap
 STR_0294_QUIT_EDITOR                                            :Έξοδος από το πρόγραμμα επεξεργασίας
 STR_0295                                                        :
 STR_0296_QUIT                                                   :Έξοδος
@@ -637,6 +739,8 @@
 STR_0298_LOAD_SCENARIO                                          :{WHITE}Φόρτωση Σεναρίου
 STR_0299_SAVE_SCENARIO                                          :{WHITE}Αποθήκευση Σεναρίου
 STR_029A_PLAY_SCENARIO                                          :{BLACK}Παιξτε το Σενάριο
+STR_PLAY_HEIGHTMAP                                              :{BLACK}Παίξτε Heightmap
+STR_PLAY_HEIGHTMAP_HINT                                         :{BLACK}Εκκίνηση νέου παιχνιδιού, χρησιμοποιώντας heightmap για χάρτη
 STR_QUIT_SCENARIO_QUERY                                         :{YELLOW}Είστε σίγουροι οτι θέλετε ναφύγετε από το πίστα;
 STR_029C_QUIT_EDITOR                                            :{WHITE}Έξοδος από το Πρόγραμμα Επεξεργασίας
 STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...μπορεί να χτιστεί μόνο σε πόλεις με πληθυσμό άνω των 1200
@@ -651,6 +755,9 @@
 
 STR_02B6                                                        :{STRING}  -  {STRING}
 STR_02B7_SHOW_LAST_MESSAGE_OR_NEWS                              :{BLACK}Εμφάνιση τελευταίου μηνύματος ή αναφοράς νέων
+STR_OFF                                                         :Κλειστό
+STR_SUMMARY                                                     :Περιγραφή
+STR_FULL                                                        :Ολόκληρο
 STR_02BA                                                        :{SILVER}- -  {COMPANY}  - -
 STR_02BB_TOWN_DIRECTORY                                         :Καταλογος πόλεων
 STR_02BC_VEHICLE_DESIGN_NAMES                                   :{BLACK}Ονόματα σχεδίων οχημάτων
@@ -661,13 +768,17 @@
 STR_02C1_VEHICLE_DESIGN_NAMES_SELECTION                         :{BLACK}Επιλογή ονομάτων σχεδίασης οχημάτων
 STR_02C2_SAVE_CUSTOMIZED_VEHICLE                                :{BLACK}Αποθήκευση προσαρμοσμένων ονομάτων σχεδίασης οχημάτων
 
+STR_CHECKMARK                                                   :{CHECKMARK}
 ############ range for menu starts
 STR_02C3_GAME_OPTIONS                                           :Επιλογές παιχνιδιού
 STR_02C5_DIFFICULTY_SETTINGS                                    :Ρυθμίσεις δυσκολίας
 STR_02C7_CONFIG_PATCHES                                         :Ρύθμιση διορθώσεων
+STR_NEWGRF_SETTINGS                                             :Ρυθμίσεις NewGRF
+STR_GAMEOPTMENU_0A                                              :
 STR_02CA_TOWN_NAMES_DISPLAYED                                   :{SETX 12}Ονόματα πόλεων που εμφανίζονται
 STR_02CC_STATION_NAMES_DISPLAYED                                :{SETX 12}Ονόματα σταθμών που εμφανίζονται
 STR_02CE_SIGNS_DISPLAYED                                        :{SETX 12}Πινακίδες που εμφανίζονται
+STR_WAYPOINTS_DISPLAYED2                                        :{SETX 12}Εμφάνιση σημείων διαδρομής
 STR_02D0_FULL_ANIMATION                                         :{SETX 12}Πλήρες animation
 STR_02D2_FULL_DETAIL                                            :{SETX 12}Πλήρης λεπτομέρεια
 STR_02D4_TRANSPARENT_BUILDINGS                                  :{SETX 12}Διαφανή κτίρια
@@ -677,6 +788,7 @@
 ############ range for menu starts
 STR_02D5_LAND_BLOCK_INFO                                        :Πληροφορίες περιοχής εδάφους
 STR_02D6                                                        :
+STR_CONSOLE_SETTING                                             :Ενναλαγή Κονσόλας
 STR_02D7_SCREENSHOT_CTRL_S                                      :Φωτογραφία εικόνας (Ctrl-S)
 STR_02D8_GIANT_SCREENSHOT_CTRL_G                                :Γιγαντιαία Φωτογραφία Εικόνας (Ctrl-G)
 STR_02D9_ABOUT_OPENTTD                                          :Σχετικά με το 'OpenTTD'
@@ -687,13 +799,22 @@
 STR_02DC_DISPLAY_SUBSIDIES                                      :{BLACK}Εμφάνιση χρηματοδοτήσεων
 STR_02DD_SUBSIDIES                                              :Χρηματοδοτήσεις
 STR_02DE_MAP_OF_WORLD                                           :Χάρτης του κόσμου
+STR_EXTRA_VIEW_PORT                                             :Πρόσθετη εμφάνιση
 STR_SIGN_LIST                                                   :Λίστα ταμπελών
 STR_02DF_TOWN_DIRECTORY                                         :Κατάλογος πόλεων
+STR_TOWN_POPULATION                                             :{BLACK}Παγκόσμιος πληθυσμός: {COMMA}
+STR_EXTRA_VIEW_PORT_TITLE                                       :{WHITE}Εμφάνιση {COMMA}
+STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN                                :{BLACK}Αντιγραφή στην εμφάνιση
+STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN_TT                             :{BLACK}Αντιγραφή της περιοχής της παγκόσμιας προβολής σε αυτή την εμφάνιση
+STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW                                :{BLACK}Επικόλληση από εμφάνιση
+STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT                             :{BLACK}Επικόλληση της περιοχής αυτής της εμφάνισης στην παγκόσμια προβολή
 
 STR_02E0_CURRENCY_UNITS                                         :{BLACK}Νομισματικές μονάδες
 STR_02E1                                                        :{BLACK}{SKIP}{STRING}
 STR_02E2_CURRENCY_UNITS_SELECTION                               :{BLACK}Επιλογή νομισματικών μονάδων
+STR_MEASURING_UNITS                                             :{BLACK}Μονάδες μέτρησης
 STR_02E4                                                        :{BLACK}{SKIP}{SKIP}{STRING}
+STR_MEASURING_UNITS_SELECTION                                   :{BLACK}Επιλογή μονάδων μέτρησης
 STR_02E6_ROAD_VEHICLES                                          :{BLACK}Οχήματα δρόμου
 STR_02E7                                                        :{BLACK}{SKIP}{SKIP}{SKIP}{STRING}
 STR_02E8_SELECT_SIDE_OF_ROAD_FOR                                :{BLACK}Επιλογή πλευράς δρόμου όπου τα οχήματα οδηγούν
@@ -729,10 +850,12 @@
 STR_0312_FUND_CONSTRUCTION_OF_NEW                               :{BLACK}Χρηματοδοτήστε την κατασκευή νέας βιομηχανίας
 
 ############ range for menu starts
+STR_INDUSTRY_DIR                                                :Κατάλογος Βιομηχανιών
 STR_0313_FUND_NEW_INDUSTRY                                      :Χρηματοδότηση νέας βιομηχανίας
 ############ range ends here
 
 STR_0314_FUND_NEW_INDUSTRY                                      :{WHITE}Χρηματοδότηση νέας βιομηχανίας
+STR_JUST_STRING                                                 :{STRING}
 STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS                             :{WHITE}...μπορεί να χτιστεί μόνο σε πόλεις
 STR_0317_CAN_ONLY_BE_BUILT_IN_RAINFOREST                        :{WHITE}...μπορεί να χτιστεί μόνο σε δασώδεις περιοχές
 STR_0318_CAN_ONLY_BE_BUILT_IN_DESERT                            :{WHITE}...μπορεί να χτιστεί μόνο σε περιοχές με έρημο
@@ -743,19 +866,70 @@
 
 STR_0329_PURCHASE_LAND_FOR_FUTURE                               :{BLACK}Αγορά γης για μελλοντική χρήση
 STR_032F_AUTOSAVE                                               :{RED}ΑΥΤΟΜΑΤΗ ΑΠΟΘΗΚΕΥΣΗ
+STR_SAVING_GAME                                                 :{RED}*  *  ΑΠΟΘΗΚΕΥΣΗ ΠΑΙΧΝΙΔΙΟΥ  *  *
+STR_SAVE_STILL_IN_PROGRESS                                      :{WHITE}Η αποθήκευση είναι σε εξέλιξη,{}παρακαλώ περιμένετε να τελειώσει!
 STR_0330_SELECT_EZY_STREET_STYLE                                :{BLACK}Επιλογή προγράμματος 'Ezy Street στυλ μουσικής'
 
 STR_0335_6                                                      :{BLACK}6
 STR_0336_7                                                      :{BLACK}7
 
 ############ start of townname region
+STR_TOWNNAME_ORIGINAL_ENGLISH                                   :Αγγλικά (Αυθεντικά)
+STR_TOWNNAME_FRENCH                                             :Γαλλικά
+STR_TOWNNAME_GERMAN                                             :Γερμανικά
+STR_TOWNNAME_ADDITIONAL_ENGLISH                                 :Αγγλικά (Πρόσθετα)
+STR_TOWNNAME_LATIN_AMERICAN                                     :Λατινοαμερικάνικα
+STR_TOWNNAME_SILLY                                              :Αστεία
+STR_TOWNNAME_SWEDISH                                            :Σουηδικά
+STR_TOWNNAME_DUTCH                                              :Ολλανδικά
+STR_TOWNNAME_FINNISH                                            :Φινλανδικά
+STR_TOWNNAME_POLISH                                             :Πολωνικά
+STR_TOWNNAME_SLOVAKISH                                          :Σλοβάκικα
+STR_TOWNNAME_NORWEGIAN                                          :Νορβηγικά
+STR_TOWNNAME_HUNGARIAN                                          :Όυγγαρικά
+STR_TOWNNAME_AUSTRIAN                                           :Αυστριακά
+STR_TOWNNAME_ROMANIAN                                           :Ρουμάνικα
+STR_TOWNNAME_CZECH                                              :Τσέχικα
+STR_TOWNNAME_SWISS                                              :Ελβετικά
+STR_TOWNNAME_DANISH                                             :Δανέζικα
+STR_TOWNNAME_TURKISH                                            :Τούρκικα
+STR_TOWNNAME_ITALIAN                                            :Ιταλικά
+STR_TOWNNAME_CATALAN                                            :Καταλανικά
 ############ end of townname region
 
 STR_CURR_GBP                                                    :Αγγλική Λίρα (£)
+STR_CURR_USD                                                    :Δολλάρια ($)
+STR_CURR_EUR                                                    :Ευρώ (€)
+STR_CURR_YEN                                                    :Γιεν (¥)
+STR_CURR_ATS                                                    :Αυστραικό Σελίνι (ATS)
+STR_CURR_BEF                                                    :Βελγικό Φράγκο (BEF)
+STR_CURR_CHF                                                    :Ελβετικό Φράγκο (CHF)
+STR_CURR_CZK                                                    :Τσέχικη Κορώνα (CZK)
+STR_CURR_DEM                                                    :Γερμανικό Μάρκο (DEM)
+STR_CURR_DKK                                                    :Δανέζικη Κορώνα (DKK)
+STR_CURR_ESP                                                    :Πεσέτα (ESP)
+STR_CURR_FIM                                                    :Φινλανδικό Μάρκο (FIM)
+STR_CURR_FRF                                                    :Φράγκο (FRF)
 STR_CURR_GRD                                                    :Δραχμή(δρχ.)
+STR_CURR_HUF                                                    :Ουγγρικό Φλουρί (HUF)
+STR_CURR_ISK                                                    :Ισλανδική Κορώνα (ISK)
+STR_CURR_ITL                                                    :Ιταλική Λίρα (ITL)
+STR_CURR_NLG                                                    :Ολλανδικό Φιορίνι (NLG)
+STR_CURR_NOK                                                    :Νορβηγική Κορώνα (NOK)
+STR_CURR_PLN                                                    :Πολωνικό Zloty (PLN)
+STR_CURR_ROL                                                    :Ρουμάνικο Λευ (ROL)
+STR_CURR_RUR                                                    :Ρώσσικες Ρούβλες (RUR)
+STR_CURR_SIT                                                    :Σλοβένικο Tolar (SIT)
+STR_CURR_SEK                                                    :Σουηδική Κορώνα (SEK)
+STR_CURR_YTL                                                    :Τούρκικη Λίρα (YTL)
+STR_CURR_SKK                                                    :Σλοβάκικη Κορώνα (SKK)
+STR_CURR_BRR                                                    :Βραζιλιάνικο Real (BRL)
 
+STR_CURR_CUSTOM                                                 :Άλλο...
 
+STR_OPTIONS_LANG                                                :{BLACK}Γλώσσα
 STR_OPTIONS_LANG_CBO                                            :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_OPTIONS_LANG_TIP                                            :{BLACK}Επιλογή της γλώσσας σε χρήση
 
 STR_OPTIONS_FULLSCREEN                                          :{BLACK}Σε όλη την οθόνη
 STR_OPTIONS_FULLSCREEN_TIP                                      :{BLACK}Τσεκάρεται αυτό το κουτάκι ωστε να παίξετε το OpenTTD σε όλη την οθόνη
@@ -764,7 +938,9 @@
 STR_OPTIONS_RES_CBO                                             :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
 STR_OPTIONS_RES_TIP                                             :{BLACK}Διαλέξτε την ανάλυση της οθόνης που θέλετε
 
+STR_OPTIONS_SCREENSHOT_FORMAT                                   :{BLACK}Διαμόρφωση φωτογραφίας
 STR_OPTIONS_SCREENSHOT_FORMAT_CBO                               :{BLACK}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{SKIP}{STRING}
+STR_OPTIONS_SCREENSHOT_FORMAT_TIP                               :{BLACK}Επιλογή της διαμόρφωσης της φωτογραφίας σε χρήση
 
 STR_AUTOSAVE_1_MONTH                                            :Κάθε μήνα
 STR_AUTOSAVE_FAILED                                             :{WHITE}Το αυτόματο σώσιμο απέτυχε
@@ -791,55 +967,189 @@
 STR_BAGS                                                        :Τσάντες
 STR_TONS                                                        :Τόνοι
 STR_LITERS                                                      :Λίτρα
+STR_ITEMS                                                       :αντικείμενα
 STR_CRATES                                                      :Κουτιά
 STR_RES_OTHER                                                   :άλλα
 STR_NOTHING                                                     :
 
 STR_SMALL_RIGHT_ARROW                                           :{TINYFONT}{RIGHTARROW}
 
+STR_CANT_SHARE_ORDER_LIST                                       :{WHITE}Αδύνατο να μοιραστεί η λίστα οδηγιών...
+STR_CANT_COPY_ORDER_LIST                                        :{WHITE}Αδύνατο να αντιγραφεί η λίστα οδηγιών...
+STR_END_OF_SHARED_ORDERS                                        :{SETX 10}- - Τέλος Μοιρασμένων Οδηγιών - -
 
 STR_TRAIN_IS_LOST                                               :{WHITE}Το τραίνο {COMMA} Χάθηκε
+STR_TRAIN_IS_UNPROFITABLE                                       :{WHITE}Τα κέρδη του Τρένου {COMMA}το προηγούμενο έτος ήταν {CURRENCY}
+STR_EURO_INTRODUCE                                              :{BLACK}{BIGFONT}Ευρωπαϊκή Οικονομική Ένωση!{}{}Το Ευρώ είναι πλέον το μοναδικό νόμισμα για τις καθημερινές συναλλαγές στην χώρα σας!
 
 # Start of order review system.
 # DON'T ADD OR REMOVE LINES HERE
 STR_TRAIN_HAS_TOO_FEW_ORDERS                                    :{WHITE}Το τραίνο {COMMA} έχει τόσες λίγες οδηγίες
+STR_TRAIN_HAS_VOID_ORDER                                        :{WHITE}Το τρένο {COMMA} έχει κενές εντολές
+STR_TRAIN_HAS_DUPLICATE_ENTRY                                   :{WHITE}Το τρένο {COMMA} έχει διπλές εντολές
+STR_TRAIN_HAS_INVALID_ENTRY                                     :{WHITE}Το τρένο {COMMA} έχει έναν λανθασμένο σταθμό στις οδηγίες του
 STR_ROADVEHICLE_HAS_TOO_FEW_ORDERS                              :{WHITE}Το Οδικό όχημα {COMMA} έχει τόσες λίγες οδηγίες
+STR_ROADVEHICLE_HAS_VOID_ORDER                                  :{WHITE}Το Όχημα {COMMA} έχει μία κενή εντολή
+STR_ROADVEHICLE_HAS_DUPLICATE_ENTRY                             :{WHITE}Το Όχημα {COMMA} έχει διπλές εντολές
+STR_ROADVEHICLE_HAS_INVALID_ENTRY                               :{WHITE}Το Όχημα {COMMA} έχε έναν λανθασμένο σταθμό στις οδηγίες του
 STR_SHIP_HAS_TOO_FEW_ORDERS                                     :{WHITE}Το πλοίο {COMMA} έχει τόσες λίγες οδηγίες
+STR_SHIP_HAS_VOID_ORDER                                         :{WHITE}Το Πλοίο {COMMA} έχει μία κενή οδηγία
+STR_SHIP_HAS_DUPLICATE_ENTRY                                    :{WHITE}Το Πλοίο {COMMA} έχει διπλές οδηγίες
+STR_SHIP_HAS_INVALID_ENTRY                                      :{WHITE}Το Πλοίο {COMMA} έχει έναν λανθασμένο σταθμό στις οδηγίες του
 STR_AIRCRAFT_HAS_TOO_FEW_ORDERS                                 :{WHITE}Το αεροσκάφος {COMMA} has too few orders in the schedule
+STR_AIRCRAFT_HAS_VOID_ORDER                                     :{WHITE}Το Αεροσκάφος {COMMA} έχει μία κενή οδηγία
+STR_AIRCRAFT_HAS_DUPLICATE_ENTRY                                :{WHITE}Το Αεροσκάφος {COMMA} έχει διπλές οδηγίες
+STR_AIRCRAFT_HAS_INVALID_ENTRY                                  :{WHITE}Το Αεροσκάφος {COMMA} έχει ένα λανθασμένο σταθμό στις οδηγίες του
 # end of order system
 
-
-
-
+STR_TRAIN_AUTORENEW_FAILED                                      :{WHITE}Η Αυτόματη Ανανέωση απέτυχε στο τρένο {COMMA} (χρηματικό όριο)
+STR_ROADVEHICLE_AUTORENEW_FAILED                                :{WHITE}Η Αυτόματη Ανανέωση απέτυχε στο όχημα {COMMA} (χρηματικό όριο)
+STR_SHIP_AUTORENEW_FAILED                                       :{WHITE}Η Αυτόματη Ανανέωση απέτυχε στο πλοίο {COMMA} (χρηματικό όριο)
+STR_AIRCRAFT_AUTORENEW_FAILED                                   :{WHITE}Η Αυτόματη Ανανέωση απέτυχε στο αεροσκάφος {COMMA} (χρηματικό όριο)
+STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT                            :{WHITE}Το τρένο {COMMA} είναι πολύ μακρύ μετά την αντικατάσταση
 
+STR_CONFIG_PATCHES                                              :{BLACK}Ρύθμιση Διορθώσεων
+STR_CONFIG_PATCHES_TIP                                          :{BLACK}Ρύθμιση των Διορθώσεων
+STR_CONFIG_PATCHES_CAPTION                                      :{WHITE}Ρύθμιση Διορθώσεων
+
+STR_CONFIG_PATCHES_OFF                                          :Κλειστό
+STR_CONFIG_PATCHES_ON                                           :Ανοιχτό
+STR_CONFIG_PATCHES_VEHICLESPEED                                 :{LTBLUE}Εμφάνιση της ταχύτητας του οχήματος στη γραμμή κατάστασης: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_BUILDONSLOPES                                :{LTBLUE}Επιτρέπεται το χτίσιμο σε πλαγιές και ακτές: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_CATCHMENT                                    :{LTBLUE}Επιτρέπονται πιο ρεαλιστικά ταξινομημένες περιοχές συλλογής : {ORANGE}{STRING}
+STR_CONFIG_PATCHES_EXTRADYNAMITE                                :{LTBLUE}Επιτρέπεται η αφαίρεση περισσότερων ιδιοκτησιών πόλεων: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAMMOTHTRAINS                                :{LTBLUE}Επιτρέπεται η δημιουργία πολύ μακριών τρένων: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_REALISTICACCEL                               :{LTBLUE}Ενεργοποίηση ρεαλιστικής επιτάχυνσης για τα τρένα: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_FORBID_90_DEG                                :{LTBLUE}Απαγόρευση στροφών 90 μοιρών για τρένα και πλοία: {ORANGE}{STRING} {LTBLUE} (απαιτεί NPF)
+STR_CONFIG_PATCHES_JOINSTATIONS                                 :{LTBLUE}Σύνδεση σταθμών τρένων χτισμένων κοντά: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_FULLLOADANY                                  :{LTBLUE}Αναχώρηση από το σταθμό όταν οποιοδήποτε φορτίο είναι πλήρες, όταν 'πλήρης φόρτος': {ORANGE}{STRING}
+STR_CONFIG_PATCHES_IMPROVEDLOAD                                 :{LTBLUE}Χρησιμοποίηση βελτιωμένου αλγόριθμου φόρτωσης: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_GRADUAL_LOADING                              :{LTBLUE}Φόρτωση οχημάτων σταδιακά: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_INFLATION                                    :{LTBLUE}Πληθωρισμός: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SELECTGOODS                                  :{LTBLUE}Παράδοση φορτίου σε σταθμό μόνο όταν υπάρχει ζήτηση: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LONGBRIDGES                                  :{LTBLUE}Επιτρέπεται να χτίζονται πολύ μακριές γέφυρες: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_GOTODEPOT                                    :{LTBLUE}Επιτρέπονται οι εντολές αποστολής σε αμαξοστάσιο: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_BUILDXTRAIND                                 :{LTBLUE}Επιτρέπεται η κατασκευή βιομηχανιών πρώτων υλών: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MULTIPINDTOWN                                :{LTBLUE}Επιτρέπονται πολλαπλές όμοιες βιομηχανίες ανα πόλη: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SAMEINDCLOSE                                 :{LTBLUE}Βιομηχανίες ίδου τύπου μπορούν να χτιστούν κοντά η μία στην άλλη: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LONGDATE                                     :{LTBLUE}Εμφάνιση ολόκληρης ημερομηνίες στη γραμμή κατάστασης: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SIGNALSIDE                                   :{LTBLUE}Εμφάνιση σήμανσης στην πλευρά οδήγησης: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SHOWFINANCES                                 :{LTBLUE}Εμφάνιση παράθυρου οικονομικών στο τέλος του έτους: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NEW_NONSTOP                                  :{LTBLUE}TTDPatch συμβατός απ'ευθείας χειρισμός: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ROADVEH_QUEUE                                :{LTBLUE}Ουρά οχημάτων (με κβαντικά εφφέ): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTOSCROLL                                   :{LTBLUE}Μετακίνηση παραθύρου όταν είναι το ποντίκι στην άκρη: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_BRIBE                                        :{LTBLUE}Επιτρέπεται η δωροδοκία της τοπικής αρχής: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NONUNIFORM_STATIONS                          :{LTBLUE}Ανομοιόμορφοι σταθμοί: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL                          :{LTBLUE}Νέο παγκόσμιο σύστημα εύρεσης μονοπατιού (NPF, αγνοεί το NTP): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_FREIGHT_TRAINS                               :{LTBLUE}Πολλαπλασιαστής βάρους σε φορία για εξομοίωση βαρέων τρένων: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_STOP_ON_TOWN_ROAD                            :{LTBLUE}Επιτρέπεται η κίνηση μέσω των στάσεων σε δρόμους πόλεων : {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_SMALL_AIRPORTS                               :{LTBLUE}Επιτρέπονται τα μικρά αεροδρόμια πάντα: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_WARN_LOST_TRAIN                              :{LTBLUE}Προειδοποίηση αν χαθεί τρένο: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ORDER_REVIEW                                 :{LTBLUE}Επανεξέταση οδηγιών τρένων: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_ORDER_REVIEW_OFF                             :όχι
+STR_CONFIG_PATCHES_ORDER_REVIEW_EXDEPOT                         :ναι, αλλά εξαιρούνται τα σταματημένα οχήματα
 STR_CONFIG_PATCHES_ORDER_REVIEW_ON                              :από όλα τα οχήματα
+STR_CONFIG_PATCHES_WARN_INCOME_LESS                             :{LTBLUE}Προειδοποίηση όταν τα έσοδα ενός τρένου είναι αρνητικά: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_NEVER_EXPIRE_VEHICLES                        :{LTBLUE}Τα οχήματα δεν λήγουν ποτέ: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AUTORENEW_VEHICLE                            :{LTBLUE}Αυτόματη Ανανέωση όταν ένα όχημα παλιώνει
+STR_CONFIG_PATCHES_AUTORENEW_MONTHS                             :{LTBLUE}Αυτόματη Ανανέωση όταν ένα όχημα είναι {ORANGE}{STRING}{LTBLUE} μήνες πρίν/μετά την μέγιστη ηληκία
+STR_CONFIG_PATCHES_AUTORENEW_MONEY                              :{LTBLUE}Αυτόματη Ανανέωση με τα ελάχιστα απαιτούμενα χρήματα: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ERRMSG_DURATION                              :{LTBLUE}Διάρκεια μηνύματος σφάλματος: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_POPULATION_IN_LABEL                          :{LTBLUE}Εμφάνιση πληθυσμού πόλης στο όνομα της πόλης: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_INVISIBLE_TREES                              :{LTBLUE}Αόρατα δέντρα (με διαφανή κτίρια): {ORANGE}{STRING}
 
+STR_CONFIG_PATCHES_LAND_GENERATOR                               :{LTBLUE}Γεννήτρια Γης: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_LAND_GENERATOR_ORIGINAL                      :Αυθεντικό
+STR_CONFIG_PATCHES_LAND_GENERATOR_TERRA_GENESIS                 :ΤεραΓένεση
+STR_CONFIG_PATCHES_OIL_REF_EDGE_DISTANCE                        :{LTBLUE}Μέγιστη απόσταση από την άκρη για τα Διυλιστήρια {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SNOWLINE_HEIGHT                              :{LTBLUE}Κορυφογραμμή χιονιού: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN                         :{LTBLUE}Σκληρότητα επιφάνειας (ΤεραΓέννεση μόνο) : {ORANGE}{STRING}
 STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH             :Πολύ απαλός
 STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_SMOOTH                  :Απαλός
+STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_ROUGH                   :Σκληρή
 STR_CONFIG_PATCHES_ROUGHNESS_OF_TERRAIN_VERY_ROUGH              :Πολύ ανώμαλος
+STR_CONFIG_PATCHES_TREE_PLACER                                  :{LTBLUE}Αλγόριθμος τοποθέτησης Δέντρων: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_TREE_PLACER_NONE                             :Κανένας
 STR_CONFIG_PATCHES_TREE_PLACER_ORIGINAL                         :Αυθεντικό
 STR_CONFIG_PATCHES_TREE_PLACER_IMPROVED                         :Βελτιωμένος
+STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION                           :{LTBLUE}Περιστροφή Heightmap: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE         :Αντίθετη Φορά Ρολογιού
 STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_CLOCKWISE                 :Δεξιόστροφα
+STR_CONFIG_PATCHES_SE_FLAT_WORLD_HEIGHT                         :{LTBLUE}Το επίπεδο ύψους που παίρνει ένα επίπεδο σενάριο: {ORANGE}{STRING}
 
+STR_CONFIG_PATCHES_STATION_SPREAD                               :{LTBLUE}Μέγιστη διασπορά σταθμών: {ORANGE}{STRING} {RED}Προσοχή: Η υψηλή ρύθμιση καθυστερεί το παιχνίδι
+STR_CONFIG_PATCHES_SERVICEATHELIPAD                             :{LTBLUE}Αυτόματη επισκευή ελικοπτέρων στα ελικοδρόμια: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR                       :{LTBLUE}Σύνδεση γραμμής εργαλείων τοπίου με γραμμή εργαλείων σιδηρόδρομου/δρόμου/νερού/αεροδρομίου: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_REVERSE_SCROLLING                            :{LTBLUE}Ανάποδη μετακίνηση οθόνης: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MEASURE_TOOLTIP                              :{LTBLUE}Εμφάνιση εργαλείου μετρήσεως όταν χρησιμοποιούνται διάφορα εργαλεία: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_LIVERIES                                     :{LTBLUE}Εμφάνιση χρωμάτων των εταιρειών: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_LIVERIES_NONE                                :Κανένας
+STR_CONFIG_PATCHES_LIVERIES_OWN                                 :Η Εταιρεία μου
 STR_CONFIG_PATCHES_LIVERIES_ALL                                 :Όλες οι εταιρίες
-
+STR_CONFIG_PATCHES_PREFER_TEAMCHAT                              :{LTBLUE}Προτίμηση ομαδικού chat με <ENTER>: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING                        :{LTBLUE}Λειτουργία ροδέλας κύλισης: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SCROLLWHEEL_ZOOM                             :Zoom στο χάρτη
+STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLL                           :Μετακίνηση στο χάρτη
+STR_CONFIG_PATCHES_SCROLLWHEEL_OFF                              :Κλειστό
+STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER                       :{LTBLUE}Ταχύτητα ροδέλας μετακίνησης χάρτη: {ORANGE}{STRING}
 
+STR_CONFIG_PATCHES_MAX_TRAINS                                   :{LTBLUE}Μέγιστα τρένα ανα παίκτη: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Μέγιστα οχήματα ανα παίκτη: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAX_AIRCRAFT                                 :{LTBLUE}Μέγιστα αεροσκάφη ανα παίκτη: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_MAX_SHIPS                                    :{LTBLUE}Μέγιστα πλοία ανά παίκτη: {ORANGE}{STRING}
 
+STR_CONFIG_PATCHES_AI_BUILDS_TRAINS                             :{LTBLUE}Απενεργοποίηση τρένων υπολογιστή: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_BUILDS_ROADVEH                            :{LTBLUE}Απενεργοποίηση οχημάτων υπολογιστή: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_BUILDS_AIRCRAFT                           :{LTBLUE}Απενεργοποίηση αεροσκαφών υπολογιστή: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_BUILDS_SHIPS                              :{LTBLUE}Απενεργοποίηση πλοίων υπολογιστή: {ORANGE}{STRING}
 
+STR_CONFIG_PATCHES_AINEW_ACTIVE                                 :{LTBLUE}Ενεγοποίηση νέας AI (alpha): {ORANGE}{STRING}
+STR_CONFIG_PATCHES_AI_IN_MULTIPLAYER                            :{LTBLUE}Επιτρέπονται οι AI σε παιχνίδι για πολλούς παίκτες (πειραματικό): {ORANGE}{STRING}
 
+STR_CONFIG_PATCHES_SERVINT_TRAINS                               :{LTBLUE}Προεπιλεγμένο διάστημα επισκευών για τρένα: {ORANGE}{STRING} μέρες/%
+STR_CONFIG_PATCHES_SERVINT_TRAINS_DISABLED                      :{LTBLUE}Προεπιλεγμένο διάστημα επισκευών για τρένα: {ORANGE}απενεργοποιημένο
+STR_CONFIG_PATCHES_SERVINT_ROADVEH                              :{LTBLUE}Προεπιλεγμένο διάστημα επισκευών για οχήματα: {ORANGE}{STRING} μέρες/%
+STR_CONFIG_PATCHES_SERVINT_ROADVEH_DISABLED                     :{LTBLUE}Προεπιλεγμένο διάστημα επισκευών για οχήματα:: {ORANGE}απενεργοποιημένο
+STR_CONFIG_PATCHES_SERVINT_AIRCRAFT                             :{LTBLUE}Προεπιλεγμένο διάστημα επισκευών για αεροσκάφη: {ORANGE}{STRING} μέρες/%
+STR_CONFIG_PATCHES_SERVINT_AIRCRAFT_DISABLED                    :{LTBLUE}Προεπιλεγμένο διάστημα επισκευών για αεροσκάφη: {ORANGE}απενεργοποιημένο
+STR_CONFIG_PATCHES_SERVINT_SHIPS                                :{LTBLUE}Προεπιλεγμένο διάστημα επισκευών για πλοία: {ORANGE}{STRING} μέρες/%
+STR_CONFIG_PATCHES_SERVINT_SHIPS_DISABLED                       :{LTBLUE}Προεπιλεγμένο διάστημα επισκευών για πλοία: {ORANGE}απενεργοποιημένο
+STR_CONFIG_PATCHES_NOSERVICE                                    :{LTBLUE}Απενεργοποίηση επισκευών όταν οι βλάβες είναι απενεργοποιημένες: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_WAGONSPEEDLIMITS                             :{LTBLUE}Ενεργοποίηση ορίων ταχύτητας βαγονιών: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_DISABLE_ELRAILS                              :{LTBLUE}Απενεργοποίηση ηλεκτρικών γραμμών: {ORANGE}{STRING}
+
+STR_CONFIG_PATCHES_COLORED_NEWS_YEAR                            :{LTBLUE}Τα έγχρωμα νέα εμφανίζονται το: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_STARTING_YEAR                                :{LTBLUE}Έτος εκκίνησης: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_ENDING_YEAR                                  :{LTBLUE}Τέλος παιχνιδιού το: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_SMOOTH_ECONOMY                               :{LTBLUE}Ενεργοποίηση ομαλής οικονομίας (περισσότερες, μικρότερες αλλαγές)
+STR_CONFIG_PATCHES_ALLOW_SHARES                                 :{LTBLUE}Ενεργοποίηση δυνατότητας αγοράς μετοχών από άλλες εταιρείες
+STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY                         :{LTBLUE}Κατά το σύρσιμο, τοποθέτησε σήματα κάθε: {ORANGE}{STRING} τετράγωνο(α)
+STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE                  :{LTBLUE}Αυτόματο χτίσιμο σηματοφόρων πρίν: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_TOOLBAR_POS                                  :{LTBLUE}Θέση κύριας εργαλειοθήκης: {ORANGE}{STRING}
 STR_CONFIG_PATCHES_TOOLBAR_POS_LEFT                             :Αριστερά
 STR_CONFIG_PATCHES_TOOLBAR_POS_CENTER                           :Κέντρο
 STR_CONFIG_PATCHES_TOOLBAR_POS_RIGHT                            :Δεξιά
+STR_CONFIG_PATCHES_SNAP_RADIUS                                  :{LTBLUE}Ακτίνα επικόλλησης παραθύρου: {ORANGE}{STRING} px
+STR_CONFIG_PATCHES_SNAP_RADIUS_DISABLED                         :{LTBLUE}Ακτίνα επικόλλησης παραθύρου: {ORANGE}απενεργοποιημένο
 
+STR_CONFIG_PATCHES_GUI                                          :{BLACK}Σύστημα Διεπαφής
+STR_CONFIG_PATCHES_CONSTRUCTION                                 :{BLACK}Κατασκευή
+STR_CONFIG_PATCHES_VEHICLES                                     :{BLACK}Οχήματα
+STR_CONFIG_PATCHES_STATIONS                                     :{BLACK}Σταθμοί
+STR_CONFIG_PATCHES_ECONOMY                                      :{BLACK}Οικονομία
 STR_CONFIG_PATCHES_AI                                           :{BLACK}Ανταγωνιστές
 
+STR_CONFIG_PATCHES_DISABLED                                     :απενεργοποιημένο
 STR_CONFIG_PATCHES_INT32                                        :{NUM}
 STR_CONFIG_PATCHES_CURRENCY                                     :{CURRENCY}
 
+STR_CONFIG_PATCHES_QUERY_CAPT                                   :{WHITE}Αλλαγή τιμής ρύθμισης
+STR_CONFIG_PATCHES_SERVICE_INTERVAL_INCOMPATIBLE                :{WHITE}Κάποια ή όλα τα προεπιλεγμένα διαστήματα επισκευών παρακάτω δεν είναι συμβατά με την επιλεγμένη ρύθμιση! 5-90% και 30-800 μέρες είναι τα αποδεκτά
+STR_CONFIG_PATCHES_YAPF_SHIPS                                   :{LTBLUE}Χρησιμοποίηση YAPF για τα πλοία: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_YAPF_ROAD                                    :{LTBLUE}Χρησιμοποίηση YAPF για τα οχήματα: {ORANGE}{STRING}
+STR_CONFIG_PATCHES_YAPF_RAIL                                    :{LTBLUE}Χρησιμοποίηση YAPF για τα τρένα: {ORANGE}{STRING}
 
 STR_TEMPERATE_LANDSCAPE                                         :Συγκρατημένο τοπίο
 STR_SUB_ARCTIC_LANDSCAPE                                        :Πολικό τοπίο
@@ -847,19 +1157,48 @@
 STR_TOYLAND_LANDSCAPE                                           :Παιχνιδιάστικο τοπίο
 
 STR_CHEATS                                                      :{WHITE}Κλεψιές
+STR_CHEATS_TIP                                                  :{BLACK}Τα κουτάκια δείχνουν αν έχετε χρησιμοποιήσει αυτό το κόλπο πρίν
+STR_CHEATS_WARNING                                              :{BLACK}Προσοχή! Είστε έτοιμος να προδώσετε τους φίλους ανταγωνιστές σας. Θυμηθείτε ότι αυτή η ντροπή θα μείνει για πάντα.
+STR_CHEAT_MONEY                                                 :{LTBLUE}Αύξηση χρημάτων κατά {CURRENCY64}
+STR_CHEAT_CHANGE_PLAYER                                         :{LTBLUE}Παίξτε σαν παίκτης: {ORANGE}{COMMA}
+STR_CHEAT_EXTRA_DYNAMITE                                        :{LTBLUE}Μαγική μπουλντόζα (αφαιρεί βιομηχανίες, αμετακίνητα): {ORANGE}{STRING}
+STR_CHEAT_CROSSINGTUNNELS                                       :{LTBLUE}Τα τούνελ διασταυρώνονται: {ORANGE}{STRING}
+STR_CHEAT_BUILD_IN_PAUSE                                        :{LTBLUE}Χτήσιμο ενώ βρίσκεστε σε παύση: {ORANGE}{STRING}
+STR_CHEAT_NO_JETCRASH                                           :{LTBLUE}Τα Jet δεν θα συγκρούονται (συχνά) σε μικρά αεροδρόμια: {ORANGE} {STRING}
+STR_CHEAT_SWITCH_CLIMATE                                        :{LTBLUE}Αλλαγή κλίματος: {ORANGE} {STRING}
+STR_CHEAT_CHANGE_DATE                                           :{LTBLUE}Αλλαγή ημ/νίας: {ORANGE} {DATE_SHORT}
+STR_CHEAT_SETUP_PROD                                            :{LTBLUE}Ενεργοποίηση δυνατότητας αλλαγής τιμών παραγωγής: {ORANGE}{STRING}
 
 STR_HEADING_FOR_WAYPOINT                                        :{LTBLUE}Καθ' οδόν {WAYPOINT}
+STR_HEADING_FOR_WAYPOINT_VEL                                    :{LTBLUE}Πορεία προς {WAYPOINT}, {VELOCITY}
 
 STR_GO_TO_WAYPOINT                                              :Πήγαινε δια μέσου {WAYPOINT}
-
+STR_GO_NON_STOP_TO_WAYPOINT                                     :Πήγαινε χωρίς στάση μέσω {WAYPOINT}
 
+STR_WAYPOINTNAME_CITY                                           :Σημείο πορείας {TOWN}
+STR_WAYPOINTNAME_CITY_SERIAL                                    :Σημείο πορείας {TOWN} #{COMMA}
+STR_LANDINFO_WAYPOINT                                           :Σημείο πορείας
 
+STR_WAYPOINT                                                    :{WHITE}Σημείο πορείας
+STR_WAYPOINT_GRAPHICS_TIP                                       :{BLACK}Επιλογή τύπου σημείου πορείας
 
+STR_WAYPOINT_VIEWPORT                                           :{WHITE}{WAYPOINT}
+STR_WAYPOINT_VIEWPORT_TINY                                      :{TINYFONT}{WHITE}{WAYPOINT}
+STR_WAYPOINT_RAW                                                :{WAYPOINT}
+STR_EDIT_WAYPOINT_NAME                                          :{WHITE}Διαμόρφωση ονόματος σημείου πορείας
 
+STR_CANT_CHANGE_WAYPOINT_NAME                                   :{WHITE}Αδύνατο να αλλαχτεί το όνομα του σημείου πορείας...
+STR_CONVERT_RAIL_TO_WAYPOINT_TIP                                :{BLACK}Μετατροπή γραμμής σε σημείο πορείας
+STR_CANT_BUILD_TRAIN_WAYPOINT                                   :{WHITE}Αδύνατο να χτιστεί σημείο πορείας τρένου εδώ...
+STR_CANT_REMOVE_TRAIN_WAYPOINT                                  :{WHITE}Αδύνατο να αφαιρεθεί το σημείο πορείας τρένου εδώ...
+
+STR_BUILD_AUTORAIL_TIP                                          :{BLACK}Κατασκευή σιδηροδρομικής γραμμής χρησιμοποιώντας την Αυτόματη Γραμμή
 
 STR_NO_TOWN_IN_SCENARIO                                         :{WHITE}...δεν υπάρχει καμία πόλη στην πίστα
 
+STR_GENERATE_RANDOM_LANDSCAPE                                   :{WHITE}Είστε σίγουρος ότι θέλετε να δημιουργήσετε ένα τυχαίο τοπίο;
 STR_MANY_RANDOM_TOWNS                                           :{BLACK}Πολλές τυχαίες πόλεις
+STR_RANDOM_TOWNS_TIP                                            :{BLACK}Κάλυψη του χάρτη με τυχαία τοποθετημένες πόλεις
 STR_MANY_RANDOM_INDUSTRIES                                      :{BLACK}Πολλές τυχαίες βιομηχανίες
 
 
--- a/src/lang/unfinished/latvian.txt	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lang/unfinished/latvian.txt	Mon Mar 19 12:38:16 2007 +0000
@@ -660,7 +660,6 @@
 STR_028D_PLACE_LIGHTHOUSE                                       :{BLACK}Bu've't ba'ku
 STR_028E_PLACE_TRANSMITTER                                      :{BLACK}Bu've't raidi'ta'ju
 STR_028F_DEFINE_DESERT_AREA                                     :{BLACK}Nora'di't tuksnes'a plati'bu.{}Spiest un turet CTRL lai to izdze'stu
-STR_CREATE_LAKE                                                 :{BLACK}Nora'di't u'dens plati'bu.{}Ta' tiks appludina'ta ja bu's ju'ras li'meni'
 STR_0290_DELETE                                                 :{BLACK}Izdzest
 STR_0291_DELETE_THIS_TOWN_COMPLETELY                            :{BLACK}Pilni'ba' izdze'st s'o pilse'tu
 STR_0292_SAVE_SCENARIO                                          :Saglaba't scena'riju
--- a/src/livery.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/livery.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,7 +8,7 @@
 #include "helpers.hpp"
 
 /* List of different livery schemes. */
-typedef enum LiverySchemes {
+enum LiveryScheme {
 	LS_BEGIN = 0,
 	LS_DEFAULT = 0,
 
@@ -39,25 +39,25 @@
 	LS_LARGE_PLANE,
 
 	LS_END
-} LiveryScheme;
+};
 
 DECLARE_POSTFIX_INCREMENT(LiveryScheme);
 
 /* List of different livery classes, used only by the livery GUI. */
-typedef enum LiveryClasses {
+enum LiveryClass {
 	LC_OTHER,
 	LC_RAIL,
 	LC_ROAD,
 	LC_SHIP,
 	LC_AIRCRAFT,
 	LC_END
-} LiveryClass;
+};
 
 
-typedef struct Livery {
+struct Livery {
 	bool in_use;  ///< Set if this livery should be used instead of the default livery.
 	byte colour1; ///< First colour, for all vehicles.
 	byte colour2; ///< Second colour, for vehicles with 2CC support.
-} Livery;
+};
 
 #endif /* LIVERY_H */
--- a/src/lzoconf.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/lzoconf.h	Mon Mar 19 12:38:16 2007 +0000
@@ -29,8 +29,7 @@
    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
    Markus F.X.J. Oberhumer
-   <markus@oberhumer.com>
-   http://www.oberhumer.com/opensource/lzo/
+   <markus@oberhumer.com>   http://www.oberhumer.com/opensource/lzo/
  */
 
 
@@ -407,11 +406,11 @@
 LZO_EXTERN(int) __lzo_init2(unsigned,int,int,int,int,int,int,int,int,int);
 
 /* version functions (useful for shared libraries) */
-LZO_EXTERN(unsigned) lzo_version(void);
-LZO_EXTERN(const char *) lzo_version_string(void);
-LZO_EXTERN(const char *) lzo_version_date(void);
-LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
-LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
+LZO_EXTERN(unsigned) lzo_version();
+LZO_EXTERN(const char *) lzo_version_string();
+LZO_EXTERN(const char *) lzo_version_date();
+LZO_EXTERN(const lzo_charp) _lzo_version_string();
+LZO_EXTERN(const lzo_charp) _lzo_version_date();
 
 /* string functions */
 LZO_EXTERN(int)
@@ -431,7 +430,7 @@
 
 /* misc. */
 LZO_EXTERN(lzo_bool) lzo_assert(int _expr);
-LZO_EXTERN(int) _lzo_config_check(void);
+LZO_EXTERN(int) _lzo_config_check();
 typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
 typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
 typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t;
--- a/src/main_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/main_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -52,8 +52,8 @@
 RailType _last_built_railtype;
 static int _scengen_town_size = 2; // depress medium-sized towns per default
 
-extern void GenerateIndustries(void);
-extern bool GenerateTowns(void);
+extern void GenerateIndustries();
+extern bool GenerateTowns();
 
 
 void HandleOnEditText(const char *str)
@@ -136,7 +136,7 @@
 {
 	if (_networking && !_network_server) return; // only server can pause the game
 
-	if (DoCommandP(0, _pause ? 0 : 1, 0, NULL, CMD_PAUSE)) SndPlayFx(SND_15_BEEP);
+	if (DoCommandP(0, _pause_game ? 0 : 1, 0, NULL, CMD_PAUSE)) SndPlayFx(SND_15_BEEP);
 }
 
 static void ToolbarFastForwardClick(Window *w)
@@ -265,22 +265,22 @@
 
 static void MenuClickShowTrains(int index)
 {
-	ShowVehicleListWindow((PlayerID)index, VEH_Train);
+	ShowVehicleListWindow((PlayerID)index, VEH_TRAIN);
 }
 
 static void MenuClickShowRoad(int index)
 {
-	ShowVehicleListWindow((PlayerID)index, VEH_Road);
+	ShowVehicleListWindow((PlayerID)index, VEH_ROAD);
 }
 
 static void MenuClickShowShips(int index)
 {
-	ShowVehicleListWindow((PlayerID)index, VEH_Ship);
+	ShowVehicleListWindow((PlayerID)index, VEH_SHIP);
 }
 
 static void MenuClickShowAir(int index)
 {
-	ShowVehicleListWindow((PlayerID)index, VEH_Aircraft);
+	ShowVehicleListWindow((PlayerID)index, VEH_AIRCRAFT);
 }
 
 static void MenuClickBuildRail(int index)
@@ -337,7 +337,7 @@
 	ShowQueryString(STR_WAYPOINT_RAW, STR_EDIT_WAYPOINT_NAME, 30, 180, NULL, CS_ALPHANUMERAL);
 }
 
-static void SelectSignTool(void)
+static void SelectSignTool()
 {
 	if (_cursor.sprite == SPR_CURSOR_SIGN) {
 		ResetObjectToPlace();
@@ -370,12 +370,12 @@
 	}
 }
 
-static void MenuClickSmallScreenshot(void)
+static void MenuClickSmallScreenshot()
 {
 	SetScreenshotType(SC_VIEWPORT);
 }
 
-static void MenuClickWorldScreenshot(void)
+static void MenuClickWorldScreenshot()
 {
 	SetScreenshotType(SC_WORLD);
 }
@@ -812,7 +812,7 @@
 	int dis = -1;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Train && IsFrontEngine(v)) CLRBIT(dis, v->owner);
+		if (v->type == VEH_TRAIN && IsFrontEngine(v)) CLRBIT(dis, v->owner);
 	}
 	PopupMainPlayerToolbMenu(w, 310, 13, dis);
 }
@@ -823,7 +823,7 @@
 	int dis = -1;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Road) CLRBIT(dis, v->owner);
+		if (v->type == VEH_ROAD) CLRBIT(dis, v->owner);
 	}
 	PopupMainPlayerToolbMenu(w, 332, 14, dis);
 }
@@ -834,7 +834,7 @@
 	int dis = -1;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Ship) CLRBIT(dis, v->owner);
+		if (v->type == VEH_SHIP) CLRBIT(dis, v->owner);
 	}
 	PopupMainPlayerToolbMenu(w, 354, 15, dis);
 }
@@ -845,7 +845,7 @@
 	int dis = -1;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Aircraft) CLRBIT(dis, v->owner);
+		if (v->type == VEH_AIRCRAFT) CLRBIT(dis, v->owner);
 	}
 	PopupMainPlayerToolbMenu(w, 376, 16, dis);
 }
@@ -1379,7 +1379,7 @@
 	ScenEditLandGenWndProc,
 };
 
-static inline void ShowEditorTerraformToolBar(void)
+static inline void ShowEditorTerraformToolBar()
 {
 	AllocateWindowDescFront(&_scen_edit_land_gen_desc, 0);
 }
@@ -1593,7 +1593,7 @@
 };
 
 
-static bool AnyTownExists(void)
+static bool AnyTownExists()
 {
 	const Town *t;
 
@@ -1841,10 +1841,10 @@
 		case WKC_F10:ShowOperatingProfitGraph(); break;
 		case WKC_F11: ShowCompanyLeagueTable(); break;
 		case WKC_F12: ShowBuildIndustryWindow(); break;
-		case WKC_SHIFT | WKC_F1: ShowVehicleListWindow(_local_player, VEH_Train); break;
-		case WKC_SHIFT | WKC_F2: ShowVehicleListWindow(_local_player, VEH_Road); break;
-		case WKC_SHIFT | WKC_F3: ShowVehicleListWindow(_local_player, VEH_Ship); break;
-		case WKC_SHIFT | WKC_F4: ShowVehicleListWindow(_local_player, VEH_Aircraft); break;
+		case WKC_SHIFT | WKC_F1: ShowVehicleListWindow(_local_player, VEH_TRAIN); break;
+		case WKC_SHIFT | WKC_F2: ShowVehicleListWindow(_local_player, VEH_ROAD); break;
+		case WKC_SHIFT | WKC_F3: ShowVehicleListWindow(_local_player, VEH_SHIP); break;
+		case WKC_SHIFT | WKC_F4: ShowVehicleListWindow(_local_player, VEH_AIRCRAFT); break;
 		case WKC_SHIFT | WKC_F5: ToolbarZoomInClick(w); break;
 		case WKC_SHIFT | WKC_F6: ToolbarZoomOutClick(w); break;
 		case WKC_SHIFT | WKC_F7: ShowBuildRailToolbar(_last_built_railtype, -1); break;
@@ -1873,7 +1873,7 @@
 	} break;
 
 	case WE_MOUSELOOP:
-		if (IsWindowWidgetLowered(w, 0) != !!_pause) {
+		if (IsWindowWidgetLowered(w, 0) != !!_pause_game) {
 			ToggleWidgetLoweredState(w, 0);
 			InvalidateWidget(w, 0);
 		}
@@ -2072,7 +2072,7 @@
 	} break;
 
 	case WE_MOUSELOOP:
-		if (IsWindowWidgetLowered(w, 0) != !!_pause) {
+		if (IsWindowWidgetLowered(w, 0) != !!_pause_game) {
 			ToggleWidgetLoweredState(w, 0);
 			SetWindowDirty(w);
 		}
@@ -2155,7 +2155,7 @@
 		DrawWindowWidgets(w);
 		SetDParam(0, _date);
 		DrawStringCentered(
-			70, 1, (_pause || _patches.status_long_date) ? STR_00AF : STR_00AE, 0
+			70, 1, (_pause_game || _patches.status_long_date) ? STR_00AF : STR_00AE, 0
 		);
 
 		if (p != NULL) {
@@ -2169,7 +2169,7 @@
 			DrawStringCentered(320, 1, STR_SAVING_GAME, 0);
 		} else if (_do_autosave) {
 			DrawStringCentered(320, 1, STR_032F_AUTOSAVE, 0);
-		} else if (_pause) {
+		} else if (_pause_game) {
 			DrawStringCentered(320, 1, STR_0319_PAUSED, 0);
 		} else if (WP(w,def_d).data_1 > -1280 && FindWindowById(WC_NEWS_WINDOW,0) == NULL && _statusbar_news_item.string_id != 0) {
 			/* Draw the scrolling news text */
@@ -2201,7 +2201,7 @@
 		break;
 
 	case WE_TICK: {
-		if (_pause) return;
+		if (_pause_game) return;
 
 		if (WP(w, def_d).data_1 > -1280) { // Scrolling text
 			WP(w, def_d).data_1 -= 2;
@@ -2235,7 +2235,7 @@
 	StatusBarWndProc
 };
 
-extern void UpdateAllStationVirtCoord(void);
+extern void UpdateAllStationVirtCoord();
 
 static void MainWindowWndProc(Window *w, WindowEvent *e)
 {
@@ -2401,9 +2401,9 @@
 }
 
 
-void ShowSelectGameWindow(void);
-
-void SetupColorsAndInitialWindow(void)
+void ShowSelectGameWindow();
+
+void SetupColorsAndInitialWindow()
 {
 	uint i;
 	Window *w;
@@ -2436,7 +2436,7 @@
 	}
 }
 
-void ShowVitalWindows(void)
+void ShowVitalWindows()
 {
 	Window *w;
 
@@ -2461,7 +2461,7 @@
 	WP(w,def_d).data_1 = -1280;
 }
 
-void GameSizeChanged(void)
+void GameSizeChanged()
 {
 	_cur_resolution[0] = _screen.width;
 	_cur_resolution[1] = _screen.height;
@@ -2470,7 +2470,7 @@
 	MarkWholeScreenDirty();
 }
 
-void InitializeMainGui(void)
+void InitializeMainGui()
 {
 	/* Clean old GUI values */
 	_last_built_railtype = RAILTYPE_RAIL;
--- a/src/map.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/map.h	Mon Mar 19 12:38:16 2007 +0000
@@ -18,7 +18,7 @@
 #define TILE_MASK(x) ((x) & _map_tile_mask)
 #define TILE_ASSERT(x) assert(TILE_MASK(x) == (x));
 
-typedef struct Tile {
+struct Tile {
 	byte type_height;
 	byte m1;
 	uint16 m2;
@@ -26,22 +26,22 @@
 	byte m4;
 	byte m5;
 	byte m6;
-} Tile;
+};
 
 extern Tile* _m;
 
 void AllocateMap(uint size_x, uint size_y);
 
 /* binary logarithm of the map size, try to avoid using this one */
-static inline uint MapLogX(void)  { return _map_log_x; }
+static inline uint MapLogX()  { return _map_log_x; }
 /* The size of the map */
-static inline uint MapSizeX(void) { return _map_size_x; }
-static inline uint MapSizeY(void) { return _map_size_y; }
+static inline uint MapSizeX() { return _map_size_x; }
+static inline uint MapSizeY() { return _map_size_y; }
 /* The maximum coordinates */
-static inline uint MapMaxX(void) { return _map_size_x - 1; }
-static inline uint MapMaxY(void) { return _map_size_y - 1; }
+static inline uint MapMaxX() { return _map_size_x - 1; }
+static inline uint MapMaxY() { return _map_size_y - 1; }
 /* The number of tiles in the map */
-static inline uint MapSize(void) { return _map_size; }
+static inline uint MapSize() { return _map_size; }
 
 /* Scale a number relative to the map size */
 uint ScaleByMapSize(uint); // Scale relative to the number of tiles
@@ -92,10 +92,10 @@
 }
 
 
-typedef struct TileIndexDiffC {
+struct TileIndexDiffC {
 	int16 x;
 	int16 y;
-} TileIndexDiffC;
+};
 
 static inline TileIndexDiff ToTileIndexDiff(TileIndexDiffC tidc)
 {
--- a/src/md5.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/md5.h	Mon Mar 19 12:38:16 2007 +0000
@@ -68,11 +68,11 @@
 typedef unsigned int md5_word_t; /* 32-bit word */
 
 /* Define the state of the MD5 Algorithm. */
-typedef struct md5_state_s {
+struct md5_state_t {
     md5_word_t count[2]; /* message length in bits, lsw first */
     md5_word_t abcd[4];  /* digest buffer */
     md5_byte_t buf[64];  /* accumulate block */
-} md5_state_t;
+};
 
 /* Initialize the algorithm. */
 void md5_init(md5_state_t *pms);
--- a/src/mersenne.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/mersenne.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -32,7 +32,7 @@
  }
 
 
-static uint32 ReloadMT(void)
+static uint32 ReloadMT()
  {
     register uint32 *p0=_mt_state, *p2=_mt_state+2, *pM=_mt_state+M, s0, s1;
     register int    j;
@@ -56,7 +56,7 @@
  }
 
 
-uint32 RandomMT(void)
+uint32 RandomMT()
 {
 	uint32 y;
 
--- a/src/minilzo.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/minilzo.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -270,7 +270,7 @@
 
 __LZO_EXTERN_C int __lzo_init_done;
 __LZO_EXTERN_C const lzo_byte __lzo_copyright[];
-LZO_EXTERN(const lzo_byte *) lzo_copyright(void);
+LZO_EXTERN(const lzo_byte *) lzo_copyright();
 __LZO_EXTERN_C const lzo_uint32 _lzo_crc32_table[256];
 
 #define _LZO_STRINGIZE(x)		   #x
@@ -709,7 +709,7 @@
 
 #define IS_POWER_OF_2(x)		(((x) & ((x) - 1)) == 0)
 
-// static lzo_bool schedule_insns_bug(void);
+// static lzo_bool schedule_insns_bug();
 // static lzo_bool strength_reduce_bug(int *);
 
 #if 0 || defined(LZO_DEBUG)
--- a/src/misc.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/misc.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -30,7 +30,7 @@
 #include "network/network_data.h"
 uint32 DoRandom(int line, const char *file)
 #else // RANDOM_DEBUG
-uint32 Random(void)
+uint32 Random()
 #endif // RANDOM_DEBUG
 {
 
@@ -62,7 +62,7 @@
 #endif
 
 
-uint32 InteractiveRandom(void)
+uint32 InteractiveRandom()
 {
 	uint32 t = _random_seeds[1][1];
 	uint32 s = _random_seeds[1][0];
@@ -75,27 +75,27 @@
 	return GB(InteractiveRandom(), 0, 16) * max >> 16;
 }
 
-void InitializeVehicles(void);
-void InitializeWaypoints(void);
-void InitializeDepots(void);
-void InitializeEngines(void);
-void InitializeOrders(void);
-void InitializeClearLand(void);
-void InitializeRailGui(void);
-void InitializeRoadGui(void);
-void InitializeAirportGui(void);
-void InitializeDockGui(void);
-void InitializeIndustries(void);
-void InitializeMainGui(void);
-void InitializeLandscape(void);
-void InitializeTowns(void);
-void InitializeTrees(void);
-void InitializeSigns(void);
-void InitializeStations(void);
-static void InitializeNameMgr(void);
-void InitializePlayers(void);
-static void InitializeCheats(void);
-void InitializeNPF(void);
+void InitializeVehicles();
+void InitializeWaypoints();
+void InitializeDepots();
+void InitializeEngines();
+void InitializeOrders();
+void InitializeClearLand();
+void InitializeRailGui();
+void InitializeRoadGui();
+void InitializeAirportGui();
+void InitializeDockGui();
+void InitializeIndustries();
+void InitializeMainGui();
+void InitializeLandscape();
+void InitializeTowns();
+void InitializeTrees();
+void InitializeSigns();
+void InitializeStations();
+static void InitializeNameMgr();
+void InitializePlayers();
+static void InitializeCheats();
+void InitializeNPF();
 
 void InitializeGame(int mode, uint size_x, uint size_y)
 {
@@ -105,7 +105,7 @@
 
 	SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, 0, WC_MAIN_WINDOW, 0);
 
-	_pause = 0;
+	_pause_game = 0;
 	_fast_forward = 0;
 	_tick_counter = 0;
 	_date_fract = 0;
@@ -172,13 +172,13 @@
 }
 
 
-static void InitializeCheats(void)
+static void InitializeCheats()
 {
 	memset(&_cheats, 0, sizeof(Cheats));
 }
 
 
-static void InitializeNameMgr(void)
+static void InitializeNameMgr()
 {
 	memset(_name_array, 0, sizeof(_name_array));
 }
@@ -206,7 +206,7 @@
 	}
 }
 
-void ConvertNameArray(void)
+void ConvertNameArray()
 {
 	uint i;
 
@@ -269,7 +269,7 @@
 }
 
 
-static void Save_NAME(void)
+static void Save_NAME()
 {
 	int i;
 
@@ -281,7 +281,7 @@
 	}
 }
 
-static void Load_NAME(void)
+static void Load_NAME()
 {
 	int index;
 
@@ -309,14 +309,14 @@
 	    SLEG_VAR(_cur_player_tick_index,  SLE_FILE_U8  | SLE_VAR_U32),
 	    SLEG_VAR(_next_competitor_start,  SLE_FILE_U16 | SLE_VAR_U32),
 	    SLEG_VAR(_trees_tick_ctr,         SLE_UINT8),
-	SLEG_CONDVAR(_pause,                  SLE_UINT8,                   4, SL_MAX_VERSION),
+	SLEG_CONDVAR(_pause_game,             SLE_UINT8,                   4, SL_MAX_VERSION),
 	SLEG_CONDVAR(_cur_town_iter,          SLE_UINT32,                 11, SL_MAX_VERSION),
 	    SLEG_END()
 };
 
 /* Save load date related variables as well as persistent tick counters
  * XXX: currently some unrelated stuff is just put here */
-static void SaveLoad_DATE(void)
+static void SaveLoad_DATE()
 {
 	SlGlobList(_date_desc);
 }
@@ -331,7 +331,7 @@
 	    SLEG_END()
 };
 
-static void SaveLoad_VIEW(void)
+static void SaveLoad_VIEW()
 {
 	SlGlobList(_view_desc);
 }
@@ -345,20 +345,20 @@
 	    SLEG_END()
 };
 
-static void Save_MAPS(void)
+static void Save_MAPS()
 {
 	_map_dim_x = MapSizeX();
 	_map_dim_y = MapSizeY();
 	SlGlobList(_map_dimensions);
 }
 
-static void Load_MAPS(void)
+static void Load_MAPS()
 {
 	SlGlobList(_map_dimensions);
 	AllocateMap(_map_dim_x, _map_dim_y);
 }
 
-static void Load_MAPT(void)
+static void Load_MAPT()
 {
 	uint size = MapSize();
 	uint i;
@@ -372,7 +372,7 @@
 	}
 }
 
-static void Save_MAPT(void)
+static void Save_MAPT()
 {
 	uint size = MapSize();
 	uint i;
@@ -387,7 +387,7 @@
 	}
 }
 
-static void Load_MAP1(void)
+static void Load_MAP1()
 {
 	uint size = MapSize();
 	uint i;
@@ -401,7 +401,7 @@
 	}
 }
 
-static void Save_MAP1(void)
+static void Save_MAP1()
 {
 	uint size = MapSize();
 	uint i;
@@ -416,7 +416,7 @@
 	}
 }
 
-static void Load_MAP2(void)
+static void Load_MAP2()
 {
 	uint size = MapSize();
 	uint i;
@@ -433,7 +433,7 @@
 	}
 }
 
-static void Save_MAP2(void)
+static void Save_MAP2()
 {
 	uint size = MapSize();
 	uint i;
@@ -448,7 +448,7 @@
 	}
 }
 
-static void Load_MAP3(void)
+static void Load_MAP3()
 {
 	uint size = MapSize();
 	uint i;
@@ -462,7 +462,7 @@
 	}
 }
 
-static void Save_MAP3(void)
+static void Save_MAP3()
 {
 	uint size = MapSize();
 	uint i;
@@ -477,7 +477,7 @@
 	}
 }
 
-static void Load_MAP4(void)
+static void Load_MAP4()
 {
 	uint size = MapSize();
 	uint i;
@@ -491,7 +491,7 @@
 	}
 }
 
-static void Save_MAP4(void)
+static void Save_MAP4()
 {
 	uint size = MapSize();
 	uint i;
@@ -506,7 +506,7 @@
 	}
 }
 
-static void Load_MAP5(void)
+static void Load_MAP5()
 {
 	uint size = MapSize();
 	uint i;
@@ -520,7 +520,7 @@
 	}
 }
 
-static void Save_MAP5(void)
+static void Save_MAP5()
 {
 	uint size = MapSize();
 	uint i;
@@ -535,7 +535,7 @@
 	}
 }
 
-static void Load_MAP6(void)
+static void Load_MAP6()
 {
 	/* Still available for loading old games */
 	uint size = MapSize();
@@ -565,7 +565,7 @@
 	}
 }
 
-static void Save_MAP6(void)
+static void Save_MAP6()
 {
 	uint size = MapSize();
 	uint i;
@@ -581,7 +581,7 @@
 }
 
 
-static void Save_CHTS(void)
+static void Save_CHTS()
 {
 	byte count = sizeof(_cheats)/sizeof(Cheat);
 	Cheat* cht = (Cheat*) &_cheats;
@@ -594,7 +594,7 @@
 	}
 }
 
-static void Load_CHTS(void)
+static void Load_CHTS()
 {
 	Cheat* cht = (Cheat*)&_cheats;
 	uint count = SlGetFieldLength() / 2;
--- a/src/misc/autoptr.hpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/misc/autoptr.hpp	Mon Mar 19 12:38:16 2007 +0000
@@ -1,4 +1,4 @@
-/* $Id:$ */
+/* $Id$ */
 
 #ifndef AUTOPTR_HPP
 #define AUTOPTR_HPP
--- a/src/misc_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/misc_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -257,8 +257,8 @@
 int32 CmdPause(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	if (flags & DC_EXEC) {
-		_pause += (p1 == 1) ? 1 : -1;
-		if (_pause == (byte)-1) _pause = 0;
+		_pause_game += (p1 == 1) ? 1 : -1;
+		if (_pause_game == (byte)-1) _pause_game = 0;
 		InvalidateWindow(WC_STATUS_BAR, 0);
 		InvalidateWindow(WC_MAIN_TOOLBAR, 0);
 	}
--- a/src/misc_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/misc_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -191,7 +191,7 @@
 #undef LANDINFOD_LEVEL
 }
 
-void PlaceLandBlockInfo(void)
+void PlaceLandBlockInfo()
 {
 	if (_cursor.sprite == SPR_CURSOR_QUERY) {
 		ResetObjectToPlace();
@@ -215,6 +215,7 @@
 	"  Tamás Faragó (Darkvater) - Lead coder",
 	"  Loïc Guilloux (glx) - In training, not yet specialized",
 	"  Jaroslav Mazanec (KUDr) - YAPG (Yet Another Pathfinder God) ;)",
+	"  Jonathan Coome (Maedhros) - High priest of the newGRF Temple",
 	"  Attila Bán (MiHaMiX) - WebTranslator, Nightlies, Wiki and bugtracker host",
 	"  Peter Nelson (peter1138) - Spiritual descendant from newgrf gods",
 	"  Remko Bijker (Rubidium) - THE desync hunter",
@@ -304,7 +305,7 @@
 };
 
 
-void ShowAboutWindow(void)
+void ShowAboutWindow()
 {
 	DeleteWindowById(WC_GAME_OPTIONS, 0);
 	AllocateWindowDesc(&_about_desc);
@@ -465,13 +466,13 @@
 };
 
 
-void ShowBuildTreesToolbar(void)
+void ShowBuildTreesToolbar()
 {
 	if (!IsValidPlayer(_current_player)) return;
 	AllocateWindowDescFront(&_build_trees_desc, 0);
 }
 
-void ShowBuildTreesScenToolbar(void)
+void ShowBuildTreesScenToolbar()
 {
 	AllocateWindowDescFront(&_build_trees_scen_desc, 0);
 }
@@ -1190,12 +1191,12 @@
 };
 
 
-typedef struct query_d {
+struct query_d {
 	void (*proc)(Window*, bool); ///< callback function executed on closing of popup. Window* points to parent, bool is true if 'yes' clicked, false otherwise
 	StringID message;            ///< message shown for query window
 	uint32 params[20];           ///< local copy of _decode_parameters
 	bool calledback;             ///< has callback been executed already (internal usage for WE_DESTROY event)
-} query_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(query_d));
 
 
@@ -1329,7 +1330,7 @@
 /* Colors for fios types */
 const byte _fios_colors[] = {13, 9, 9, 6, 5, 6, 5, 6, 6, 8};
 
-void BuildFileList(void)
+void BuildFileList()
 {
 	_fios_path_changed = true;
 	FiosFreeSavegameList();
@@ -1362,7 +1363,7 @@
 	DoDrawStringTruncated(path, 2, 27, 16, maxw);
 }
 
-static void MakeSortedSaveGameList(void)
+static void MakeSortedSaveGameList()
 {
 	uint sort_start = 0;
 	uint sort_end = 0;
@@ -1386,7 +1387,7 @@
 		qsort(_fios_list + sort_start, s_amount, sizeof(FiosItem), compare_FiosItems);
 }
 
-static void GenerateFileName(void)
+static void GenerateFileName()
 {
 	/* Check if we are not a specatator who wants to generate a name..
 	    Let's use the name of player #0 for now. */
@@ -1398,7 +1399,7 @@
 	GetString(_edit_str_buf, STR_4004, lastof(_edit_str_buf));
 }
 
-extern void StartupEngines(void);
+extern void StartupEngines();
 
 static void SaveLoadDlgWndProc(Window *w, WindowEvent *e)
 {
@@ -1662,7 +1663,7 @@
 	ResetObjectToPlace();
 }
 
-void RedrawAutosave(void)
+void RedrawAutosave()
 {
 	SetWindowDirty(FindWindowById(WC_STATUS_BAR, 0));
 }
@@ -1733,7 +1734,7 @@
 	return _opt.landscape;
 }
 
-extern void EnginesMonthlyLoop(void);
+extern void EnginesMonthlyLoop();
 
 /**
  * @param p2 1 (increase) or -1 (decrease)
@@ -1765,7 +1766,7 @@
 typedef TinyEnumT<ce_flags_long> ce_flags;
 
 
-typedef struct CheatEntry {
+struct CheatEntry {
 	VarType type;          ///< type of selector
 	ce_flags flags;        ///< selector flags
 	StringID str;          ///< string with descriptive text
@@ -1773,7 +1774,7 @@
 	bool *been_used;       ///< has this cheat been used before?
 	CheckButtonClick *proc;///< procedure
 	int16 min, max;        ///< range for spinbox setting
-} CheatEntry;
+};
 
 static const CheatEntry _cheats_ui[] = {
 	{SLE_BOOL, {CE_CLICK}, STR_CHEAT_MONEY,          &_cheats.money.value,           &_cheats.money.been_used,           &ClickMoneyCheat,         0,  0},
@@ -1928,7 +1929,7 @@
 };
 
 
-void ShowCheatWindow(void)
+void ShowCheatWindow()
 {
 	DeleteWindowById(WC_CHEATS, 0);
 	AllocateWindowDesc(&_cheats_desc);
--- a/src/mixer.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/mixer.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -93,7 +93,7 @@
 	}
 }
 
-MixerChannel *MxAllocateChannel(void)
+MixerChannel *MxAllocateChannel()
 {
 	MixerChannel *mc;
 	for (mc = _channels; mc != endof(_channels); mc++)
--- a/src/mixer.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/mixer.h	Mon Mar 19 12:38:16 2007 +0000
@@ -5,7 +5,7 @@
 #ifndef MIXER_H
 #define MIXER_H
 
-typedef struct MixerChannel MixerChannel;
+struct MixerChannel;
 
 enum {
 	MX_AUTOFREE = 1,
@@ -17,7 +17,7 @@
 bool MxInitialize(uint rate);
 void MxMixSamples(void* buffer, uint samples);
 
-MixerChannel* MxAllocateChannel(void);
+MixerChannel* MxAllocateChannel();
 void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, uint size, uint rate, uint flags);
 void MxSetChannelVolume(MixerChannel *mc, uint left, uint right);
 void MxActivateChannel(MixerChannel*);
--- a/src/music.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/music.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,10 +8,10 @@
 #define NUM_SONGS_PLAYLIST 33
 #define NUM_SONGS_AVAILABLE 22
 
-typedef struct SongSpecs {
+struct SongSpecs {
 	char filename[256];
 	char song_name[64];
-} SongSpecs;
+};
 
 extern const SongSpecs origin_songs_specs[NUM_SONGS_AVAILABLE];
 
--- a/src/music/bemidi.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/music/bemidi.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -14,7 +14,7 @@
 	return NULL;
 }
 
-static void bemidi_stop(void)
+static void bemidi_stop()
 {
 	midiSynthFile.UnloadFile();
 }
@@ -28,12 +28,12 @@
 	midiSynthFile.Start();
 }
 
-static void bemidi_stop_song(void)
+static void bemidi_stop_song()
 {
 	midiSynthFile.UnloadFile();
 }
 
-static bool bemidi_is_playing(void)
+static bool bemidi_is_playing()
 {
 	return !midiSynthFile.IsFinished();
 }
--- a/src/music/dmusic.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/music/dmusic.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -107,7 +107,7 @@
 }
 
 
-static void DMusicMidiStop(void)
+static void DMusicMidiStop()
 {
 	seeking = false;
 
@@ -186,7 +186,7 @@
 }
 
 
-static void DMusicMidiStopSong(void)
+static void DMusicMidiStopSong()
 {
 	if (FAILED(performance->Stop(segment, NULL, 0, 0))) {
 		DEBUG(driver, 0, "DirectMusic: StopSegment failed");
@@ -195,7 +195,7 @@
 }
 
 
-static bool DMusicMidiIsSongPlaying(void)
+static bool DMusicMidiIsSongPlaying()
 {
 	/* Not the nicest code, but there is a short delay before playing actually
 	 * starts. OpenTTD makes no provision for this. */
--- a/src/music/extmidi.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/music/extmidi.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -21,8 +21,8 @@
 	pid_t pid;
 } _midi;
 
-static void DoPlay(void);
-static void DoStop(void);
+static void DoPlay();
+static void DoStop();
 
 static const char* ExtMidiStart(const char* const * parm)
 {
@@ -31,7 +31,7 @@
 	return NULL;
 }
 
-static void ExtMidiStop(void)
+static void ExtMidiStop()
 {
 	_midi.song[0] = '\0';
 	DoStop();
@@ -43,13 +43,13 @@
 	DoStop();
 }
 
-static void ExtMidiStopSong(void)
+static void ExtMidiStopSong()
 {
 	_midi.song[0] = '\0';
 	DoStop();
 }
 
-static bool ExtMidiIsPlaying(void)
+static bool ExtMidiIsPlaying()
 {
 	if (_midi.pid != -1 && waitpid(_midi.pid, NULL, WNOHANG) == _midi.pid)
 		_midi.pid = -1;
@@ -62,7 +62,7 @@
 	DEBUG(driver, 1, "extmidi: set volume not implemented");
 }
 
-static void DoPlay(void)
+static void DoPlay()
 {
 	_midi.pid = fork();
 	switch (_midi.pid) {
@@ -91,7 +91,7 @@
 	}
 }
 
-static void DoStop(void)
+static void DoStop()
 {
 	if (_midi.pid != -1) kill(_midi.pid, SIGTERM);
 }
--- a/src/music/libtimidity.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/music/libtimidity.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -77,7 +77,7 @@
 	return NULL;
 }
 
-static void LibtimidityMidiStop(void)
+static void LibtimidityMidiStop()
 {
 	if (_midi.status == MIDI_PLAYING) {
 		_midi.status = MIDI_STOPPED;
@@ -107,13 +107,13 @@
 	_midi.status = MIDI_PLAYING;
 }
 
-static void LibtimidityMidiStopSong(void)
+static void LibtimidityMidiStopSong()
 {
 	_midi.status = MIDI_STOPPED;
 	mid_song_free(_midi.song);
 }
 
-static bool LibtimidityMidiIsPlaying(void)
+static bool LibtimidityMidiIsPlaying()
 {
 	if (_midi.status == MIDI_PLAYING) {
 		_midi.song_position = mid_song_get_time(_midi.song);
--- a/src/music/null_m.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/music/null_m.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -4,10 +4,10 @@
 #include "null_m.h"
 
 static const char* NullMidiStart(const char* const* parm) { return NULL; }
-static void NullMidiStop(void) {}
+static void NullMidiStop() {}
 static void NullMidiPlaySong(const char *filename) {}
-static void NullMidiStopSong(void) {}
-static bool NullMidiIsSongPlaying(void) { return true; }
+static void NullMidiStopSong() {}
+static bool NullMidiIsSongPlaying() { return true; }
 static void NullMidiSetVolume(byte vol) {}
 
 const HalMusicDriver _null_music_driver = {
--- a/src/music/os2_m.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/music/os2_m.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -40,7 +40,7 @@
 	MidiSendCommand("play song from 0");
 }
 
-static void OS2MidiStopSong(void)
+static void OS2MidiStopSong()
 {
 	MidiSendCommand("close all");
 }
@@ -50,7 +50,7 @@
 	MidiSendCommand("set song audio volume %d", ((vol/127)*100));
 }
 
-static bool OS2MidiIsSongPlaying(void)
+static bool OS2MidiIsSongPlaying()
 {
 	char buf[16];
 	mciSendString("status song mode", buf, sizeof(buf), NULL, 0);
@@ -62,7 +62,7 @@
 	return 0;
 }
 
-static void OS2MidiStop(void)
+static void OS2MidiStop()
 {
 	MidiSendCommand("close all");
 }
--- a/src/music/qtmidi.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/music/qtmidi.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -173,7 +173,7 @@
  * #_quicktime_started flag to @c true if QuickTime is present in the system
  * and it was initialized properly.
  */
-static void InitQuickTimeIfNeeded(void)
+static void InitQuickTimeIfNeeded()
 {
 	OSStatus dummy;
 
@@ -207,7 +207,7 @@
 #define VOLUME  ((short)((0x00FF & _quicktime_volume) << 1))
 
 
-static void StopSong(void);
+static void StopSong();
 
 
 /**
@@ -230,7 +230,7 @@
  * This function is called at regular intervals from OpenTTD's main loop, so
  * we call @c MoviesTask() from here to let QuickTime do its work.
  */
-static bool SongIsPlaying(void)
+static bool SongIsPlaying()
 {
 	if (!_quicktime_started) return true;
 
@@ -258,7 +258,7 @@
  * Stops playing and frees any used resources before returning. As it
  * deinitilizes QuickTime, the #_quicktime_started flag is set to @c false.
  */
-static void StopDriver(void)
+static void StopDriver()
 {
 	if (!_quicktime_started) return;
 
@@ -312,7 +312,7 @@
 /**
  * Stops playing the current song, if the player is active.
  */
-static void StopSong(void)
+static void StopSong()
 {
 	if (!_quicktime_started) return;
 
--- a/src/music/win32_m.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/music/win32_m.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -23,7 +23,7 @@
 	SetEvent(_midi.wait_obj);
 }
 
-static void Win32MidiStopSong(void)
+static void Win32MidiStopSong()
 {
 	if (_midi.playing) {
 		_midi.stop_song = true;
@@ -32,7 +32,7 @@
 	}
 }
 
-static bool Win32MidiIsSongPlaying(void)
+static bool Win32MidiIsSongPlaying()
 {
 	return _midi.playing;
 }
@@ -62,7 +62,7 @@
 	return MidiSendCommand("play song from 0") == 0;
 }
 
-static void MidiIntStopSong(void)
+static void MidiIntStopSong()
 {
 	MidiSendCommand("close all");
 }
@@ -73,7 +73,7 @@
 	midiOutSetVolume((HMIDIOUT)_midi.devid, v + (v << 16));
 }
 
-static bool MidiIntIsSongPlaying(void)
+static bool MidiIntIsSongPlaying()
 {
 	char buf[16];
 	mciSendStringA("status song mode", buf, sizeof(buf), 0);
@@ -146,7 +146,7 @@
 	return NULL;
 }
 
-static void Win32MidiStop(void)
+static void Win32MidiStop()
 {
 	_midi.terminate = true;
 	SetEvent(_midi.wait_obj);
--- a/src/music_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/music_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -46,7 +46,7 @@
 	msf.custom_2,
 };
 
-static void SkipToPrevSong(void)
+static void SkipToPrevSong()
 {
 	byte *b = _cur_playlist;
 	byte *p = b;
@@ -66,7 +66,7 @@
 	_song_is_active = false;
 }
 
-static void SkipToNextSong(void)
+static void SkipToNextSong()
 {
 	byte* b = _cur_playlist;
 	byte t;
@@ -88,7 +88,7 @@
 	_music_driver->set_volume(new_vol);
 }
 
-static void DoPlaySong(void)
+static void DoPlaySong()
 {
 	char filename[256];
 	snprintf(filename, sizeof(filename), "%s%s",
@@ -96,12 +96,12 @@
 	_music_driver->play_song(filename);
 }
 
-static void DoStopMusic(void)
+static void DoStopMusic()
 {
 	_music_driver->stop_song();
 }
 
-static void SelectSongToPlay(void)
+static void SelectSongToPlay()
 {
 	uint i = 0;
 	uint j = 0;
@@ -138,7 +138,7 @@
 	}
 }
 
-static void StopMusic(void)
+static void StopMusic()
 {
 	_music_wnd_cursong = 0;
 	DoStopMusic();
@@ -146,7 +146,7 @@
 	InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 9);
 }
 
-static void PlayPlaylistSong(void)
+static void PlayPlaylistSong()
 {
 	if (_cur_playlist[0] == 0) {
 		SelectSongToPlay();
@@ -167,13 +167,13 @@
 	InvalidateWindowWidget(WC_MUSIC_WINDOW, 0, 9);
 }
 
-void ResetMusic(void)
+void ResetMusic()
 {
 	_music_wnd_cursong = 1;
 	DoPlaySong();
 }
 
-void MusicLoop(void)
+void MusicLoop()
 {
 	if (!msf.playing && _song_is_active) {
 		StopMusic();
@@ -333,7 +333,7 @@
 	MusicTrackSelectionWndProc
 };
 
-static void ShowMusicTrackSelection(void)
+static void ShowMusicTrackSelection()
 {
 	AllocateWindowDescFront(&_music_track_selection_desc, 0);
 }
@@ -501,7 +501,7 @@
 	MusicWindowWndProc
 };
 
-void ShowMusicWindow(void)
+void ShowMusicWindow()
 {
 	AllocateWindowDescFront(&_music_window_desc, 0);
 }
--- a/src/network/core/core.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/core/core.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -21,7 +21,7 @@
  * Initializes the network core (as that is needed for some platforms
  * @return true if the core has been initialized, false otherwise
  */
-bool NetworkCoreInitialize(void)
+bool NetworkCoreInitialize()
 {
 #if defined(__MORPHOS__) || defined(__AMIGA__)
 	/*
@@ -72,7 +72,7 @@
 /**
  * Shuts down the network core (as that is needed for some platforms
  */
-void NetworkCoreShutdown(void)
+void NetworkCoreShutdown()
 {
 #if defined(__MORPHOS__) || defined(__AMIGA__)
 	/* free allocated resources */
--- a/src/network/core/core.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/core/core.h	Mon Mar 19 12:38:16 2007 +0000
@@ -12,11 +12,11 @@
 #include "os_abstraction.h"
 #include "../../newgrf_config.h"
 
-bool NetworkCoreInitialize(void);
-void NetworkCoreShutdown(void);
+bool NetworkCoreInitialize();
+void NetworkCoreShutdown();
 
 /** Status of a network client; reasons why a client has quit */
-typedef enum {
+enum NetworkRecvStatus {
 	NETWORK_RECV_STATUS_OKAY,             ///< Everything is okay
 	NETWORK_RECV_STATUS_DESYNC,           ///< A desync did occur
 	NETWORK_RECV_STATUS_NEWGRF_MISMATCH,  ///< We did not have the required NewGRFs
@@ -27,7 +27,7 @@
 	NETWORK_RECV_STATUS_SERVER_FULL,      ///< The server is full
 	NETWORK_RECV_STATUS_SERVER_BANNED,    ///< The server has banned us
 	NETWORK_RECV_STATUS_CLOSE_QUERY,      ///< Done quering the server
-} NetworkRecvStatus;
+};
 
 /** Forward declaration due to circular dependencies */
 struct Packet;
--- a/src/network/core/game.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/core/game.h	Mon Mar 19 12:38:16 2007 +0000
@@ -19,7 +19,7 @@
  * some fields will be empty on the client (like game_password) by default
  * and only filled with data a player enters.
  */
-typedef struct NetworkGameInfo {
+struct NetworkGameInfo {
 	byte game_info_version;                         ///< Version of the game info
 	char server_name[NETWORK_NAME_LENGTH];          ///< Server name
 	char hostname[NETWORK_HOSTNAME_LENGTH];         ///< Hostname of the server (if any)
@@ -43,8 +43,8 @@
 	byte map_set;                                   ///< Graphical set
 	bool dedicated;                                 ///< Is this a dedicated server?
 	char rcon_password[NETWORK_PASSWORD_LENGTH];    ///< RCon password for the server. "" if rcon is disabled
-	struct GRFConfig *grfconfig;                    ///< List of NewGRF files used
-} NetworkGameInfo;
+	GRFConfig *grfconfig;                           ///< List of NewGRF files used
+};
 
 #endif /* ENABLE_NETWORK */
 
--- a/src/network/core/packet.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/core/packet.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -63,7 +63,7 @@
 /**
  * Writes the packet size from the raw packet from packet->size
  */
-void Packet::PrepareToSend(void)
+void Packet::PrepareToSend()
 {
 	assert(this->cs == NULL && this->next == NULL);
 
@@ -163,7 +163,7 @@
 /**
  * Reads the packet size from the raw packet and stores it in the packet->size
  */
-void Packet::ReadRawPacketSize(void)
+void Packet::ReadRawPacketSize()
 {
 	assert(this->cs != NULL && this->next == NULL);
 	this->size  = (PacketSize)this->buffer[0];
@@ -173,7 +173,7 @@
 /**
  * Prepares the packet so it can be read
  */
-void Packet::PrepareToRead(void)
+void Packet::PrepareToRead()
 {
 	this->ReadRawPacketSize();
 
@@ -181,12 +181,12 @@
 	this->pos = sizeof(PacketSize);
 }
 
-bool Packet::Recv_bool(void)
+bool Packet::Recv_bool()
 {
 	return this->Recv_uint8() != 0;
 }
 
-uint8 Packet::Recv_uint8(void)
+uint8 Packet::Recv_uint8()
 {
 	uint8 n;
 
@@ -196,7 +196,7 @@
 	return n;
 }
 
-uint16 Packet::Recv_uint16(void)
+uint16 Packet::Recv_uint16()
 {
 	uint16 n;
 
@@ -207,7 +207,7 @@
 	return n;
 }
 
-uint32 Packet::Recv_uint32(void)
+uint32 Packet::Recv_uint32()
 {
 	uint32 n;
 
@@ -220,7 +220,7 @@
 	return n;
 }
 
-uint64 Packet::Recv_uint64(void)
+uint64 Packet::Recv_uint64()
 {
 	uint64 n;
 
--- a/src/network/core/packet.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/core/packet.h	Mon Mar 19 12:38:16 2007 +0000
@@ -43,7 +43,7 @@
 	Packet(PacketType type);
 
 	/* Sending/writing of packets */
-	void PrepareToSend(void);
+	void PrepareToSend();
 
 	void Send_bool  (bool   data);
 	void Send_uint8 (uint8  data);
@@ -53,15 +53,15 @@
 	void Send_string(const char* data);
 
 	/* Reading/receiving of packets */
-	void ReadRawPacketSize(void);
-	void PrepareToRead(void);
+	void ReadRawPacketSize();
+	void PrepareToRead();
 
 	bool   CanReadFromPacket (uint bytes_to_read);
-	bool   Recv_bool  (void);
-	uint8  Recv_uint8 (void);
-	uint16 Recv_uint16(void);
-	uint32 Recv_uint32(void);
-	uint64 Recv_uint64(void);
+	bool   Recv_bool  ();
+	uint8  Recv_uint8 ();
+	uint16 Recv_uint16();
+	uint32 Recv_uint32();
+	uint64 Recv_uint64();
 	void   Recv_string(char* buffer, size_t size);
 };
 
--- a/src/network/core/tcp.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/core/tcp.h	Mon Mar 19 12:38:16 2007 +0000
@@ -58,8 +58,8 @@
 };
 
 /** Packet that wraps a command */
-typedef struct CommandPacket {
-	struct CommandPacket *next; ///< the next command packet (if in queue)
+struct CommandPacket {
+	CommandPacket *next; ///< the next command packet (if in queue)
 	PlayerByte player; ///< player that is executing the command
 	uint32 cmd;        ///< command being executed
 	uint32 p1;         ///< parameter p1
@@ -68,18 +68,19 @@
 	char text[80];     ///< possible text sent for name changes etc
 	uint32 frame;      ///< the frame in which this packet is executed
 	byte callback;     ///< any callback function executed upon successful completion of the command
-} CommandPacket;
+};
 
 /** Status of a client */
-typedef enum {
+enum ClientStatus {
 	STATUS_INACTIVE,   ///< The client is not connected nor active
+	STATUS_AUTHORIZING,///< The client is authorizing
 	STATUS_AUTH,       ///< The client is authorized
 	STATUS_MAP_WAIT,   ///< The client is waiting as someone else is downloading the map
 	STATUS_MAP,        ///< The client is downloading the map
 	STATUS_DONE_MAP,   ///< The client has downloaded the map
 	STATUS_PRE_ACTIVE, ///< The client is catching up the delayed frames
 	STATUS_ACTIVE,     ///< The client is an active player in the game
-} ClientStatus;
+};
 
 /** Base socket handler for all TCP sockets */
 class NetworkTCPSocketHandler : public NetworkSocketHandler {
--- a/src/network/network.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -63,7 +63,7 @@
 static uint16 _network_client_index = NETWORK_SERVER_INDEX + 1;
 
 /* Some externs / forwards */
-extern void StateGameLoop(void);
+extern void StateGameLoop();
 
 // Function that looks up the CI for a given client-index
 NetworkClientInfo *NetworkFindClientInfoFromIndex(uint16 client_index)
@@ -117,7 +117,7 @@
 	}
 }
 
-byte NetworkSpectatorCount(void)
+byte NetworkSpectatorCount()
 {
 	NetworkTCPSocketHandler *cs;
 	byte count = 0;
@@ -301,7 +301,7 @@
 }
 
 /* Count the number of active clients connected */
-static uint NetworkCountPlayers(void)
+static uint NetworkCountPlayers()
 {
 	NetworkTCPSocketHandler *cs;
 	uint count = 0;
@@ -317,7 +317,7 @@
 static bool _min_players_paused = false;
 
 /* Check if the minimum number of players has been reached and pause or unpause the game as appropriate */
-void CheckMinPlayers(void)
+void CheckMinPlayers()
 {
 	if (!_network_dedicated) return;
 
@@ -337,7 +337,7 @@
 }
 
 // Find all IP-aliases for this host
-static void NetworkFindIPs(void)
+static void NetworkFindIPs()
 {
 #if !defined(PSP)
 	int i;
@@ -717,7 +717,7 @@
 }
 
 // For the server, to accept new clients
-static void NetworkAcceptClients(void)
+static void NetworkAcceptClients()
 {
 	struct sockaddr_in sin;
 	NetworkTCPSocketHandler *cs;
@@ -782,7 +782,7 @@
 }
 
 // Set up the listen socket for the server
-static bool NetworkListen(void)
+static bool NetworkListen()
 {
 	SOCKET ls;
 	struct sockaddr_in sin;
@@ -826,7 +826,7 @@
 }
 
 // Close all current connections
-static void NetworkClose(void)
+static void NetworkClose()
 {
 	NetworkTCPSocketHandler *cs;
 
@@ -848,7 +848,7 @@
 }
 
 // Inits the network (cleans sockets and stuff)
-static void NetworkInitialize(void)
+static void NetworkInitialize()
 {
 	NetworkTCPSocketHandler *cs;
 
@@ -921,7 +921,7 @@
 /* Generates the list of manually added hosts from NetworkGameList and
  * dumps them into the array _network_host_list. This array is needed
  * by the function that generates the config file. */
-void NetworkRebuildHostList(void)
+void NetworkRebuildHostList()
 {
 	uint i = 0;
 	const NetworkGameList *item = _network_game_list;
@@ -968,7 +968,7 @@
 	return _networking;
 }
 
-static void NetworkInitGameInfo(void)
+static void NetworkInitGameInfo()
 {
 	NetworkClientInfo *ci;
 
@@ -1013,7 +1013,7 @@
 	ttd_strlcpy(ci->unique_id, _network_unique_id, sizeof(ci->unique_id));
 }
 
-bool NetworkServerStart(void)
+bool NetworkServerStart()
 {
 	if (!_network_available) return false;
 
@@ -1060,7 +1060,7 @@
 
 // The server is rebooting...
 // The only difference with NetworkDisconnect, is the packets that is sent
-void NetworkReboot(void)
+void NetworkReboot()
 {
 	if (_network_server) {
 		NetworkTCPSocketHandler *cs;
@@ -1084,7 +1084,7 @@
 }
 
 // We want to disconnect from the host/clients
-void NetworkDisconnect(void)
+void NetworkDisconnect()
 {
 	if (_network_server) {
 		NetworkTCPSocketHandler *cs;
@@ -1112,7 +1112,7 @@
 }
 
 // Receives something from the network
-static bool NetworkReceive(void)
+static bool NetworkReceive()
 {
 	NetworkTCPSocketHandler *cs;
 	int n;
@@ -1167,7 +1167,7 @@
 }
 
 // This sends all buffered commands (if possible)
-static void NetworkSend(void)
+static void NetworkSend()
 {
 	NetworkTCPSocketHandler *cs;
 	FOR_ALL_CLIENTS(cs) {
@@ -1183,7 +1183,7 @@
 }
 
 // Handle the local-command-queue
-static void NetworkHandleLocalQueue(void)
+static void NetworkHandleLocalQueue()
 {
 	CommandPacket *cp, **cp_prev;
 
@@ -1218,7 +1218,7 @@
 
 }
 
-static bool NetworkDoClientLoop(void)
+static bool NetworkDoClientLoop()
 {
 	_frame_counter++;
 
@@ -1259,7 +1259,7 @@
 }
 
 // We have to do some UDP checking
-void NetworkUDPGameLoop(void)
+void NetworkUDPGameLoop()
 {
 	if (_network_udp_server) {
 		_udp_server_socket->ReceivePackets();
@@ -1273,7 +1273,7 @@
 
 // The main loop called from ttd.c
 //  Here we also have to do StateGameLoop if needed!
-void NetworkGameLoop(void)
+void NetworkGameLoop()
 {
 	if (!_networking) return;
 
@@ -1318,7 +1318,7 @@
 	NetworkSend();
 }
 
-static void NetworkGenerateUniqueId(void)
+static void NetworkGenerateUniqueId()
 {
 	md5_state_t state;
 	md5_byte_t digest[16];
@@ -1372,7 +1372,7 @@
 }
 
 /** This tries to launch the network for a given OS */
-void NetworkStartUp(void)
+void NetworkStartUp()
 {
 	DEBUG(net, 3, "[core] starting network...");
 
@@ -1409,7 +1409,7 @@
 }
 
 /** This shuts the network down */
-void NetworkShutDown(void)
+void NetworkShutDown()
 {
 	NetworkDisconnect();
 	NetworkUDPShutdown();
--- a/src/network/network.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network.h	Mon Mar 19 12:38:16 2007 +0000
@@ -40,7 +40,7 @@
 #define NETWORK_VEHICLE_TYPES 5
 #define NETWORK_STATION_TYPES 5
 
-typedef struct NetworkPlayerInfo {
+struct NetworkPlayerInfo {
 	char company_name[NETWORK_NAME_LENGTH];         // Company name
 	char password[NETWORK_PASSWORD_LENGTH];         // The password for the player
 	Year inaugurated_year;                          // What year the company started in
@@ -53,9 +53,9 @@
 	uint16 num_station[NETWORK_STATION_TYPES];      // How many stations are there of this type?
 	char players[NETWORK_PLAYERS_LENGTH];           // The players that control this company (Name1, name2, ..)
 	uint16 months_empty;                            // How many months the company is empty
-} NetworkPlayerInfo;
+};
 
-typedef struct NetworkClientInfo {
+struct NetworkClientInfo {
 	uint16 client_index;                            // Index of the client (same as ClientState->index)
 	char client_name[NETWORK_CLIENT_NAME_LENGTH];   // Name of the client
 	byte client_lang;                               // The language of the client
@@ -63,9 +63,9 @@
 	uint32 client_ip;                               // IP-address of the client (so he can be banned)
 	Date join_date;                                 // Gamedate the player has joined
 	char unique_id[NETWORK_NAME_LENGTH];            // Every play sends an unique id so we can indentify him
-} NetworkClientInfo;
+};
 
-typedef enum {
+enum NetworkJoinStatus {
 	NETWORK_JOIN_STATUS_CONNECTING,
 	NETWORK_JOIN_STATUS_AUTHORIZING,
 	NETWORK_JOIN_STATUS_WAITING,
@@ -74,15 +74,15 @@
 	NETWORK_JOIN_STATUS_REGISTERING,
 
 	NETWORK_JOIN_STATUS_GETTING_COMPANY_INFO,
-} NetworkJoinStatus;
+};
 
 // language ids for server_lang and client_lang
-typedef enum {
+enum NetworkLanguage {
 	NETLANG_ANY     = 0,
 	NETLANG_ENGLISH = 1,
 	NETLANG_GERMAN  = 2,
 	NETLANG_FRENCH  = 3,
-} NetworkLanguage;
+};
 
 VARDEF NetworkGameInfo _network_game_info;
 VARDEF NetworkPlayerInfo _network_player_info[MAX_PLAYERS];
@@ -153,7 +153,7 @@
 
 void NetworkTCPQueryServer(const char* host, unsigned short port);
 
-byte NetworkSpectatorCount(void);
+byte NetworkSpectatorCount();
 
 VARDEF char *_network_host_list[10];
 VARDEF char *_network_ban_list[25];
@@ -161,22 +161,22 @@
 void ParseConnectionString(const char **player, const char **port, char *connection_string);
 void NetworkUpdateClientInfo(uint16 client_index);
 void NetworkAddServer(const char *b);
-void NetworkRebuildHostList(void);
+void NetworkRebuildHostList();
 bool NetworkChangeCompanyPassword(byte argc, char *argv[]);
-void NetworkPopulateCompanyInfo(void);
+void NetworkPopulateCompanyInfo();
 void UpdateNetworkGameWindow(bool unselect);
-void CheckMinPlayers(void);
+void CheckMinPlayers();
 void NetworkStartDebugLog(const char *hostname, uint16 port);
 
-void NetworkStartUp(void);
+void NetworkStartUp();
 void NetworkUDPCloseAll();
-void NetworkShutDown(void);
-void NetworkGameLoop(void);
-void NetworkUDPGameLoop(void);
-bool NetworkServerStart(void);
+void NetworkShutDown();
+void NetworkGameLoop();
+void NetworkUDPGameLoop();
+bool NetworkServerStart();
 bool NetworkClientConnectGame(const char *host, uint16 port);
-void NetworkReboot(void);
-void NetworkDisconnect(void);
+void NetworkReboot();
+void NetworkDisconnect();
 
 bool IsNetworkCompatibleVersion(const char *version);
 
@@ -188,8 +188,8 @@
 #else /* ENABLE_NETWORK */
 /* Network function stubs when networking is disabled */
 
-static inline void NetworkStartUp(void) {}
-static inline void NetworkShutDown(void) {}
+static inline void NetworkStartUp() {}
+static inline void NetworkShutDown() {}
 
 #define _networking 0
 #define _network_server 0
--- a/src/network/network_client.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network_client.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -839,7 +839,7 @@
 assert_compile(lengthof(_network_client_packet) == PACKET_END);
 
 // Is called after a client is connected to the server
-void NetworkClient_Connected(void)
+void NetworkClient_Connected()
 {
 	// Set the frame-counter to 0 so nothing happens till we are ready
 	_frame_counter = 0;
--- a/src/network/network_client.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network_client.h	Mon Mar 19 12:38:16 2007 +0000
@@ -18,7 +18,7 @@
 DEF_CLIENT_SEND_COMMAND_PARAM(PACKET_CLIENT_RCON)(const char *pass, const char *command);
 
 NetworkRecvStatus NetworkClient_ReadPackets(NetworkTCPSocketHandler *cs);
-void NetworkClient_Connected(void);
+void NetworkClient_Connected();
 
 #endif /* ENABLE_NETWORK */
 
--- a/src/network/network_data.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network_data.h	Mon Mar 19 12:38:16 2007 +0000
@@ -20,13 +20,13 @@
 #define NETWORK_SERVER_INDEX 1
 #define NETWORK_EMPTY_INDEX 0
 
-typedef enum {
+enum MapPacket {
 	MAP_PACKET_START,
 	MAP_PACKET_NORMAL,
 	MAP_PACKET_END,
-} MapPacket;
+};
 
-typedef enum {
+enum NetworkErrorCode {
 	NETWORK_ERROR_GENERAL, // Try to use thisone like never
 
 	// Signals from clients
@@ -46,10 +46,10 @@
 	NETWORK_ERROR_KICKED,
 	NETWORK_ERROR_CHEATER,
 	NETWORK_ERROR_FULL,
-} NetworkErrorCode;
+};
 
 // Actions that can be used for NetworkTextMessage
-typedef enum {
+enum NetworkAction {
 	NETWORK_ACTION_JOIN,
 	NETWORK_ACTION_LEAVE,
 	NETWORK_ACTION_SERVER_MESSAGE,
@@ -58,18 +58,18 @@
 	NETWORK_ACTION_CHAT_CLIENT,
 	NETWORK_ACTION_GIVE_MONEY,
 	NETWORK_ACTION_NAME_CHANGE,
-} NetworkAction;
+};
 
-typedef enum {
+enum NetworkPasswordType {
 	NETWORK_GAME_PASSWORD,
 	NETWORK_COMPANY_PASSWORD,
-} NetworkPasswordType;
+};
 
-typedef enum {
+enum DestType {
 	DESTTYPE_BROADCAST, ///< Send message/notice to all players (All)
 	DESTTYPE_TEAM,    ///< Send message/notice to everyone playing the same company (Team)
 	DESTTYPE_CLIENT,    ///< Send message/notice to only a certain player (Private)
-} DestType;
+};
 
 // following externs are instantiated at network.cpp
 extern CommandPacket *_local_command_queue;
@@ -84,7 +84,7 @@
 
 // Macros to make life a bit more easier
 #define DEF_CLIENT_RECEIVE_COMMAND(type) NetworkRecvStatus NetworkPacketReceive_ ## type ## _command(Packet *p)
-#define DEF_CLIENT_SEND_COMMAND(type) void NetworkPacketSend_ ## type ## _command(void)
+#define DEF_CLIENT_SEND_COMMAND(type) void NetworkPacketSend_ ## type ## _command()
 #define DEF_CLIENT_SEND_COMMAND_PARAM(type) void NetworkPacketSend_ ## type ## _command
 #define DEF_SERVER_RECEIVE_COMMAND(type) void NetworkPacketReceive_ ## type ## _command(NetworkTCPSocketHandler *cs, Packet *p)
 #define DEF_SERVER_SEND_COMMAND(type) void NetworkPacketSend_ ## type ## _command(NetworkTCPSocketHandler *cs)
@@ -104,7 +104,7 @@
 void CDECL NetworkTextMessage(NetworkAction action, uint16 color, bool self_send, const char *name, const char *str, ...);
 void NetworkGetClientName(char *clientname, size_t size, const NetworkTCPSocketHandler *cs);
 uint NetworkCalculateLag(const NetworkTCPSocketHandler *cs);
-byte NetworkGetCurrentLanguageIndex(void);
+byte NetworkGetCurrentLanguageIndex();
 NetworkClientInfo *NetworkFindClientInfoFromIndex(uint16 client_index);
 NetworkClientInfo *NetworkFindClientInfoFromIP(const char *ip);
 NetworkTCPSocketHandler *NetworkFindClientStateFromIndex(uint16 client_index);
--- a/src/network/network_gamelist.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network_gamelist.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -89,7 +89,7 @@
 };
 
 /** Requeries the (game) servers we have not gotten a reply from */
-void NetworkGameListRequery(void)
+void NetworkGameListRequery()
 {
 	static uint8 requery_cnt = 0;
 
--- a/src/network/network_gamelist.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network_gamelist.h	Mon Mar 19 12:38:16 2007 +0000
@@ -19,6 +19,6 @@
 
 NetworkGameList *NetworkGameListAddItem(uint32 ip, uint16 port);
 void NetworkGameListRemoveItem(NetworkGameList *remove);
-void NetworkGameListRequery(void);
+void NetworkGameListRequery();
 
 #endif /* NETWORK_GAMELIST_H */
--- a/src/network/network_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -32,20 +32,20 @@
 #define BGC 5
 #define BTC 15
 
-typedef struct network_d {
+struct network_d {
 	PlayerID company;        // select company in network lobby
 	byte field;              // select text-field in start-server and game-listing
 	NetworkGameList *server; // selected server in lobby and game-listing
 	FiosItem *map;           // selected map in start-server
-} network_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(network_d));
 
-typedef struct network_ql_d {
+struct network_ql_d {
 	network_d n;                 // see above; general stuff
 	querystr_d q;                // text-input in start-server and game-listing
 	NetworkGameList **sort_list; // list of games (sorted)
 	list_d l;                    // accompanying list-administration
-} network_ql_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(network_ql_d));
 
 /* Global to remember sorting after window has been closed */
@@ -54,7 +54,7 @@
 static char _edit_str_buf[150];
 static bool _chat_tab_completion_active;
 
-static void ShowNetworkStartServerWindow(void);
+static void ShowNetworkStartServerWindow();
 static void ShowNetworkLobbyWindow(NetworkGameList *ngl);
 extern void SwitchMode(int new_mode);
 
@@ -551,7 +551,7 @@
 	NetworkGameWindowWndProc,
 };
 
-void ShowNetworkGameWindow(void)
+void ShowNetworkGameWindow()
 {
 	static bool first = true;
 	Window *w;
@@ -778,7 +778,7 @@
 	NetworkStartServerWindowWndProc,
 };
 
-static void ShowNetworkStartServerWindow(void)
+static void ShowNetworkStartServerWindow()
 {
 	Window *w;
 	DeleteWindowById(WC_NETWORK_WINDOW, 0);
@@ -1151,7 +1151,7 @@
 }
 
 // Finds the amount of actions in the popup and set the height correct
-static uint ClientListPopupHeigth(void) {
+static uint ClientListPopupHeigth() {
 	int i, num = 0;
 
 	// Find the amount of actions
@@ -1368,7 +1368,7 @@
 	}
 }
 
-void ShowClientList(void)
+void ShowClientList()
 {
 	AllocateWindowDescFront(&_client_list_desc, 0);
 }
@@ -1460,7 +1460,7 @@
 	NetworkJoinStatusWindowWndProc,
 };
 
-void ShowJoinStatusWindow(void)
+void ShowJoinStatusWindow()
 {
 	Window *w;
 	DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
--- a/src/network/network_gui.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network_gui.h	Mon Mar 19 12:38:16 2007 +0000
@@ -10,16 +10,16 @@
 void ShowNetworkNeedPassword(NetworkPasswordType npt);
 void ShowNetworkGiveMoneyWindow(PlayerID player); // PlayerID
 void ShowNetworkChatQueryWindow(DestType type, byte dest);
-void ShowJoinStatusWindow(void);
-void ShowNetworkGameWindow(void);
-void ShowClientList(void);
+void ShowJoinStatusWindow();
+void ShowNetworkGameWindow();
+void ShowClientList();
 
 #else /* ENABLE_NETWORK */
 /* Network function stubs when networking is disabled */
 
 static inline void ShowNetworkChatQueryWindow(byte desttype, byte dest) {}
-static inline void ShowClientList(void) {}
-static inline void ShowNetworkGameWindow(void) {}
+static inline void ShowClientList() {}
+static inline void ShowNetworkGameWindow() {}
 
 #endif /* ENABLE_NETWORK */
 
--- a/src/network/network_server.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network_server.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -214,6 +214,11 @@
 	//    uint8:  Type of password
 	//
 
+	/* Invalid packet when status is AUTH or higher */
+	if (cs->status >= STATUS_AUTH) return;
+
+	cs->status = STATUS_AUTHORIZING;
+
 	Packet *p = NetworkSend_Init(PACKET_SERVER_NEED_PASSWORD);
 	p->Send_uint8(type);
 	cs->Send_Packet(p);
@@ -692,7 +697,7 @@
 	type = (NetworkPasswordType)p->Recv_uint8();
 	p->Recv_string(password, sizeof(password));
 
-	if (cs->status == STATUS_INACTIVE && type == NETWORK_GAME_PASSWORD) {
+	if (cs->status == STATUS_AUTHORIZING && type == NETWORK_GAME_PASSWORD) {
 		// Check game-password
 		if (strcmp(password, _network_game_info.server_password) != 0) {
 			// Password is invalid
@@ -710,7 +715,7 @@
 		// Valid password, allow user
 		SEND_COMMAND(PACKET_SERVER_WELCOME)(cs);
 		return;
-	} else if (cs->status == STATUS_INACTIVE && type == NETWORK_COMPANY_PASSWORD) {
+	} else if (cs->status == STATUS_AUTHORIZING && type == NETWORK_COMPANY_PASSWORD) {
 		ci = DEREF_CLIENT_INFO(cs);
 
 		if (strcmp(password, _network_player_info[ci->client_playas].password) != 0) {
@@ -1223,7 +1228,7 @@
 assert_compile(lengthof(_network_server_packet) == PACKET_END);
 
 // This update the company_info-stuff
-void NetworkPopulateCompanyInfo(void)
+void NetworkPopulateCompanyInfo()
 {
 	char password[NETWORK_PASSWORD_LENGTH];
 	const Player *p;
@@ -1276,11 +1281,11 @@
 		if (!IsValidPlayer(v->owner)) continue;
 
 		switch (v->type) {
-			case VEH_Train:
+			case VEH_TRAIN:
 				if (IsFrontEngine(v)) _network_player_info[v->owner].num_vehicle[0]++;
 				break;
 
-			case VEH_Road:
+			case VEH_ROAD:
 				if (v->cargo_type != CT_PASSENGERS) {
 					_network_player_info[v->owner].num_vehicle[1]++;
 				} else {
@@ -1288,16 +1293,16 @@
 				}
 				break;
 
-			case VEH_Aircraft:
+			case VEH_AIRCRAFT:
 				if (IsNormalAircraft(v)) _network_player_info[v->owner].num_vehicle[3]++;
 				break;
 
-			case VEH_Ship:
+			case VEH_SHIP:
 				_network_player_info[v->owner].num_vehicle[4]++;
 				break;
 
-			case VEH_Special:
-			case VEH_Disaster:
+			case VEH_SPECIAL:
+			case VEH_DISASTER:
 				break;
 		}
 	}
@@ -1350,7 +1355,7 @@
 }
 
 /* Check if we want to restart the map */
-static void NetworkCheckRestartMap(void)
+static void NetworkCheckRestartMap()
 {
 	if (_network_restart_game_year != 0 && _cur_year >= _network_restart_game_year) {
 		DEBUG(net, 0, "Auto-restarting map. Year %d reached", _cur_year);
@@ -1364,7 +1369,7 @@
       1) If a company is not protected, it is closed after 1 year (for example)
       2) If a company is protected, protection is disabled after 3 years (for example)
            (and item 1. happens a year later) */
-static void NetworkAutoCleanCompanies(void)
+static void NetworkAutoCleanCompanies()
 {
 	NetworkTCPSocketHandler *cs;
 	const NetworkClientInfo *ci;
@@ -1533,6 +1538,12 @@
 				IConsolePrintF(_icolour_err,"Client #%d is dropped because it took longer than %d ticks for him to join", cs->index, _network_max_join_time);
 				NetworkCloseClient(cs);
 			}
+		} else if (cs->status == STATUS_INACTIVE) {
+			int lag = NetworkCalculateLag(cs);
+			if (lag > 4 * DAY_TICKS) {
+				IConsolePrintF(_icolour_err,"Client #%d is dropped because it took longer than %d ticks to start the joining process", cs->index, 4 * DAY_TICKS);
+				NetworkCloseClient(cs);
+			}
 		}
 
 		if (cs->status >= STATUS_PRE_ACTIVE) {
@@ -1553,12 +1564,12 @@
 	NetworkUDPAdvertise();
 }
 
-void NetworkServerYearlyLoop(void)
+void NetworkServerYearlyLoop()
 {
 	NetworkCheckRestartMap();
 }
 
-void NetworkServerMonthlyLoop(void)
+void NetworkServerMonthlyLoop()
 {
 	NetworkAutoCleanCompanies();
 }
--- a/src/network/network_server.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network_server.h	Mon Mar 19 12:38:16 2007 +0000
@@ -17,8 +17,8 @@
 
 bool NetworkServer_ReadPackets(NetworkTCPSocketHandler *cs);
 void NetworkServer_Tick(bool send_frame);
-void NetworkServerMonthlyLoop(void);
-void NetworkServerYearlyLoop(void);
+void NetworkServerMonthlyLoop();
+void NetworkServerYearlyLoop();
 
 static inline const char* GetPlayerIP(const NetworkClientInfo* ci)
 {
@@ -31,8 +31,8 @@
 #else /* ENABLE_NETWORK */
 /* Network function stubs when networking is disabled */
 
-static inline void NetworkServerMonthlyLoop(void) {}
-static inline void NetworkServerYearlyLoop(void) {}
+static inline void NetworkServerMonthlyLoop() {}
+static inline void NetworkServerYearlyLoop() {}
 
 #endif /* ENABLE_NETWORK */
 
--- a/src/network/network_udp.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network_udp.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -288,8 +288,8 @@
 		struct sockaddr_in out_addr;
 
 		for (c = item->info.grfconfig; c != NULL; c = c->next) {
-			if (HASBIT(c->flags, GCF_NOT_FOUND)) item->info.compatible = false;
-			if (!HASBIT(c->flags, GCF_NOT_FOUND) || strcmp(c->name, UNKNOWN_GRF_NAME_PLACEHOLDER) != 0) continue;
+			if (c->status == GCS_NOT_FOUND) item->info.compatible = false;
+			if (c->status == GCS_NOT_FOUND || strcmp(c->name, UNKNOWN_GRF_NAME_PLACEHOLDER) != 0) continue;
 			in_request[in_request_count] = c;
 			in_request_count++;
 		}
@@ -392,7 +392,7 @@
 		 * already resolved name for this GRF (another server has sent the
 		 * name of the GRF already */
 		config->name     = FindUnknownGRFName(config->grfid, config->md5sum, true);
-		SETBIT(config->flags, GCF_NOT_FOUND);
+		config->status   = GCS_NOT_FOUND;
 	} else {
 		config->filename = f->filename;
 		config->name     = f->name;
@@ -402,7 +402,7 @@
 }
 
 // Close UDP connection
-void NetworkUDPCloseAll(void)
+void NetworkUDPCloseAll()
 {
 	DEBUG(net, 1, "[udp] closed listeners");
 
@@ -435,7 +435,7 @@
 
 
 // Request the the server-list from the master server
-void NetworkUDPQueryMasterServer(void)
+void NetworkUDPQueryMasterServer()
 {
 	struct sockaddr_in out_addr;
 
@@ -458,7 +458,7 @@
 }
 
 // Find all servers
-void NetworkUDPSearchGame(void)
+void NetworkUDPSearchGame()
 {
 	// We are still searching..
 	if (_network_udp_broadcast > 0) return;
@@ -504,7 +504,7 @@
 }
 
 /* Remove our advertise from the master-server */
-void NetworkUDPRemoveAdvertise(void)
+void NetworkUDPRemoveAdvertise()
 {
 	struct sockaddr_in out_addr;
 
@@ -533,7 +533,7 @@
 
 /* Register us to the master server
      This function checks if it needs to send an advertise */
-void NetworkUDPAdvertise(void)
+void NetworkUDPAdvertise()
 {
 	struct sockaddr_in out_addr;
 
@@ -580,7 +580,7 @@
 	_udp_master_socket->SendPacket(&p, &out_addr);
 }
 
-void NetworkUDPInitialize(void)
+void NetworkUDPInitialize()
 {
 	_udp_client_socket = new ClientNetworkUDPSocketHandler();
 	_udp_server_socket = new ServerNetworkUDPSocketHandler();
@@ -590,7 +590,7 @@
 	_network_udp_broadcast = 0;
 }
 
-void NetworkUDPShutdown(void)
+void NetworkUDPShutdown()
 {
 	NetworkUDPCloseAll();
 
--- a/src/network/network_udp.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/network/network_udp.h	Mon Mar 19 12:38:16 2007 +0000
@@ -5,13 +5,13 @@
 
 #ifdef ENABLE_NETWORK
 
-void NetworkUDPInitialize(void);
-void NetworkUDPSearchGame(void);
-void NetworkUDPQueryMasterServer(void);
+void NetworkUDPInitialize();
+void NetworkUDPSearchGame();
+void NetworkUDPQueryMasterServer();
 void NetworkUDPQueryServer(const char* host, unsigned short port, bool manually = false);
-void NetworkUDPAdvertise(void);
-void NetworkUDPRemoveAdvertise(void);
-void NetworkUDPShutdown(void);
+void NetworkUDPAdvertise();
+void NetworkUDPRemoveAdvertise();
+void NetworkUDPShutdown();
 
 #endif /* ENABLE_NETWORK */
 
--- a/src/newgrf.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -73,15 +73,15 @@
 static CargoLabel _default_cargo_list[_default_cargo_max];
 
 
-typedef enum GrfDataType {
+enum GrfDataType {
 	GDT_SOUND,
-} GrfDataType;
+};
 
 static byte _grf_data_blocks;
 static GrfDataType _grf_data_type;
 
 
-typedef enum grfspec_feature {
+enum grfspec_feature {
 	GSF_TRAIN,
 	GSF_ROAD,
 	GSF_SHIP,
@@ -95,19 +95,19 @@
 	GSF_INDUSTRIES,
 	GSF_CARGOS,
 	GSF_SOUNDFX,
-} grfspec_feature;
+};
 
 
 typedef void (*SpecialSpriteHandler)(byte *buf, int len);
 
-static const int _vehcounts[4] = {
+static const uint _vehcounts[4] = {
 	/* GSF_TRAIN */    NUM_TRAIN_ENGINES,
 	/* GSF_ROAD */     NUM_ROAD_ENGINES,
 	/* GSF_SHIP */     NUM_SHIP_ENGINES,
 	/* GSF_AIRCRAFT */ NUM_AIRCRAFT_ENGINES
 };
 
-static const int _vehshifts[4] = {
+static const uint _vehshifts[4] = {
 	/* GSF_TRAIN */    0,
 	/* GSF_ROAD */     ROAD_ENGINES_INDEX,
 	/* GSF_SHIP */     SHIP_ENGINES_INDEX,
@@ -365,7 +365,7 @@
 			FOR_EACH_OBJECT {
 				uint8 ctype = grf_load_byte(&buf);
 
-				if (ctype < NUM_CARGO) {
+				if (ctype < NUM_CARGO && HASBIT(_cargo_mask, ctype)) {
 					rvi[i].cargo_type = ctype;
 				} else {
 					rvi[i].cargo_type = CT_INVALID;
@@ -557,7 +557,7 @@
 			FOR_EACH_OBJECT {
 				uint8 cargo = grf_load_byte(&buf);
 
-				if (cargo < NUM_CARGO) {
+				if (cargo < NUM_CARGO && HASBIT(_cargo_mask, cargo)) {
 					rvi[i].cargo_type = cargo;
 				} else {
 					rvi[i].cargo_type = CT_INVALID;
@@ -671,7 +671,7 @@
 			FOR_EACH_OBJECT {
 				uint8 cargo = grf_load_byte(&buf);
 
-				if (cargo < NUM_CARGO) {
+				if (cargo < NUM_CARGO && HASBIT(_cargo_mask, cargo)) {
 					svi[i].cargo_type = cargo;
 				} else {
 					svi[i].cargo_type = CT_INVALID;
@@ -881,13 +881,11 @@
 	switch (prop) {
 		case 0x08: /* Class ID */
 			FOR_EACH_OBJECT {
-				uint32 classid;
-
 				/* Property 0x08 is special; it is where the station is allocated */
 				if (statspec[i] == NULL) statspec[i] = CallocT<StationSpec>(1);
 
 				/* Swap classid because we read it in BE meaning WAYP or DFLT */
-				classid = grf_load_dword(&buf);
+				uint32 classid = grf_load_dword(&buf);
 				statspec[i]->sclass = AllocateStationClass(BSWAP32(classid));
 			}
 			break;
@@ -895,13 +893,12 @@
 		case 0x09: /* Define sprite layout */
 			FOR_EACH_OBJECT {
 				StationSpec *statspec = _cur_grffile->stations[stid + i];
-				uint t;
 
 				statspec->tiles = grf_load_extended(&buf);
 				statspec->renderdata = CallocT<DrawTileSprites>(statspec->tiles);
 				statspec->copied_renderdata = false;
 
-				for (t = 0; t < statspec->tiles; t++) {
+				for (uint t = 0; t < statspec->tiles; t++) {
 					DrawTileSprites *dts = &statspec->renderdata[t];
 					uint seq_count = 0;
 
@@ -1127,11 +1124,9 @@
 				}
 
 				for (; numtables-- != 0; tableid++) {
-					byte sprite;
-
 					if (tableid >= 7) { // skip invalid data
 						grfmsg(1, "BridgeChangeInfo: Table %d >= 7, skipping", tableid);
-						for (sprite = 0; sprite < 32; sprite++) grf_load_dword(&buf);
+						for (byte sprite = 0; sprite < 32; sprite++) grf_load_dword(&buf);
 						continue;
 					}
 
@@ -1139,7 +1134,7 @@
 						bridge->sprite_table[tableid] = MallocT<PalSpriteID>(32);
 					}
 
-					for (sprite = 0; sprite < 32; sprite++) {
+					for (byte sprite = 0; sprite < 32; sprite++) {
 						SpriteID image = grf_load_word(&buf);
 						SpriteID pal   = grf_load_word(&buf);
 
@@ -1357,7 +1352,7 @@
 static void FeatureChangeInfo(byte *buf, int len)
 {
 	byte *bufend = buf + len;
-	int i;
+	uint i;
 
 	/* <00> <feature> <num-props> <num-info> <id> (<property <new-info>)...
 	 *
@@ -1388,10 +1383,6 @@
 		/* GSF_SOUNDFX */      SoundEffectChangeInfo,
 	};
 
-	uint8 feature;
-	uint8 numprops;
-	uint8 numinfo;
-	byte engine;
 	EngineInfo *ei = NULL;
 
 	if (len == 1) {
@@ -1401,10 +1392,10 @@
 
 	if (!check_length(len, 6, "FeatureChangeInfo")) return;
 	buf++;
-	feature  = grf_load_byte(&buf);
-	numprops = grf_load_byte(&buf);
-	numinfo  = grf_load_byte(&buf);
-	engine   = grf_load_byte(&buf);
+	uint8 feature  = grf_load_byte(&buf);
+	uint8 numprops = grf_load_byte(&buf);
+	uint numinfo  = grf_load_byte(&buf);
+	uint engine   = grf_load_byte(&buf);
 
 	grfmsg(6, "FeatureChangeInfo: feature %d, %d properties, to apply to %d+%d",
 	               feature, numprops, engine, numinfo);
@@ -1461,15 +1452,17 @@
 						break;
 
 					default:
-						if (handler[feature](engine, numinfo, prop, &buf, bufend - buf))
+						if (handler[feature](engine, numinfo, prop, &buf, bufend - buf)) {
 							ignoring = true;
+						}
 						break;
 				}
 				break;
 
 			default:
-				if (handler[feature](engine, numinfo, prop, &buf, bufend - buf))
+				if (handler[feature](engine, numinfo, prop, &buf, bufend - buf)) {
 					ignoring = true;
+				}
 				break;
 		}
 
@@ -1480,11 +1473,6 @@
 /* Action 0x00 (GLS_SAFETYSCAN) */
 static void SafeChangeInfo(byte *buf, int len)
 {
-	uint8 feature;
-	uint8 numprops;
-	uint8 numinfo;
-	uint8 index;
-
 	if (len == 1) {
 		grfmsg(8, "Silently ignoring one-byte special sprite 0x00");
 		return;
@@ -1492,10 +1480,10 @@
 
 	if (!check_length(len, 6, "SafeChangeInfo")) return;
 	buf++;
-	feature  = grf_load_byte(&buf);
-	numprops = grf_load_byte(&buf);
-	numinfo  = grf_load_byte(&buf);
-	index    = grf_load_byte(&buf);
+	uint8 feature  = grf_load_byte(&buf);
+	uint8 numprops = grf_load_byte(&buf);
+	grf_load_byte(&buf);
+	grf_load_byte(&buf);
 
 	if (feature == GSF_BRIDGE && numprops == 1) {
 		uint8 prop = grf_load_byte(&buf);
@@ -1514,10 +1502,6 @@
 static void InitChangeInfo(byte *buf, int len)
 {
 	byte *bufend = buf + len;
-	uint8 feature;
-	uint8 numprops;
-	uint8 numinfo;
-	uint8 index;
 
 	if (len == 1) {
 		grfmsg(8, "Silently ignoring one-byte special sprite 0x00");
@@ -1526,10 +1510,10 @@
 
 	if (!check_length(len, 6, "InitChangeInfo")) return;
 	buf++;
-	feature  = grf_load_byte(&buf);
-	numprops = grf_load_byte(&buf);
-	numinfo  = grf_load_byte(&buf);
-	index    = grf_load_byte(&buf);
+	uint8 feature  = grf_load_byte(&buf);
+	uint8 numprops = grf_load_byte(&buf);
+	uint8 numinfo  = grf_load_byte(&buf);
+	uint8 index    = grf_load_byte(&buf);
 
 	while (numprops-- && buf < bufend) {
 		uint8 prop = grf_load_byte(&buf);
@@ -1613,19 +1597,13 @@
 	 *                         vehicle directions in each sprite set
 	 *                         Set num-dirs=8, unless your sprites are symmetric.
 	 *                         In that case, use num-dirs=4.
-	 *                 For stations, must be 12 (hex) for the eighteen
-	 *                         different sprites that make up a station */
-	/* TODO: No stations support. */
-	uint8 feature;
-	uint num_sets;
-	uint num_ents;
-	uint i;
+	 */
 
 	if (!check_length(len, 4, "NewSpriteSet")) return;
 	buf++;
-	feature  = grf_load_byte(&buf);
-	num_sets = grf_load_byte(&buf);
-	num_ents = grf_load_extended(&buf);
+	uint8 feature   = grf_load_byte(&buf);
+	uint8 num_sets  = grf_load_byte(&buf);
+	uint16 num_ents = grf_load_extended(&buf);
 
 	_cur_grffile->spriteset_start = _cur_spriteid;
 	_cur_grffile->spriteset_feature = feature;
@@ -1636,7 +1614,7 @@
 		_cur_spriteid, feature, num_sets, num_ents, num_sets * num_ents
 	);
 
-	for (i = 0; i < num_sets * num_ents; i++) {
+	for (uint16 i = 0; i < num_sets * num_ents; i++) {
 		LoadNextSprite(_cur_spriteid++, _file_index);
 		_nfo_line++;
 	}
@@ -1699,18 +1677,15 @@
 	 *                 otherwise it specifies a number of entries, the exact
 	 *                 meaning depends on the feature
 	 * V feature-specific-data (huge mess, don't even look it up --pasky) */
-	uint8 feature;
-	uint8 setid;
-	uint8 type;
 	SpriteGroup *group = NULL;
 	byte *bufend = buf + len;
 
 	if (!check_length(len, 5, "NewSpriteGroup")) return;
 	buf++;
 
-	feature = grf_load_byte(&buf);
-	setid   = grf_load_byte(&buf);
-	type    = grf_load_byte(&buf);
+	uint8 feature = grf_load_byte(&buf);
+	uint8 setid   = grf_load_byte(&buf);
+	uint8 type    = grf_load_byte(&buf);
 
 	if (setid >= _cur_grffile->spritegroups_count) {
 		// Allocate memory for new sprite group references.
@@ -1731,7 +1706,6 @@
 		{
 			byte varadjust;
 			byte varsize;
-			uint i;
 
 			/* Check we can load the var size parameter */
 			if (!check_length(bufend - buf, 1, "NewSpriteGroup (Deterministic) (1)")) return;
@@ -1794,7 +1768,7 @@
 
 			if (!check_length(bufend - buf, 2 + (2 + 2 * varsize) * group->g.determ.num_ranges, "NewSpriteGroup (Deterministic)")) return;
 
-			for (i = 0; i < group->g.determ.num_ranges; i++) {
+			for (uint i = 0; i < group->g.determ.num_ranges; i++) {
 				group->g.determ.ranges[i].group = GetGroupFromGroupID(setid, type, grf_load_word(&buf));
 				group->g.determ.ranges[i].low   = grf_load_var(varsize, &buf);
 				group->g.determ.ranges[i].high  = grf_load_var(varsize, &buf);
@@ -1808,16 +1782,13 @@
 		case 0x80: // Self scope
 		case 0x83: // Parent scope
 		{
-			byte triggers;
-			uint i;
-
 			if (!check_length(bufend - buf, 7, "NewSpriteGroup (Randomized) (1)")) return;
 
 			group = AllocateSpriteGroup();
 			group->type = SGT_RANDOMIZED;
 			group->g.random.var_scope = HASBIT(type, 1) ? VSG_SCOPE_PARENT : VSG_SCOPE_SELF;
 
-			triggers = grf_load_byte(&buf);
+			uint8 triggers = grf_load_byte(&buf);
 			group->g.random.triggers       = GB(triggers, 0, 7);
 			group->g.random.cmp_mode       = HASBIT(triggers, 7) ? RSG_CMP_ALL : RSG_CMP_ANY;
 			group->g.random.lowest_randbit = grf_load_byte(&buf);
@@ -1826,7 +1797,7 @@
 
 			if (!check_length(bufend - buf, 2 * group->g.random.num_groups, "NewSpriteGroup (Randomized) (2)")) return;
 
-			for (i = 0; i < group->g.random.num_groups; i++) {
+			for (uint i = 0; i < group->g.random.num_groups; i++) {
 				group->g.random.groups[i] = GetGroupFromGroupID(setid, type, grf_load_word(&buf));
 			}
 
@@ -1848,7 +1819,6 @@
 					byte sprites     = _cur_grffile->spriteset_numents;
 					byte num_loaded  = type;
 					byte num_loading = grf_load_byte(&buf);
-					uint i;
 
 					if (_cur_grffile->spriteset_start == 0) {
 						grfmsg(0, "NewSpriteGroup: No sprite set to work on! Skipping");
@@ -1868,13 +1838,13 @@
 					grfmsg(6, "NewSpriteGroup: New SpriteGroup 0x%02X, %u views, %u loaded, %u loading",
 							setid, sprites, num_loaded, num_loading);
 
-					for (i = 0; i < num_loaded; i++) {
+					for (uint i = 0; i < num_loaded; i++) {
 						uint16 spriteid = grf_load_word(&buf);
 						group->g.real.loaded[i] = CreateGroupFromGroupID(feature, setid, type, spriteid, sprites);
 						grfmsg(8, "NewSpriteGroup: + rg->loaded[%i]  = subset %u", i, spriteid);
 					}
 
-					for (i = 0; i < num_loading; i++) {
+					for (uint i = 0; i < num_loading; i++) {
 						uint16 spriteid = grf_load_word(&buf);
 						group->g.real.loading[i] = CreateGroupFromGroupID(feature, setid, type, spriteid, sprites);
 						grfmsg(8, "NewSpriteGroup: + rg->loading[%i] = subset %u", i, spriteid);
@@ -1943,26 +1913,22 @@
 
 	static byte *last_engines;
 	static int last_engines_count;
-	uint8 feature;
-	uint8 idcount;
-	bool wagover;
-	uint8 cidcount;
-	int c, i;
 
 	if (!check_length(len, 6, "FeatureMapSpriteGroup")) return;
-	feature = buf[1];
-	idcount = buf[2] & 0x7F;
-	wagover = (buf[2] & 0x80) == 0x80;
+
+	uint8 feature = buf[1];
+	uint8 idcount = buf[2] & 0x7F;
+	bool wagover = (buf[2] & 0x80) == 0x80;
+
 	if (!check_length(len, 3 + idcount, "FeatureMapSpriteGroup")) return;
 
-	/* If ``n-id'' (or ``idcount'') is zero, this is a ``feature
-	 * callback''. */
+	/* If idcount is zero, this is a feature callback */
 	if (idcount == 0) {
 		grfmsg(2, "FeatureMapSpriteGroup: Feature callbacks not implemented yet");
 		return;
 	}
 
-	cidcount = buf[3 + idcount];
+	uint8 cidcount = buf[3 + idcount];
 	if (!check_length(len, 4 + idcount + cidcount * 3, "FeatureMapSpriteGroup")) return;
 
 	grfmsg(6, "FeatureMapSpriteGroup: Feature %d, %d ids, %d cids, wagon override %d",
@@ -1977,12 +1943,12 @@
 	if (feature == GSF_STATION) {
 		// We do things differently for stations.
 
-		for (i = 0; i < idcount; i++) {
+		for (uint i = 0; i < idcount; i++) {
 			uint8 stid = buf[3 + i];
 			StationSpec *statspec = _cur_grffile->stations[stid];
 			byte *bp = &buf[4 + idcount];
 
-			for (c = 0; c < cidcount; c++) {
+			for (uint c = 0; c < cidcount; c++) {
 				uint8 ctype = grf_load_byte(&bp);
 				uint16 groupid = grf_load_word(&bp);
 
@@ -2009,7 +1975,7 @@
 				return;
 			}
 
-			for (i = 0; i < idcount; i++) {
+			for (uint i = 0; i < idcount; i++) {
 				uint8 stid = buf[3 + i];
 				StationSpec *statspec = _cur_grffile->stations[stid];
 
@@ -2046,7 +2012,7 @@
 	}
 
 
-	for (i = 0; i < idcount; i++) {
+	for (uint i = 0; i < idcount; i++) {
 		uint8 engine_id = buf[3 + i];
 		uint8 engine = engine_id + _vehshifts[feature];
 		byte *bp = &buf[4 + idcount];
@@ -2058,7 +2024,7 @@
 
 		grfmsg(7, "FeatureMapSpriteGroup: [%d] Engine %d...", i, engine);
 
-		for (c = 0; c < cidcount; c++) {
+		for (uint c = 0; c < cidcount; c++) {
 			uint8 ctype = grf_load_byte(&bp);
 			uint16 groupid = grf_load_word(&bp);
 
@@ -2087,7 +2053,7 @@
 
 		grfmsg(8, "-- Default group id 0x%04X", groupid);
 
-		for (i = 0; i < idcount; i++) {
+		for (uint i = 0; i < idcount; i++) {
 			uint8 engine = buf[3 + i] + _vehshifts[feature];
 
 			// Don't tell me you don't love duplicated code!
@@ -2132,35 +2098,23 @@
 	 *                 Word : ID of string to change/add
 	 * S data          new texts, each of them zero-terminated, after
 	 *                 which the next name begins. */
-	/* TODO: No support for changing non-vehicle text. Perhaps we shouldn't
-	 * implement it at all, but it could be useful for some "modpacks"
-	 * (completely new scenarios changing all graphics and logically also
-	 * factory names etc). We should then also support all languages (by
-	 * name), not only the original four ones. --pasky
-	 * All of the above are coming.  In Time.  Some sooner than others :)*/
-
-	uint8 feature;
-	uint8 lang;
-	uint8 num;
-	uint16 id;
-	uint16 endid;
+
 	bool new_scheme = _cur_grffile->grf_version >= 7;
-	bool generic;
 
 	if (!check_length(len, 6, "FeatureNewName")) return;
 	buf++;
-	feature  = grf_load_byte(&buf);
-	lang     = grf_load_byte(&buf);
-	num      = grf_load_byte(&buf);
-	generic  = HASBIT(lang, 7);
-	id       = generic ? grf_load_word(&buf) : grf_load_byte(&buf);
+	uint8 feature  = grf_load_byte(&buf);
+	uint8 lang     = grf_load_byte(&buf);
+	uint8 num      = grf_load_byte(&buf);
+	bool generic   = HASBIT(lang, 7);
+	uint16 id      = generic ? grf_load_word(&buf) : grf_load_byte(&buf);
 
 	CLRBIT(lang, 7);
 
 	if (feature <= GSF_AIRCRAFT && id < _vehcounts[feature]) {
 		id += _vehshifts[feature];
 	}
-	endid    = id + num;
+	uint16 endid = id + num;
 
 	grfmsg(6, "FeatureNewName: About to rename engines %d..%d (feature %d) in language 0x%02X",
 	               id, endid, feature, lang);
@@ -2260,14 +2214,12 @@
 	 * V other data    Graphics type specific data.  Currently unused. */
 	/* TODO */
 
-	uint8 type;
-	uint16 num;
 	SpriteID replace = 0;
 
 	if (!check_length(len, 2, "GraphicsNew")) return;
 	buf++;
-	type = grf_load_byte(&buf);
-	num  = grf_load_extended(&buf);
+	uint8 type = grf_load_byte(&buf);
+	uint16 num = grf_load_extended(&buf);
 
 	switch (type) {
 		case 0x04: /* Signal graphics */
@@ -2484,22 +2436,15 @@
 	 * V value
 	 * B num-sprites */
 	/* TODO: More params. More condition types. */
-	uint8 param;
-	uint8 paramsize;
-	uint8 condtype;
-	uint8 numsprites;
-	uint32 param_val = 0;
 	uint32 cond_val = 0;
 	uint32 mask = 0;
 	bool result;
-	GRFLabel *label;
-	GRFLabel *choice = NULL;
 
 	if (!check_length(len, 6, "SkipIf")) return;
 	buf++;
-	param     = grf_load_byte(&buf);
-	paramsize = grf_load_byte(&buf);
-	condtype  = grf_load_byte(&buf);
+	uint8 param     = grf_load_byte(&buf);
+	uint8 paramsize = grf_load_byte(&buf);
+	uint8 condtype  = grf_load_byte(&buf);
 
 	if (condtype < 2) {
 		/* Always 1 for bit tests, the given value should be ignored. */
@@ -2518,7 +2463,7 @@
 		return;
 	}
 
-	param_val = GetParamVal(param, &cond_val);
+	uint32 param_val = GetParamVal(param, &cond_val);
 
 	grfmsg(7, "Test condtype %d, param 0x%08X, condval 0x%08X", condtype, param_val, cond_val);
 
@@ -2535,24 +2480,24 @@
 		switch (condtype) {
 			/* Tests 6 to 10 are only for param 0x88, GRFID checks */
 			case 6: /* Is GRFID active? */
-				result = HASBIT(c->flags, GCF_ACTIVATED);
+				result = c->status == GCS_ACTIVATED;
 				break;
 
 			case 7: /* Is GRFID non-active? */
-				result = !HASBIT(c->flags, GCF_ACTIVATED);
+				result = c->status != GCS_ACTIVATED;
 				break;
 
 			case 8: /* GRFID is not but will be active? */
-				result = !HASBIT(c->flags, GCF_ACTIVATED) && !HASBIT(c->flags, GCF_DISABLED);
+				result = c->status == GCS_INITIALISED;
 				break;
 
 			case 9: /* GRFID is or will be active? */
-				result = !HASBIT(c->flags, GCF_NOT_FOUND) && !HASBIT(c->flags, GCF_DISABLED);
+				result = c->status == GCS_ACTIVATED || c->status == GCS_INITIALISED;
 				break;
 
 			case 10: /* GRFID is not nor will be active */
 				/* This is the only condtype that doesn't get ignored if the GRFID is not found */
-				result = c == NULL || HASBIT(c->flags, GCF_DISABLED) || HASBIT(c->flags, GCF_NOT_FOUND);
+				result = c == NULL || c->flags == GCS_DISABLED || c->status == GCS_NOT_FOUND;
 				break;
 
 			default: grfmsg(1, "Unsupported GRF test %d. Ignoring", condtype); return;
@@ -2582,13 +2527,14 @@
 		return;
 	}
 
-	numsprites = grf_load_byte(&buf);
+	uint8 numsprites = grf_load_byte(&buf);
 
 	/* numsprites can be a GOTO label if it has been defined in the GRF
 	 * file. The jump will always be the first matching label that follows
 	 * the current nfo_line. If no matching label is found, the first matching
 	 * label in the file is used. */
-	for (label = _cur_grffile->label; label != NULL; label = label->next) {
+	GRFLabel *choice = NULL;
+	for (GRFLabel *label = _cur_grffile->label; label != NULL; label = label->next) {
 		if (label->label != numsprites) continue;
 
 		/* Remember a goto before the current line */
@@ -2616,7 +2562,7 @@
 		_skip_sprites = -1;
 
 		/* If an action 8 hasn't been encountered yet, disable the grf. */
-		if (!HASBIT(_cur_grfconfig->flags, GCF_ACTIVATED)) SETBIT(_cur_grfconfig->flags, GCF_DISABLED);
+		if (_cur_grfconfig->status != GCS_ACTIVATED) _cur_grfconfig->status = GCS_DISABLED;
 	}
 }
 
@@ -2624,14 +2570,10 @@
 /* Action 0x08 (GLS_FILESCAN) */
 static void ScanInfo(byte *buf, int len)
 {
-	uint8 version;
-	uint32 grfid;
-	const char *name;
-	const char *info;
-
-	if (!check_length(len, 8, "Info")) return; buf++;
-	version = grf_load_byte(&buf);
-	grfid = grf_load_dword(&buf);
+	if (!check_length(len, 8, "Info")) return;
+	buf++;
+	grf_load_byte(&buf);
+	uint32 grfid  = grf_load_dword(&buf);
 
 	_cur_grfconfig->grfid = grfid;
 
@@ -2639,12 +2581,12 @@
 	if (GB(grfid, 24, 8) == 0xFF) SETBIT(_cur_grfconfig->flags, GCF_SYSTEM);
 
 	len -= 6;
-	name = grf_load_string(&buf, len);
+	const char *name = grf_load_string(&buf, len);
 	_cur_grfconfig->name = TranslateTTDPatchCodes(name);
 
 	len -= strlen(name) + 1;
 	if (len > 0) {
-		info = grf_load_string(&buf, len);
+		const char *info = grf_load_string(&buf, len);
 		_cur_grfconfig->info = TranslateTTDPatchCodes(info);
 	}
 
@@ -2661,19 +2603,16 @@
 	 * 4*B grf-id      globally unique ID of this .grf file
 	 * S name          name of this .grf set
 	 * S info          string describing the set, and e.g. author and copyright */
-	/* TODO: Check version. (We should have own versioning done somehow.) */
-	uint8 version;
-	uint32 grfid;
-	const char *name;
-
-	if (!check_length(len, 8, "GRFInfo")) return; buf++;
-	version = grf_load_byte(&buf);
-	grfid = grf_load_dword(&buf);
-	name = grf_load_string(&buf, len - 6);
+
+	if (!check_length(len, 8, "GRFInfo")) return;
+	buf++;
+	uint8 version    = grf_load_byte(&buf);
+	uint32 grfid     = grf_load_dword(&buf);
+	const char *name = grf_load_string(&buf, len - 6);
 
 	_cur_grffile->grfid = grfid;
 	_cur_grffile->grf_version = version;
-	SETBIT(_cur_grfconfig->flags, GCF_ACTIVATED);
+	_cur_grfconfig->status = _cur_stage < GLS_ACTIVATION ? GCS_INITIALISED : GCS_ACTIVATED;
 
 	/* Do swap the GRFID for displaying purposes since people expect that */
 	DEBUG(grf, 1, "Loaded GRFv%d set %08lX - %s", version, BSWAP32(grfid), name);
@@ -2689,22 +2628,19 @@
 	 * Each set:
 	 * B num-sprites   How many sprites are in this set
 	 * W first-sprite  First sprite number to replace */
-	uint8 num_sets;
-	uint i;
 
 	buf++; /* skip action byte */
-	num_sets = grf_load_byte(&buf);
-
-	for (i = 0; i < num_sets; i++) {
+	uint8 num_sets = grf_load_byte(&buf);
+
+	for (uint i = 0; i < num_sets; i++) {
 		uint8 num_sprites = grf_load_byte(&buf);
 		uint16 first_sprite = grf_load_word(&buf);
-		uint j;
 
 		grfmsg(2, "SpriteReplace: [Set %d] Changing %d sprites, beginning with %d",
 			i, num_sprites, first_sprite
 		);
 
-		for (j = 0; j < num_sprites; j++) {
+		for (uint j = 0; j < num_sprites; j++) {
 			LoadNextSprite(first_sprite + j, _file_index); // XXX
 			_nfo_line++;
 		}
@@ -2779,8 +2715,7 @@
 	} else if (severity == 3) {
 		/* This is a fatal error, so make sure the GRF is deactivated and no
 		 * more of it gets loaded. */
-		SETBIT(_cur_grfconfig->flags, GCF_DISABLED);
-		CLRBIT(_cur_grfconfig->flags, GCF_ACTIVATED);
+		_cur_grfconfig->status = GCS_DISABLED;
 
 		_skip_sprites = -1;
 	}
@@ -2845,11 +2780,9 @@
 /* Action 0x0D (GLS_SAFETYSCAN) */
 static void SafeParamSet(byte *buf, int len)
 {
-	uint8 target;
-
 	if (!check_length(len, 5, "SafeParamSet")) return;
 	buf++;
-	target = grf_load_byte(&buf);
+	uint8 target = grf_load_byte(&buf);
 
 	/* Only writing GRF parameters is considered safe */
 	if (target < 0x80) return;
@@ -2890,20 +2823,14 @@
 	 *         (source2 like in 05, and source1 as well)
 	 */
 
-	byte target;
-	byte oper;
-	uint32 src1;
-	uint32 src2;
-	uint32 data = 0;
-	uint32 res;
-
 	if (!check_length(len, 5, "ParamSet")) return;
 	buf++;
-	target = grf_load_byte(&buf);
-	oper = grf_load_byte(&buf);
-	src1 = grf_load_byte(&buf);
-	src2 = grf_load_byte(&buf);
-
+	uint8 target = grf_load_byte(&buf);
+	uint8 oper   = grf_load_byte(&buf);
+	uint32 src1  = grf_load_byte(&buf);
+	uint32 src2  = grf_load_byte(&buf);
+
+	uint32 data = 0;
 	if (len >= 8) data = grf_load_dword(&buf);
 
 	/* You can add 80 to the operation to make it apply only if the target
@@ -2912,13 +2839,13 @@
 	 * - it has been set to any value in the newgrf(w).cfg parameter list
 	 * - it OR A PARAMETER WITH HIGHER NUMBER has been set to any value by
 	 *   an earlier action D */
-	if (oper & 0x80) {
+	if (HASBIT(oper, 7)) {
 		if (target < 0x80 && target < _cur_grffile->param_end) {
 			grfmsg(7, "Param %u already defined, skipping", target);
 			return;
 		}
 
-		oper &= 0x7F;
+		oper = GB(oper, 0, 7);
 	}
 
 	if (src2 == 0xFE) {
@@ -2946,7 +2873,6 @@
 							uint start = 0;
 							uint size  = 0;
 							uint shift = _vehshifts[feature];
-							int i;
 
 							if (op == 6) {
 								/* Return GRFID of set that reserved ID */
@@ -2957,7 +2883,7 @@
 							/* With an operation of 2 or 3, we want to reserve a specific block of IDs */
 							if (op == 2 || op == 3) start = _cur_grffile->param[target];
 
-							for (i = start; i < _vehcounts[feature]; i++) {
+							for (uint i = start; i < _vehcounts[feature]; i++) {
 								if (_grm_engines[shift + i] == 0) {
 									size++;
 								} else {
@@ -2973,7 +2899,7 @@
 								/* Got the slot... */
 								if (op == 0 || op == 3) {
 									grfmsg(2, "GRM: Reserving %d vehicles at %d", count, start);
-									for (i = 0; i < count; i++) _grm_engines[shift + start + i] = _cur_grffile->grfid;
+									for (uint i = 0; i < count; i++) _grm_engines[shift + start + i] = _cur_grffile->grfid;
 								}
 								src1 = start;
 							} else {
@@ -2981,8 +2907,7 @@
 								if (op != 4 && op != 5) {
 									/* Deactivate GRF */
 									grfmsg(0, "GRM: Unable to allocate %d vehicles, deactivating", count);
-									SETBIT(_cur_grfconfig->flags, GCF_DISABLED);
-									CLRBIT(_cur_grfconfig->flags, GCF_ACTIVATED);
+									_cur_grfconfig->status = GCS_DISABLED;
 
 									_skip_sprites = -1;
 									return;
@@ -3000,8 +2925,7 @@
 									/* Check if the allocated sprites will fit below the original sprite limit */
 									if (_cur_spriteid + count >= 16384) {
 										grfmsg(0, "GRM: Unable to allocate %d sprites; try changing NewGRF order", count);
-										SETBIT(_cur_grfconfig->flags, GCF_DISABLED);
-										CLRBIT(_cur_grfconfig->flags, GCF_ACTIVATED);
+										_cur_grfconfig->status = GCS_DISABLED;
 
 										_skip_sprites = -1;
 										return;
@@ -3051,6 +2975,7 @@
 	 * cannot be found, a value of 0 is used for the parameter value
 	 * instead. */
 
+	uint32 res;
 	switch (oper) {
 		case 0x00:
 			res = src1;
@@ -3172,15 +3097,12 @@
 	 * B num           Number of GRFIDs that follow
 	 * D grfids        GRFIDs of the files to deactivate */
 
-	byte num;
-	int i;
-
-	if (!check_length(len, 1, "GRFInhibit")) return;
-	buf++, len--;
-	num = grf_load_byte(&buf); len--;
-	if (!check_length(len, 4 * num, "GRFInhibit")) return;
-
-	for (i = 0; i < num; i++) {
+	if (!check_length(len, 2, "GRFInhibit")) return;
+	buf++;
+	uint8 num = grf_load_byte(&buf);
+	if (!check_length(len, 2 + 4 * num, "GRFInhibit")) return;
+
+	for (uint i = 0; i < num; i++) {
 		uint32 grfid = grf_load_dword(&buf);
 
 		/* GRF is unsafe it if tries to deactivate other GRFs */
@@ -3203,23 +3125,19 @@
 	 * B num           Number of GRFIDs that follow
 	 * D grfids        GRFIDs of the files to deactivate */
 
-	byte num;
-	int i;
-
-	if (!check_length(len, 1, "GRFInhibit")) return;
-	buf++, len--;
-	num = grf_load_byte(&buf); len--;
-	if (!check_length(len, 4 * num, "GRFInhibit")) return;
-
-	for (i = 0; i < num; i++) {
+	if (!check_length(len, 2, "GRFInhibit")) return;
+	buf++;
+	uint8 num = grf_load_byte(&buf);
+	if (!check_length(len, 2 + 4 * num, "GRFInhibit")) return;
+
+	for (uint i = 0; i < num; i++) {
 		uint32 grfid = grf_load_dword(&buf);
 		GRFConfig *file = GetGRFConfig(grfid);
 
 		/* Unset activation flag */
 		if (file != NULL && file != _cur_grfconfig) {
 			grfmsg(2, "GRFInhibit: Deactivating file '%s'", file->filename);
-			SETBIT(file->flags, GCF_DISABLED);
-			CLRBIT(file->flags, GCF_ACTIVATED);
+			file->status = GCS_DISABLED;
 		}
 	}
 }
@@ -3232,12 +3150,10 @@
 	 * B label      The label to define
 	 * V comment    Optional comment - ignored */
 
-	GRFLabel *label;
-
 	if (!check_length(len, 1, "DefineGotoLabel")) return;
 	buf++; len--;
 
-	label = MallocT<GRFLabel>(1);
+	GRFLabel *label = MallocT<GRFLabel>(1);
 	label->label    = grf_load_byte(&buf);
 	label->nfo_line = _nfo_line;
 	label->pos      = FioGetPos();
@@ -3263,11 +3179,9 @@
 	 *
 	 * W num      Number of sound files that follow */
 
-	uint16 num;
-
 	if (!check_length(len, 1, "GRFSound")) return;
 	buf++;
-	num = grf_load_word(&buf);
+	uint16 num = grf_load_word(&buf);
 
 	_grf_data_blocks = num;
 	_grf_data_type   = GDT_SOUND;
@@ -3329,11 +3243,10 @@
 static void LoadGRFSound(byte *buf, int len)
 {
 	byte *buf_start = buf;
-	FileEntry *se;
 
 	/* Allocate a sound entry. This is done even if the data is not loaded
 	 * so that the indices used elsewhere are still correct. */
-	se = AllocateFileEntry();
+	FileEntry *se = AllocateFileEntry();
 
 	if (grf_load_dword(&buf) != BSWAP32('RIFF')) {
 		grfmsg(1, "LoadGRFSound: Missing RIFF header");
@@ -3398,25 +3311,21 @@
 	 * B num_char     Number of consecutive glyphs
 	 * W base_char    First character index */
 
-	uint8 num_def;
-	uint i;
-
 	buf++; len--;
 	if (!check_length(len, 1, "LoadFontGlyph")) return;
 
-	num_def = grf_load_byte(&buf);
+	uint8 num_def = grf_load_byte(&buf);
 
 	if (!check_length(len, 1 + num_def * 4, "LoadFontGlyph")) return;
 
-	for (i = 0; i < num_def; i++) {
+	for (uint i = 0; i < num_def; i++) {
 		FontSize size    = (FontSize)grf_load_byte(&buf);
 		uint8  num_char  = grf_load_byte(&buf);
 		uint16 base_char = grf_load_word(&buf);
-		uint c;
 
 		grfmsg(7, "LoadFontGlyph: Loading %u glyph(s) at 0x%04X for size %u", num_char, base_char, size);
 
-		for (c = 0; c < num_char; c++) {
+		for (uint c = 0; c < num_char; c++) {
 			SetUnicodeGlyph(size, base_char + c, _cur_spriteid);
 			LoadNextSprite(_cur_spriteid++, _file_index);
 			_nfo_line++;
@@ -3424,20 +3333,83 @@
 	}
 }
 
+/* Action 0x13 */
+static void TranslateGRFStrings(byte *buf, int len)
+{
+	/* <13> <grfid> <num-ent> <offset> <text...>
+	 *
+	 * 4*B grfid     The GRFID of the file whose texts are to be translated
+	 * B   num-ent   Number of strings
+	 * W   offset    First text ID
+	 * S   text...   Zero-terminated strings */
+
+	buf++; len--;
+	if (!check_length(len, 7, "TranslateGRFString")) return;
+
+	uint32 grfid = grf_load_dword(&buf);
+	const GRFConfig *c = GetGRFConfig(grfid);
+	if (c == NULL || (c->status != GCS_INITIALISED && c->status != GCS_ACTIVATED)) {
+		grfmsg(7, "GRFID 0x%08x unknown, skipping action 13", BSWAP32(grfid));
+		return;
+	}
+
+	if (c->status == GCS_INITIALISED) {
+		/* If the file is not active but will be activated later, give an error
+		 * and disable this file. */
+		GRFError *error = CallocT<GRFError>(1);
+		error->message  = STR_NEWGRF_ERROR_LOAD_AFTER;
+		error->data     = STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE;
+		error->severity = STR_NEWGRF_ERROR_MSG_FATAL;
+
+		if (_cur_grfconfig->error != NULL) free(_cur_grfconfig->error);
+		_cur_grfconfig->error = error;
+
+		_cur_grfconfig->status = GCS_DISABLED;
+		_skip_sprites = -1;
+		return;
+	}
+
+	byte num_strings = grf_load_byte(&buf);
+	uint16 first_id  = grf_load_word(&buf);
+
+	if (!((first_id >= 0xD000 && first_id + num_strings <= 0xD3FF) || (first_id >= 0xDC00 && first_id + num_strings <= 0xDCFF))) {
+		grfmsg(7, "Attempting to set out-of-range string IDs in action 13 (first: 0x%4X, number: 0x%2X)", first_id, num_strings);
+		return;
+	}
+
+	len -= 7;
+
+	for (uint i = 0; i < num_strings && len > 0; i++) {
+		const char *string   = grf_load_string(&buf, len);
+		size_t string_length = strlen(string) + 1;
+
+		len -= (int)string_length;
+
+		if (string_length == 1) {
+			grfmsg(7, "TranslateGRFString: Ignoring empty string.");
+			continue;
+		}
+
+		/* Since no language id is supplied this string has to be added as a
+		 * generic string, thus the language id of 0x7F. For this to work
+		 * new_scheme has to be true as well. A language id of 0x7F will be
+		 * overridden by a non-generic id, so this will not change anything if
+		 * a string has been provided specifically for this language. */
+		AddGRFString(grfid, first_id + i, 0x7F, true, string, STR_UNDEFINED);
+	}
+}
+
 /* 'Action 0xFF' */
 static void GRFDataBlock(byte *buf, int len)
 {
-	byte name_len;
-	const char *name;
-
 	if (_grf_data_blocks == 0) {
 		grfmsg(2, "GRFDataBlock: unexpected data block, skipping");
 		return;
 	}
 
 	buf++;
-	name_len = grf_load_byte(&buf);
-	name = (const char *)buf;
+	uint8 name_len = grf_load_byte(&buf);
+	const char *name = (const char *)buf;
 	buf += name_len + 1;
 
 	grfmsg(2, "GRFDataBlock: block name '%s'...", name);
@@ -3461,7 +3433,7 @@
 }
 
 
-static void InitializeGRFSpecial(void)
+static void InitializeGRFSpecial()
 {
 	_ttdpatch_flags[0] =  ((_patches.always_small_airport ? 1 : 0) << 0x0C)  // keepsmallairport
 	                   |                                        (1 << 0x0D)  // newairports
@@ -3540,22 +3512,17 @@
 	                   |                                        (0 << 0x17); // articulatedrvs
 }
 
-static void ResetCustomStations(void)
+static void ResetCustomStations()
 {
-	StationSpec *statspec;
-	GRFFile *file;
-	uint i;
-	uint t;
-
-	for (file = _first_grffile; file != NULL; file = file->next) {
+	for (GRFFile *file = _first_grffile; file != NULL; file = file->next) {
 		if (file->stations == NULL) continue;
-		for (i = 0; i < MAX_STATIONS; i++) {
+		for (uint i = 0; i < MAX_STATIONS; i++) {
 			if (file->stations[i] == NULL) continue;
-			statspec = file->stations[i];
+			StationSpec *statspec = file->stations[i];
 
 			/* Release renderdata, if it wasn't copied from another custom station spec  */
 			if (!statspec->copied_renderdata) {
-				for (t = 0; t < statspec->tiles; t++) {
+				for (uint t = 0; t < statspec->tiles; t++) {
 					free((void*)statspec->renderdata[t].seq);
 				}
 				free(statspec->renderdata);
@@ -3563,9 +3530,8 @@
 
 			/* Release platforms and layouts */
 			if (!statspec->copied_layouts) {
-				uint l, p;
-				for (l = 0; l < statspec->lengths; l++) {
-					for (p = 0; p < statspec->platforms[l]; p++) {
+				for (uint l = 0; l < statspec->lengths; l++) {
+					for (uint p = 0; p < statspec->platforms[l]; p++) {
 						free(statspec->layouts[l][p]);
 					}
 					free(statspec->layouts[l]);
@@ -3584,11 +3550,11 @@
 	}
 }
 
-static void ResetNewGRF(void)
+static void ResetNewGRF()
 {
-	GRFFile *f, *next;
-
-	for (f = _first_grffile; f != NULL; f = next) {
+	GRFFile *next;
+
+	for (GRFFile *f = _first_grffile; f != NULL; f = next) {
 		next = f->next;
 
 		free(f->filename);
@@ -3603,10 +3569,8 @@
  * Reset all NewGRF loaded data
  * TODO
  */
-static void ResetNewGRFData(void)
+static void ResetNewGRFData()
 {
-	uint i;
-
 	CleanUpStrings();
 
 	// Copy/reset original engine info data
@@ -3618,11 +3582,9 @@
 
 	// Copy/reset original bridge info data
 	// First, free sprite table data
-	for (i = 0; i < MAX_BRIDGES; i++) {
+	for (uint i = 0; i < MAX_BRIDGES; i++) {
 		if (_bridge[i].sprite_table != NULL) {
-			uint j;
-
-			for (j = 0; j < 7; j++) free(_bridge[i].sprite_table[j]);
+			for (uint j = 0; j < 7; j++) free(_bridge[i].sprite_table[j]);
 			free(_bridge[i].sprite_table);
 		}
 	}
@@ -3681,11 +3643,10 @@
 }
 
 /** Reset all NewGRFData that was used only while processing data */
-static void ClearTemporaryNewGRFData(void)
+static void ClearTemporaryNewGRFData()
 {
 	/* Clear the GOTO labels used for GRF processing */
-	GRFLabel *l;
-	for (l = _cur_grffile->label; l != NULL;) {
+	for (GRFLabel *l = _cur_grffile->label; l != NULL;) {
 		GRFLabel *l2 = l->next;
 		free(l);
 		l = l2;
@@ -3723,9 +3684,7 @@
 
 static void InitNewGRFFile(const GRFConfig *config, int sprite_offset)
 {
-	GRFFile *newfile;
-
-	newfile = GetFileByFilename(config->filename);
+	GRFFile *newfile = GetFileByFilename(config->filename);
 	if (newfile != NULL) {
 		/* We already loaded it once. */
 		newfile->sprite_offset = sprite_offset;
@@ -3790,19 +3749,43 @@
 /**
  * Precalculate refit masks from cargo classes for all vehicles.
  */
-static void CalculateRefitMasks(void)
+static void CalculateRefitMasks()
 {
-	EngineID engine;
-
-	for (engine = 0; engine < TOTAL_NUM_ENGINES; engine++) {
+	for (EngineID engine = 0; engine < TOTAL_NUM_ENGINES; engine++) {
+		/* Skip engine if not available in this climate */
+		if (!HASBIT(_engine_info[engine].climates, _opt.landscape)) continue;
+
 		uint32 mask = 0;
 		uint32 not_mask = 0;
-		uint32 xor_mask = _engine_info[engine].refit_mask;
-		byte i;
+		uint32 xor_mask = 0;
+
+		if (_engine_info[engine].refit_mask != 0) {
+			const GRFFile *file = GetEngineGRF(engine);
+			if (file != NULL && file->cargo_max != 0) {
+				/* Apply cargo translation table to the refit mask */
+				uint num_cargo = min(32, file->cargo_max);
+				for (uint i = 0; i < num_cargo; i++) {
+					if (!HASBIT(_engine_info[engine].refit_mask, i)) continue;
+
+					CargoID c = GetCargoIDByLabel(file->cargo_list[i]);
+					if (c == CT_INVALID) continue;
+
+					SETBIT(xor_mask, c);
+				}
+			} else {
+				/* No cargo table, so use the cargo bitnum values */
+				for (CargoID c = 0; c < NUM_CARGO; c++) {
+					const CargoSpec *cs = GetCargo(c);
+					if (!cs->IsValid()) continue;
+
+					if (HASBIT(_engine_info[engine].refit_mask, cs->bitnum)) SETBIT(xor_mask, c);
+				}
+			}
+		}
 
 		if (cargo_allowed[engine] != 0) {
 			// Build up the list of cargo types from the set cargo classes.
-			for (i = 0; i < NUM_CARGO; i++) {
+			for (CargoID i = 0; i < NUM_CARGO; i++) {
 				const CargoSpec *cs = GetCargo(i);
 				if (cargo_allowed[engine]    & cs->classes) SETBIT(mask,     i);
 				if (cargo_disallowed[engine] & cs->classes) SETBIT(not_mask, i);
@@ -3810,7 +3793,7 @@
 		} else {
 			// Don't apply default refit mask to wagons or engines with no capacity
 			if (xor_mask == 0 && (
-						GetEngine(engine)->type != VEH_Train || (
+						GetEngine(engine)->type != VEH_TRAIN || (
 							RailVehInfo(engine)->capacity != 0 &&
 							RailVehInfo(engine)->railveh_type != RAILVEH_WAGON
 						)
@@ -3833,19 +3816,22 @@
 		/* Check if this engine's cargo type is valid. If not, set to the first refittable
 		 * cargo type. Apparently cargo_type isn't a common property... */
 		switch (GetEngine(engine)->type) {
-			case VEH_Train: {
+			case VEH_TRAIN: {
 				RailVehicleInfo *rvi = &_rail_vehicle_info[engine];
 				if (rvi->cargo_type == CT_INVALID) rvi->cargo_type = FindFirstRefittableCargo(engine);
+				if (rvi->cargo_type == CT_INVALID) _engine_info[engine].climates = 0;
 				break;
 			}
-			case VEH_Road: {
+			case VEH_ROAD: {
 				RoadVehicleInfo *rvi = &_road_vehicle_info[engine - ROAD_ENGINES_INDEX];
 				if (rvi->cargo_type == CT_INVALID) rvi->cargo_type = FindFirstRefittableCargo(engine);
+				if (rvi->cargo_type == CT_INVALID) _engine_info[engine].climates = 0;
 				break;
 			}
-			case VEH_Ship: {
+			case VEH_SHIP: {
 				ShipVehicleInfo *svi = &_ship_vehicle_info[engine - SHIP_ENGINES_INDEX];
 				if (svi->cargo_type == CT_INVALID) svi->cargo_type = FindFirstRefittableCargo(engine);
+				if (svi->cargo_type == CT_INVALID) _engine_info[engine].climates = 0;
 				break;
 			}
 		}
@@ -3892,10 +3878,10 @@
 		/* 0x10 */ { NULL,     NULL,      DefineGotoLabel, NULL,       NULL, },
 		/* 0x11 */ { NULL,     GRFUnsafe, NULL,            NULL,       GRFSound, },
 		/* 0x12 */ { NULL,     NULL,      NULL,            NULL,       LoadFontGlyph, },
+		/* 0x13 */ { NULL,     NULL,      NULL,            NULL,       TranslateGRFStrings, },
 	};
 
 	byte* buf;
-	byte action;
 
 	if (_preload_sprite == NULL) {
 		/* No preloaded sprite to work with; allocate and read the
@@ -3913,7 +3899,7 @@
 		FioSeekTo(num, SEEK_CUR);
 	}
 
-	action = buf[0];
+	byte action = buf[0];
 
 	if (action == 0xFF) {
 		grfmsg(7, "Handling data block in stage %d", stage);
@@ -3950,11 +3936,9 @@
 	if (stage != GLS_FILESCAN && stage != GLS_SAFETYSCAN && stage != GLS_LABELSCAN) {
 		_cur_grffile = GetFileByFilename(filename);
 		if (_cur_grffile == NULL) error("File '%s' lost in cache.\n", filename);
-		if (stage == GLS_ACTIVATION && !HASBIT(config->flags, GCF_ACTIVATED)) return;
+		if (stage == GLS_ACTIVATION && config->status != GCS_INITIALISED) return;
 	}
 
-	if (stage == GLS_ACTIVATION) CLRBIT(config->flags, GCF_ACTIVATED);
-
 	FioOpenFile(file_index, filename);
 	_file_index = file_index; // XXX
 
@@ -4017,12 +4001,10 @@
 	}
 }
 
-void InitDepotWindowBlockSizes(void);
+void InitDepotWindowBlockSizes();
 
 void LoadNewGRF(uint load_index, uint file_index)
 {
-	GrfLoadingStage stage;
-
 	InitializeGRFSpecial();
 
 	ResetNewGRFData();
@@ -4030,14 +4012,13 @@
 	/* Load newgrf sprites
 	 * in each loading stage, (try to) open each file specified in the config
 	 * and load information from it. */
-	for (stage = GLS_LABELSCAN; stage <= GLS_ACTIVATION; stage++) {
+	for (GrfLoadingStage stage = GLS_LABELSCAN; stage <= GLS_ACTIVATION; stage++) {
 		uint slot = file_index;
-		GRFConfig *c;
 
 		_cur_stage = stage;
 		_cur_spriteid = load_index;
-		for (c = _grfconfig; c != NULL; c = c->next) {
-			if (HASBIT(c->flags, GCF_DISABLED) || HASBIT(c->flags, GCF_NOT_FOUND)) continue;
+		for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) {
+			if (c->status == GCS_DISABLED || c->status == GCS_NOT_FOUND) continue;
 
 			// TODO usererror()
 			if (!FioCheckFileExists(c->filename)) error("NewGRF file is missing '%s'", c->filename);
@@ -4058,8 +4039,3 @@
 	/* Set the block size in the depot windows based on vehicle sprite sizes */
 	InitDepotWindowBlockSizes();
 }
-
-
-
-
-
--- a/src/newgrf.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,31 +8,31 @@
 #include "helpers.hpp"
 #include "cargotype.h"
 
-typedef enum GrfLoadingStage {
+enum GrfLoadingStage {
 	GLS_FILESCAN,
 	GLS_SAFETYSCAN,
 	GLS_LABELSCAN,
 	GLS_INIT,
 	GLS_ACTIVATION,
 	GLS_END,
-} GrfLoadingStage;
+};
 
 DECLARE_POSTFIX_INCREMENT(GrfLoadingStage);
 
 
-typedef struct GRFLabel {
+struct GRFLabel {
 	byte label;
 	uint32 nfo_line;
 	uint32 pos;
 	struct GRFLabel *next;
-} GRFLabel;
+};
 
-typedef struct GRFFile {
+struct GRFFile {
 	char *filename;
 	uint32 grfid;
 	uint16 sprite_offset;
 	byte grf_version;
-	struct GRFFile *next;
+	GRFFile *next;
 
 	/* A sprite group contains all sprites of a given vehicle (or multiple
 	 * vehicles) when carrying given cargo. It consists of several sprite
@@ -65,7 +65,7 @@
 	uint8 cargo_max;
 	CargoLabel *cargo_list;
 	uint8 cargo_map[NUM_CARGO];
-} GRFFile;
+};
 
 extern GRFFile *_first_grffile;
 
@@ -75,7 +75,7 @@
 
 void LoadNewGRFFile(GRFConfig *config, uint file_index, GrfLoadingStage stage);
 void LoadNewGRF(uint load_index, uint file_index);
-void ReloadNewGRFData(void); // in openttd.c
+void ReloadNewGRFData(); // in openttd.c
 
 void CDECL grfmsg(int severity, const char *str, ...);
 
--- a/src/newgrf_callbacks.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_callbacks.h	Mon Mar 19 12:38:16 2007 +0000
@@ -11,16 +11,16 @@
  * Names are formatted as CBID_<CLASS>_<CALLBACK>
  */
 enum CallbackID {
-	// Powered wagons, if the result is lower as 0x40 then the wagon is powered
-	// TODO: interpret the rest of the result, aka "visual effects"
+	/* Powered wagons, if the result is lower as 0x40 then the wagon is powered
+	 * @todo : interpret the rest of the result, aka "visual effects" */
 	CBID_TRAIN_WAGON_POWER          = 0x10,
 
-	// Vehicle length, returns the amount of 1/8's the vehicle is shorter
-	// only for train vehicles
+	/* Vehicle length, returns the amount of 1/8's the vehicle is shorter
+	 * only for train vehicles */
 	CBID_TRAIN_VEHICLE_LENGTH       = 0x11,
 
-	/* Called to determine the amount of cargo to load per unit of time when
-	 * using gradual loading. */
+	/* Called (if appropriate bit in callback mask is set) to determine the
+	 * amount of cargo to load per unit of time when using gradual loading. */
 	CBID_VEHICLE_LOAD_AMOUNT        = 0x12,
 
 	/* Called (if appropriate bit in callback mask is set) to determine if a
@@ -31,8 +31,8 @@
 	 * to choose a sprite layout to draw, instead of the standard 0-7 range */
 	CBID_STATION_SPRITE_LAYOUT      = 0x14,
 
-	// Refit capacity, the passed vehicle needs to have its ->cargo_type set to
-	// the cargo we are refitting to, returns the new cargo capacity
+	/* Refit capacity, the passed vehicle needs to have its ->cargo_type set to
+	 * the cargo we are refitting to, returns the new cargo capacity */
 	CBID_VEHICLE_REFIT_CAPACITY     = 0x15,
 
 	CBID_TRAIN_ARTIC_ENGINE         = 0x16,
--- a/src/newgrf_config.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_config.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -60,7 +60,7 @@
 bool FillGRFDetails(GRFConfig *config, bool is_static)
 {
 	if (!FioCheckFileExists(config->filename)) {
-		SETBIT(config->flags, GCF_NOT_FOUND);
+		config->status = GCS_NOT_FOUND;
 		return false;
 	}
 
@@ -210,14 +210,14 @@
 /** Check if all GRFs in the GRF config from a savegame can be loaded.
  * @return will return any of the following 3 values:<br>
  * <ul>
- * <li> GCF_ACTIVATED: No problems occured, all GRF files were found and loaded
- * <li> GCF_COMPATIBLE: For one or more GRF's no exact match was found, but a
+ * <li> GLC_ALL_GOOD: No problems occured, all GRF files were found and loaded
+ * <li> GLC_COMPATIBLE: For one or more GRF's no exact match was found, but a
  *     compatible GRF with the same grfid was found and used instead
- * <li> GCF_NOT_FOUND: For one or more GRF's no match was found at all
+ * <li> GLC_NOT_FOUND: For one or more GRF's no match was found at all
  * </ul> */
-GCF_Flags IsGoodGRFConfigList(void)
+GRFListCompatibility IsGoodGRFConfigList()
 {
-	GCF_Flags res = GCF_ACTIVATED;
+	GRFListCompatibility res = GLC_ALL_GOOD;
 
 	for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) {
 		const GRFConfig *f = FindGRFConfig(c->grfid, c->md5sum);
@@ -233,7 +233,7 @@
 				SETBIT(c->flags, GCF_COMPATIBLE);
 
 				/* Non-found has precedence over compatibility load */
-				if (res != GCF_NOT_FOUND) res = GCF_COMPATIBLE;
+				if (res != GLC_NOT_FOUND) res = GLC_COMPATIBLE;
 				goto compatible_grf;
 			}
 
@@ -241,8 +241,8 @@
 			md5sumToString(buf, lastof(buf), c->md5sum);
 			DEBUG(grf, 0, "NewGRF %08X (%s) not found; checksum %s", BSWAP32(c->grfid), c->filename, buf);
 
-			SETBIT(c->flags, GCF_NOT_FOUND);
-			res = GCF_NOT_FOUND;
+			c->status = GCS_NOT_FOUND;
+			res = GLC_NOT_FOUND;
 		} else {
 compatible_grf:
 			DEBUG(grf, 1, "Loading GRF %08X from %s", BSWAP32(f->grfid), f->filename);
@@ -335,7 +335,7 @@
 
 
 /* Scan for all NewGRFs */
-void ScanNewGRFFiles(void)
+void ScanNewGRFFiles()
 {
 	uint num;
 
@@ -364,7 +364,6 @@
 #ifdef ENABLE_NETWORK
 
 /** Structure for UnknownGRFs; this is a lightweight variant of GRFConfig */
-typedef struct UnknownGRF UnknownGRF;
 struct UnknownGRF : public GRFIdentifier {
 	UnknownGRF *next;
 	char   name[NETWORK_GRF_NAME_LENGTH];
@@ -452,7 +451,7 @@
 };
 
 
-static void Save_NGRF(void)
+static void Save_NGRF()
 {
 	int index = 0;
 
@@ -464,7 +463,7 @@
 }
 
 
-static void Load_NGRF(void)
+static void Load_NGRF()
 {
 	ClearGRFConfigList(&_grfconfig);
 	while (SlIterateArray() != -1) {
--- a/src/newgrf_config.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_config.h	Mon Mar 19 12:38:16 2007 +0000
@@ -6,42 +6,54 @@
 #include "openttd.h"
 
 /* GRF config bit flags */
-typedef enum {
-	GCF_DISABLED,  ///< GRF file is disabled
-	GCF_NOT_FOUND, ///< GRF file was not found in the local cache
-	GCF_ACTIVATED, ///< GRF file is active
+enum GCF_Flags {
 	GCF_SYSTEM,    ///< GRF file is an openttd-internal system grf
 	GCF_UNSAFE,    ///< GRF file is unsafe for static usage
 	GCF_STATIC,    ///< GRF file is used statically (can be used in any MP game)
 	GCF_COMPATIBLE,///< GRF file does not exactly match the requested GRF (different MD5SUM), but grfid matches)
 	GCF_COPY,      ///< The data is copied from a grf in _all_grfs
-} GCF_Flags;
+};
 
-typedef struct GRFIdentifier {
+enum GRFStatus {
+	GCS_UNKNOWN,      ///< The status of this grf file is unknown
+	GCS_DISABLED,     ///< GRF file is disabled
+	GCS_NOT_FOUND,    ///< GRF file was not found in the local cache
+	GCS_INITIALISED,  ///< GRF file has been initialised
+	GCS_ACTIVATED     ///< GRF file has been activated
+};
+
+enum GRFListCompatibility{
+	GLC_ALL_GOOD,
+	GLC_COMPATIBLE,
+	GLC_NOT_FOUND
+};
+
+struct GRFIdentifier {
 	uint32 grfid;
 	uint8 md5sum[16];
-} GRF;
+};
 
-typedef struct GRFError {
+struct GRFError {
 	StringID message;
 	StringID data;
 	StringID severity;
 	uint8 num_params;
 	uint8 param_number[2];
-} GRFError;
+};
 
-typedef struct GRFConfig : public GRFIdentifier {
+struct GRFConfig : public GRFIdentifier {
 	char *filename;
 	char *name;
 	char *info;
 	GRFError *error;
 
 	uint8 flags;
+	GRFStatus status;
 	uint32 param[0x80];
 	uint8 num_params;
 
 	struct GRFConfig *next;
-} GRFConfig;
+};
 
 /* First item in list of all scanned NewGRFs */
 extern GRFConfig *_all_grfs;
@@ -55,7 +67,7 @@
 /* First item in list of static GRF set up */
 extern GRFConfig *_grfconfig_static;
 
-void ScanNewGRFFiles(void);
+void ScanNewGRFFiles();
 const GRFConfig *FindGRFConfig(uint32 grfid, const uint8 *md5sum = NULL);
 GRFConfig *GetGRFConfig(uint32 grfid);
 GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src);
@@ -64,7 +76,7 @@
 void ClearGRFConfig(GRFConfig **config);
 void ClearGRFConfigList(GRFConfig **config);
 void ResetGRFConfig(bool defaults);
-GCF_Flags IsGoodGRFConfigList(void);
+GRFListCompatibility IsGoodGRFConfigList();
 bool FillGRFDetails(GRFConfig *config, bool is_static);
 char *GRFBuildParamList(char *dst, const GRFConfig *c, const char *last);
 
--- a/src/newgrf_engine.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_engine.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -24,17 +24,17 @@
 int _traininfo_vehicle_pitch = 0;
 int _traininfo_vehicle_width = 29;
 
-typedef struct WagonOverride {
+struct WagonOverride {
 	byte *train_id;
 	int trains;
 	CargoID cargo;
 	const SpriteGroup *group;
-} WagonOverride;
+};
 
-typedef struct WagonOverrides {
+struct WagonOverrides {
 	int overrides_count;
 	WagonOverride *overrides;
-} WagonOverrides;
+};
 
 static WagonOverrides _engine_wagon_overrides[TOTAL_NUM_ENGINES];
 
@@ -85,7 +85,7 @@
 /**
  * Unload all wagon override sprite groups.
  */
-void UnloadWagonOverrides(void)
+void UnloadWagonOverrides()
 {
 	WagonOverrides *wos;
 	WagonOverride *wo;
@@ -123,7 +123,7 @@
 /**
  * Unload all engine sprite groups.
  */
-void UnloadCustomEngineSprites(void)
+void UnloadCustomEngineSprites()
 {
 	memset(_engine_custom_sprites, 0, sizeof(_engine_custom_sprites));
 	memset(_engine_grf, 0, sizeof(_engine_grf));
@@ -144,7 +144,7 @@
 }
 
 /** Unload all rotor override sprite groups */
-void UnloadRotorOverrideSprites(void)
+void UnloadRotorOverrideSprites()
 {
 	EngineID engine;
 
@@ -195,7 +195,7 @@
 
 static int MapOldSubType(const Vehicle *v)
 {
-	if (v->type != VEH_Train) return v->subtype;
+	if (v->type != VEH_TRAIN) return v->subtype;
 	if (IsTrainEngine(v)) return 0;
 	if (IsFreeWagon(v)) return 4;
 	return 2;
@@ -489,7 +489,7 @@
 	switch (variable) {
 		case 0x40: /* Get length of consist */
 		case 0x41: /* Get length of same consecutive wagons */
-			if (v->type != VEH_Train) return 1;
+			if (v->type != VEH_TRAIN) return 1;
 
 			{
 				const Vehicle* u;
@@ -545,7 +545,7 @@
 			return v->owner;
 
 		case 0x44: /* Aircraft information */
-			if (v->type != VEH_Aircraft) return UINT_MAX;
+			if (v->type != VEH_AIRCRAFT) return UINT_MAX;
 
 			{
 				const Vehicle *w = v->next;
@@ -590,7 +590,7 @@
 
 		/* Variables which use the parameter */
 		case 0x60: /* Count consist's engine ID occurance */
-			if (v->type != VEH_Train) return v->engine_type == parameter;
+			if (v->type != VEH_TRAIN) return v->engine_type == parameter;
 
 			{
 				uint count = 0;
@@ -699,7 +699,7 @@
 
 	/* Vehicle specific properties */
 	switch (v->type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			switch (variable - 0x80) {
 				case 0x62: return v->u.rail.track;
 				case 0x66: return v->u.rail.railtype;
@@ -714,7 +714,7 @@
 			}
 			break;
 
-		case VEH_Road:
+		case VEH_ROAD:
 			switch (variable - 0x80) {
 				case 0x62: return v->u.road.state;
 				case 0x64: return v->u.road.blocked_ctr;
@@ -726,7 +726,7 @@
 			}
 			break;
 
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			switch (variable - 0x80) {
 				case 0x62: return MapAircraftMovementState(v);  // Current movement state
 				case 0x63: return v->u.air.targetairport;       // Airport to which the action refers
@@ -751,7 +751,7 @@
 
 	if (v == NULL) return group->g.real.loading[0];
 
-	if (v->type == VEH_Train) {
+	if (v->type == VEH_TRAIN) {
 		in_motion = GetFirstVehicleInChain(v)->current_order.type != OT_LOADING;
 	} else {
 		in_motion = v->current_order.type != OT_LOADING;
@@ -780,7 +780,7 @@
 	res->ResolveReal   = &VehicleResolveReal;
 
 	res->u.vehicle.self   = v;
-	res->u.vehicle.parent = (v != NULL && v->type == VEH_Train) ? GetFirstVehicleInChain(v) : v;
+	res->u.vehicle.parent = (v != NULL && v->type == VEH_TRAIN) ? GetFirstVehicleInChain(v) : v;
 
 	res->u.vehicle.self_type = engine_type;
 
@@ -812,7 +812,7 @@
 	} else {
 		cargo = v->cargo_type;
 
-		if (v->type == VEH_Train) {
+		if (v->type == VEH_TRAIN) {
 			group = GetWagonOverrideSpriteSet(engine, cargo, v->u.rail.first_engine);
 
 			if (group != NULL) return group;
@@ -874,7 +874,7 @@
  */
 bool UsesWagonOverride(const Vehicle* v)
 {
-	assert(v->type == VEH_Train);
+	assert(v->type == VEH_TRAIN);
 	return GetWagonOverrideSpriteSet(v->engine_type, v->cargo_type, v->u.rail.first_engine) != NULL;
 }
 
@@ -962,7 +962,7 @@
 			 * i.e.), so we give them all the NEW_CARGO triggered
 			 * vehicle's portion of random bits. */
 			assert(first);
-			DoTriggerVehicle((v->type == VEH_Train) ? GetFirstVehicleInChain(v) : v, VEHICLE_TRIGGER_ANY_NEW_CARGO, new_random_bits, false);
+			DoTriggerVehicle((v->type == VEH_TRAIN) ? GetFirstVehicleInChain(v) : v, VEHICLE_TRIGGER_ANY_NEW_CARGO, new_random_bits, false);
 			break;
 
 		case VEHICLE_TRIGGER_DEPOT:
@@ -1007,7 +1007,7 @@
 	_engine_custom_names[engine] = name;
 }
 
-void UnloadCustomEngineNames(void)
+void UnloadCustomEngineNames()
 {
 	EngineID i;
 	for (i = 0; i < TOTAL_NUM_ENGINES; i++) {
@@ -1025,7 +1025,7 @@
 static EngineID _engine_list_order[NUM_TRAIN_ENGINES];
 static byte _engine_list_position[NUM_TRAIN_ENGINES];
 
-void ResetEngineListOrder(void)
+void ResetEngineListOrder()
 {
 	EngineID i;
 
--- a/src/newgrf_engine.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_engine.h	Mon Mar 19 12:38:16 2007 +0000
@@ -36,7 +36,7 @@
 #define GetCustomVehicleSprite(v, direction) GetCustomEngineSprite(v->engine_type, v, direction)
 #define GetCustomVehicleIcon(et, direction) GetCustomEngineSprite(et, NULL, direction)
 
-typedef enum VehicleTrigger {
+enum VehicleTrigger {
 	VEHICLE_TRIGGER_NEW_CARGO     = 1,
 	// Externally triggered only for the first vehicle in chain
 	VEHICLE_TRIGGER_DEPOT         = 2,
@@ -44,18 +44,18 @@
 	VEHICLE_TRIGGER_EMPTY         = 4,
 	// Not triggered externally (called for the whole chain if we got NEW_CARGO)
 	VEHICLE_TRIGGER_ANY_NEW_CARGO = 8,
-} VehicleTrigger;
+};
 void TriggerVehicle(Vehicle *veh, VehicleTrigger trigger);
 
 void SetCustomEngineName(EngineID engine, StringID name);
 StringID GetCustomEngineName(EngineID engine);
 
-void UnloadWagonOverrides(void);
-void UnloadRotorOverrideSprites(void);
-void UnloadCustomEngineSprites(void);
-void UnloadCustomEngineNames(void);
+void UnloadWagonOverrides();
+void UnloadRotorOverrideSprites();
+void UnloadCustomEngineSprites();
+void UnloadCustomEngineNames();
 
-void ResetEngineListOrder(void);
+void ResetEngineListOrder();
 EngineID GetRailVehAtPosition(EngineID pos);
 uint16 ListPositionOfEngine(EngineID engine);
 void AlterRailVehListOrder(EngineID engine, EngineID target);
--- a/src/newgrf_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -91,8 +91,8 @@
 	}
 
 	/* Show flags */
-	if (HASBIT(c->flags, GCF_NOT_FOUND))  y += DrawStringMultiLine(x, y, STR_NEWGRF_NOT_FOUND, w);
-	if (HASBIT(c->flags, GCF_DISABLED))   y += DrawStringMultiLine(x, y, STR_NEWGRF_DISABLED, w);
+	if (c->status == GCS_NOT_FOUND)        y += DrawStringMultiLine(x, y, STR_NEWGRF_NOT_FOUND, w);
+	if (c->status == GCS_DISABLED)         y += DrawStringMultiLine(x, y, STR_NEWGRF_DISABLED, w);
 	if (HASBIT(c->flags, GCF_COMPATIBLE)) y += DrawStringMultiLine(x, y, STR_NEWGRF_COMPATIBLE_LOADED, w);
 
 	/* Draw GRF info if it exists */
@@ -106,10 +106,10 @@
 
 
 /* Dialogue for adding NewGRF files to the selection */
-typedef struct newgrf_add_d {
+struct newgrf_add_d {
 	GRFConfig **list;
 	const GRFConfig *sel;
-} newgrf_add_d;
+};
 
 
 static void NewGRFAddDlgWndProc(Window *w, WindowEvent *e)
@@ -236,14 +236,14 @@
 
 
 /* 'NewGRF Settings' dialogue */
-typedef struct newgrf_d {
+struct newgrf_d {
 	GRFConfig **orig_list; ///< grf list the window is shown with
 	GRFConfig **list;      ///< temporary grf list to which changes are made
 	GRFConfig *sel;        ///< selected grf item
 	bool editable;         ///< is the window editable
 	bool show_params;      ///< are the grf-parameters shown in the info-panel
 	bool execute;          ///< on pressing 'apply changes' are grf changes applied immediately, or only list is updated
-} newgrf_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(newgrf_d));
 
 
@@ -335,16 +335,23 @@
 					SpriteID pal;
 
 					/* Pick a colour */
-					if (HASBIT(c->flags, GCF_NOT_FOUND) || HASBIT(c->flags, GCF_DISABLED)) {
-						pal = PALETTE_TO_RED;
-					} else if (HASBIT(c->flags, GCF_STATIC)) {
+					switch (c->status) {
+						case GCS_NOT_FOUND:
+						case GCS_DISABLED:
+							pal = PALETTE_TO_RED;
+							break;
+						case GCS_ACTIVATED:
+							pal = PALETTE_TO_GREEN;
+							break;
+						default:
+							pal = PALETTE_TO_BLUE;
+							break;
+					}
+
+					if (HASBIT(c->flags, GCF_STATIC)) {
 						pal = PALETTE_TO_GREY;
 					} else if (HASBIT(c->flags, GCF_COMPATIBLE)) {
 						pal = PALETTE_TO_ORANGE;
-					} else if (HASBIT(c->flags, GCF_ACTIVATED)) {
-						pal = PALETTE_TO_GREEN;
-					} else {
-						pal = PALETTE_TO_BLUE;
 					}
 
 					DrawSprite(SPR_SQUARE, pal, 5, y + 2);
--- a/src/newgrf_sound.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_sound.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -15,7 +15,7 @@
 
 
 /* Allocate a new FileEntry */
-FileEntry *AllocateFileEntry(void)
+FileEntry *AllocateFileEntry()
 {
 	if (_sound_count == GetSoundInternalPoolSize()) {
 		if (!AddBlockToPool(&_SoundInternal_pool)) return NULL;
@@ -25,7 +25,7 @@
 }
 
 
-void InitializeSoundPool(void)
+void InitializeSoundPool()
 {
 	CleanPool(&_SoundInternal_pool);
 	_sound_count = 0;
@@ -42,7 +42,7 @@
 }
 
 
-uint GetNumSounds(void)
+uint GetNumSounds()
 {
 	return _sound_count;
 }
--- a/src/newgrf_sound.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_sound.h	Mon Mar 19 12:38:16 2007 +0000
@@ -3,7 +3,7 @@
 #ifndef NEWGRF_SOUND_H
 #define NEWGRF_SOUND_H
 
-typedef enum VehicleSoundEvents {
+enum VehicleSoundEvent {
 	VSE_START        = 1,
 	VSE_TUNNEL       = 2,
 	VSE_BREAKDOWN    = 3,
@@ -13,13 +13,13 @@
 	VSE_RUNNING_16   = 7,
 	VSE_STOPPED_16   = 8,
 	VSE_LOAD_UNLOAD  = 9,
-} VehicleSoundEvent;
+};
 
 
-FileEntry *AllocateFileEntry(void);
-void InitializeSoundPool(void);
+FileEntry *AllocateFileEntry();
+void InitializeSoundPool();
 FileEntry *GetSound(uint index);
-uint GetNumSounds(void);
+uint GetNumSounds();
 bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event);
 
 #endif /* NEWGRF_SOUND_H */
--- a/src/newgrf_spritegroup.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_spritegroup.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -49,7 +49,7 @@
 
 
 /* Allocate a new SpriteGroup */
-SpriteGroup *AllocateSpriteGroup(void)
+SpriteGroup *AllocateSpriteGroup()
 {
 	/* This is totally different to the other pool allocators, as we never remove an item from the pool. */
 	if (_spritegroup_count == GetSpriteGroupPoolSize()) {
@@ -60,7 +60,7 @@
 }
 
 
-void InitializeSpriteGroupPool(void)
+void InitializeSpriteGroupPool()
 {
 	CleanPool(&_SpriteGroup_pool);
 
--- a/src/newgrf_spritegroup.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_spritegroup.h	Mon Mar 19 12:38:16 2007 +0000
@@ -4,12 +4,12 @@
 #define NEWGRF_SPRITEGROUP_H
 
 
-typedef struct SpriteGroup SpriteGroup;
+struct SpriteGroup;
 
 
 /* 'Real' sprite groups contain a list of other result or callback sprite
  * groups. */
-typedef struct RealSpriteGroup {
+struct RealSpriteGroup {
 	// Loaded = in motion, loading = not moving
 	// Each group contains several spritesets, for various loading stages
 
@@ -21,28 +21,28 @@
 	byte num_loading;      ///< Number of loading groups
 	const SpriteGroup **loaded;  ///< List of loaded groups (can be SpriteIDs or Callback results)
 	const SpriteGroup **loading; ///< List of loading groups (can be SpriteIDs or Callback results)
-} RealSpriteGroup;
+};
 
 /* Shared by deterministic and random groups. */
-typedef enum VarSpriteGroupScopes {
+enum VarSpriteGroupScope {
 	VSG_SCOPE_SELF,
 	// Engine of consists for vehicles, city for stations.
 	VSG_SCOPE_PARENT,
-} VarSpriteGroupScope;
+};
 
-typedef enum DeterministicSpriteGroupSizes {
+enum DeterministicSpriteGroupSize {
 	DSG_SIZE_BYTE,
 	DSG_SIZE_WORD,
 	DSG_SIZE_DWORD,
-} DeterministicSpriteGroupSize;
+};
 
-typedef enum DeterministicSpriteGroupAdjustTypes {
+enum DeterministicSpriteGroupAdjustType {
 	DSGA_TYPE_NONE,
 	DSGA_TYPE_DIV,
 	DSGA_TYPE_MOD,
-} DeterministicSpriteGroupAdjustType;
+};
 
-typedef enum DeterministicSpriteGroupAdjustOperations {
+enum DeterministicSpriteGroupAdjustOperation {
 	DSGA_OP_ADD,  // a + b
 	DSGA_OP_SUB,  // a - b
 	DSGA_OP_SMIN, // (signed) min(a, b)
@@ -57,10 +57,10 @@
 	DSGA_OP_AND,  // a & b
 	DSGA_OP_OR,   // a | b
 	DSGA_OP_XOR,  // a ^ b
-} DeterministicSpriteGroupAdjustOperation;
+};
 
 
-typedef struct DeterministicSpriteGroupAdjust {
+struct DeterministicSpriteGroupAdjust {
 	DeterministicSpriteGroupAdjustOperation operation;
 	DeterministicSpriteGroupAdjustType type;
 	byte variable;
@@ -70,17 +70,17 @@
 	uint32 add_val;
 	uint32 divmod_val;
 	const SpriteGroup *subroutine;
-} DeterministicSpriteGroupAdjust;
+};
 
 
-typedef struct DeterministicSpriteGroupRange {
+struct DeterministicSpriteGroupRange {
 	const SpriteGroup *group;
 	uint32 low;
 	uint32 high;
-} DeterministicSpriteGroupRange;
+};
 
 
-typedef struct DeterministicSpriteGroup {
+struct DeterministicSpriteGroup {
 	VarSpriteGroupScope var_scope;
 	DeterministicSpriteGroupSize size;
 	byte num_adjusts;
@@ -90,14 +90,14 @@
 
 	// Dynamically allocated, this is the sole owner
 	const SpriteGroup *default_group;
-} DeterministicSpriteGroup;
+};
 
-typedef enum RandomizedSpriteGroupCompareModes {
+enum RandomizedSpriteGroupCompareMode {
 	RSG_CMP_ANY,
 	RSG_CMP_ALL,
-} RandomizedSpriteGroupCompareMode;
+};
 
-typedef struct RandomizedSpriteGroup {
+struct RandomizedSpriteGroup {
 	// Take this object:
 	VarSpriteGroupScope var_scope;
 
@@ -111,32 +111,32 @@
 
 	// Take the group with appropriate index:
 	const SpriteGroup **groups;
-} RandomizedSpriteGroup;
+};
 
 
 /* This contains a callback result. A failed callback has a value of
  * CALLBACK_FAILED */
-typedef struct CallbackResultSpriteGroup {
+struct CallbackResultSpriteGroup {
 	uint16 result;
-} CallbackResultSpriteGroup;
+};
 
 
 /* A result sprite group returns the first SpriteID and the number of
  * sprites in the set */
-typedef struct ResultSpriteGroup {
+struct ResultSpriteGroup {
 	SpriteID sprite;
 	byte num_sprites;
-} ResultSpriteGroup;
+};
 
 /* List of different sprite group types */
-typedef enum SpriteGroupType {
+enum SpriteGroupType {
 	SGT_INVALID,
 	SGT_REAL,
 	SGT_DETERMINISTIC,
 	SGT_RANDOMIZED,
 	SGT_CALLBACK,
 	SGT_RESULT,
-} SpriteGroupType;
+};
 
 /* Common wrapper for all the different sprite group types */
 struct SpriteGroup {
@@ -152,11 +152,11 @@
 };
 
 
-SpriteGroup *AllocateSpriteGroup(void);
-void InitializeSpriteGroupPool(void);
+SpriteGroup *AllocateSpriteGroup();
+void InitializeSpriteGroupPool();
 
 
-typedef struct ResolverObject {
+struct ResolverObject {
 	uint16 callback;
 	uint32 callback_param1;
 	uint32 callback_param2;
@@ -187,7 +187,7 @@
 	void (*SetTriggers)(const struct ResolverObject*, int);
 	uint32 (*GetVariable)(const struct ResolverObject*, byte, byte, bool*);
 	const SpriteGroup *(*ResolveReal)(const struct ResolverObject*, const SpriteGroup*);
-} ResolverObject;
+};
 
 
 /* Base sprite group resolver */
--- a/src/newgrf_station.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_station.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -31,7 +31,7 @@
  * This includes initialising the Default and Waypoint classes with an empty
  * entry, for standard stations and waypoints.
  */
-void ResetStationClasses(void)
+void ResetStationClasses()
 {
 	for (StationClassID i = STAT_CLASS_BEGIN; i < STAT_CLASS_MAX; i++) {
 		station_classes[i].id = 0;
@@ -95,7 +95,7 @@
 /** Build a list of station class name StringIDs to use in a dropdown list
  * @return Pointer to a (static) array of StringIDs
  */
-StringID *BuildStationClassDropdown(void)
+StringID *BuildStationClassDropdown()
 {
 	/* Allow room for all station classes, plus a terminator entry */
 	static StringID names[STAT_CLASS_MAX + 1];
@@ -115,7 +115,7 @@
  * Get the number of station classes in use.
  * @return Number of station classes.
  */
-uint GetNumStationClasses(void)
+uint GetNumStationClasses()
 {
 	uint i;
 	for (i = 0; i < STAT_CLASS_MAX && station_classes[i].id != 0; i++);
--- a/src/newgrf_station.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_station.h	Mon Mar 19 12:38:16 2007 +0000
@@ -9,12 +9,12 @@
 #include "newgrf_cargo.h"
 #include "helpers.hpp"
 
-typedef enum {
+enum StationClassID {
 	STAT_CLASS_BEGIN = 0,    ///< the lowest valid value
 	STAT_CLASS_DFLT = 0,     ///< Default station class.
 	STAT_CLASS_WAYP,         ///< Waypoint class.
 	STAT_CLASS_MAX = 32,     ///< Maximum number of classes.
-} StationClassID;
+};
 
 /** Define basic enum properties */
 template <> struct EnumPropsT<StationClassID> : MakeEnumPropsT<StationClassID, byte, STAT_CLASS_BEGIN, STAT_CLASS_MAX, STAT_CLASS_MAX> {};
@@ -27,7 +27,7 @@
  * where index is computed as (x * platforms) + platform. */
 typedef byte *StationLayout;
 
-typedef struct StationSpec {
+struct StationSpec {
 	uint32 grfid; ///< ID of GRF file station belongs to.
 	int localidx; ///< Index within GRF file of station.
 
@@ -84,25 +84,25 @@
 	 * evaluating callbacks.
 	 */
 	const struct SpriteGroup *spritegroup[NUM_CARGO + 3];
-} StationSpec;
+};
 
 /**
  * Struct containing information relating to station classes.
  */
-typedef struct StationClass {
+struct StationClass {
 	uint32 id;          ///< ID of this class, e.g. 'DFLT', 'WAYP', etc.
 	StringID name;      ///< Name of this class.
 	uint stations;      ///< Number of stations in this class.
 	StationSpec **spec; ///< Array of station specifications.
-} StationClass;
+};
 
-void ResetStationClasses(void);
+void ResetStationClasses();
 StationClassID AllocateStationClass(uint32 cls);
 void SetStationClassName(StationClassID sclass, StringID name);
 StringID GetStationClassName(StationClassID sclass);
-StringID *BuildStationClassDropdown(void);
+StringID *BuildStationClassDropdown();
 
-uint GetNumStationClasses(void);
+uint GetNumStationClasses();
 uint GetNumCustomStations(StationClassID sclass);
 
 void SetCustomStationSpec(StationSpec *statspec);
--- a/src/newgrf_text.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_text.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -30,16 +30,16 @@
  * the grf base will not be used in order to find the string, but rather for
  * jumping from standard langID scheme to the new one.
  */
-typedef enum grf_base_languages {
+enum grf_base_languages {
 	GRFLB_AMERICAN    = 0x01,
 	GRFLB_ENGLISH     = 0x02,
 	GRFLB_GERMAN      = 0x04,
 	GRFLB_FRENCH      = 0x08,
 	GRFLB_SPANISH     = 0x10,
 	GRFLB_GENERIC     = 0x80,
-} grf_base_language;
+};
 
-typedef enum grf_extended_languages {
+enum grf_extended_languages {
 	GRFLX_AMERICAN    = 0x00,
 	GRFLX_ENGLISH     = 0x01,
 	GRFLX_GERMAN      = 0x02,
@@ -73,13 +73,13 @@
 	GRFLX_CROATIAN    = 0x38,
 	GRFLX_TURKISH     = 0x3E,
 	GRFLX_UNSPECIFIED = 0x7F,
-} grf_language;
+};
 
 
-typedef struct iso_grf {
+struct iso_grf {
 	char code[6];
 	byte grfLangID;
-} iso_grf;
+};
 
 /**
  * ISO code VS NewGrf langID conversion array.
@@ -170,12 +170,12 @@
  * Putting both grfid and stringid together allows us to avoid duplicates,
  * since it is NOT SUPPOSED to happen.
  */
-typedef struct GRFTextEntry {
+struct GRFTextEntry {
 	uint32 grfid;
 	uint16 stringid;
 	StringID def_string;
 	GRFText *textholder;
-} GRFTextEntry;
+};
 
 
 static uint _num_grf_texts = 0;
@@ -441,7 +441,7 @@
  * House cleaning.
  * Remove all strings and reset the text counter.
  */
-void CleanUpStrings(void)
+void CleanUpStrings()
 {
 	uint id;
 
--- a/src/newgrf_text.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/newgrf_text.h	Mon Mar 19 12:38:16 2007 +0000
@@ -9,7 +9,7 @@
 StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid, bool new_scheme, const char *text_to_add, StringID def_string);
 StringID GetGRFStringID(uint32 grfid, uint16 stringid);
 char *GetGRFString(char *buff, uint16 stringid, const char* last);
-void CleanUpStrings(void);
+void CleanUpStrings();
 void SetCurrentGrfLangID(const char *iso_name);
 char *TranslateTTDPatchCodes(const char *str);
 
--- a/src/news.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/news.h	Mon Mar 19 12:38:16 2007 +0000
@@ -24,25 +24,29 @@
 
 #define NEWS_FLAGS(mode,flag,type,cb) ((cb)<<24 | (type)<<16 | (flag)<<8 | (mode))
 void AddNewsItem(StringID string, uint32 flags, uint data_a, uint data_b);
-void NewsLoop(void);
+void NewsLoop();
 void DrawNewsBorder(const Window *w);
-void InitNewsItemStructs(void);
+void InitNewsItemStructs();
 
 VARDEF NewsItem _statusbar_news_item;
 
 enum NewsType {
-	NT_ARRIVAL_PLAYER = 0,
-	NT_ARRIVAL_OTHER  = 1,
-	NT_ACCIDENT       = 2,
-	NT_COMPANY_INFO   = 3,
-	NT_ECONOMY        = 4,
-	NT_ADVICE         = 5,
-	NT_NEW_VEHICLES   = 6,
-	NT_ACCEPTANCE     = 7,
-	NT_SUBSIDIES      = 8,
-	NT_GENERAL        = 9,
+	NT_ARRIVAL_PLAYER,
+	NT_ARRIVAL_OTHER,
+	NT_ACCIDENT,
+	NT_COMPANY_INFO,
+	NT_OPENCLOSE,
+	NT_ECONOMY,
+	NT_ADVICE,
+	NT_NEW_VEHICLES,
+	NT_ACCEPTANCE,
+	NT_SUBSIDIES,
+	NT_GENERAL,
+	NT_END,
 };
 
+extern const char *_news_display_name[NT_END];
+
 enum NewsMode {
 	NM_SMALL    = 0, ///< Show only a small popup informing us about vehicle age for example
 	NM_NORMAL   = 1, ///< Show a simple news message (height 170 pixels)
--- a/src/news_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/news_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file news_gui.cpp */
+
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
@@ -38,6 +40,7 @@
  */
 
 #define MAX_NEWS 30
+#define NB_WIDG_PER_SETTING 4
 
 typedef byte NewsID;
 #define INVALID_NEWS 255
@@ -55,7 +58,7 @@
 
 void DrawNewsNewVehicleAvail(Window *w);
 void DrawNewsBankrupcy(Window *w);
-static void MoveToNextItem(void);
+static void MoveToNextItem();
 
 StringID GetNewsStringNewVehicleAvail(const NewsItem *ni);
 StringID GetNewsStringBankrupcy(const NewsItem *ni);
@@ -71,7 +74,7 @@
 	GetNewsStringBankrupcy,        /* DNC_BANKRUPCY */
 };
 
-void InitNewsItemStructs(void)
+void InitNewsItemStructs()
 {
 	memset(_news_items, 0, sizeof(_news_items));
 	_current_news = INVALID_NEWS;
@@ -352,17 +355,32 @@
 	NewsWindowProc
 };
 
-static const SoundFx _news_sounds[] = {
+static const SoundFx _news_sounds[NT_END] = {
 	SND_1D_APPLAUSE,
 	SND_1D_APPLAUSE,
 	SND_BEGIN,
 	SND_BEGIN,
 	SND_BEGIN,
 	SND_BEGIN,
+	SND_BEGIN,
 	SND_1E_OOOOH,
 	SND_BEGIN,
 	SND_BEGIN,
-	SND_BEGIN
+	SND_BEGIN,
+};
+
+const char *_news_display_name[NT_END] = {
+	"arrival_player",
+	"arrival_other",
+	"accident",
+	"company_info",
+	"openclose",
+	"economy",
+	"advice",
+	"new_vehicles",
+	"acceptance",
+	"subsidies",
+	"general",
 };
 
 /** Get the value of an item of the news-display settings. This is
@@ -372,7 +390,7 @@
  */
 static inline byte GetNewsDisplayValue(byte item)
 {
-	assert(item < 10 && GB(_news_display_opt, item * 2, 2) <= 2);
+	assert(item < NT_END && GB(_news_display_opt, item * 2, 2) <= 2);
 	return GB(_news_display_opt, item * 2, 2);
 }
 
@@ -383,7 +401,7 @@
  */
 static inline void SetNewsDisplayValue(byte item, byte val)
 {
-	assert(item < 10 && val <= 2);
+	assert(item < NT_END && val <= 2);
 	SB(_news_display_opt, item * 2, 2, val);
 }
 
@@ -452,7 +470,7 @@
 
 // Are we ready to show another news item?
 // Only if nothing is in the newsticker and no newspaper is displayed
-static bool ReadyForNextItem(void)
+static bool ReadyForNextItem()
 {
 	const Window *w;
 	NewsID item = (_forced_news == INVALID_NEWS) ? _current_news : _forced_news;
@@ -473,7 +491,7 @@
 	return (ni->duration == 0 || FindWindowById(WC_NEWS_WINDOW, 0) == NULL);
 }
 
-static void MoveToNextItem(void)
+static void MoveToNextItem()
 {
 	DeleteWindowById(WC_NEWS_WINDOW, 0);
 	_forced_news = INVALID_NEWS;
@@ -513,7 +531,7 @@
 	}
 }
 
-void NewsLoop(void)
+void NewsLoop()
 {
 	// no news item yet
 	if (_total_news == 0) return;
@@ -541,7 +559,7 @@
 	}
 }
 
-void ShowLastNewsMessage(void)
+void ShowLastNewsMessage()
 {
 	if (_forced_news == INVALID_NEWS) {
 		/* Not forced any news yet, show the current one, unless a news window is
@@ -681,7 +699,7 @@
 	MessageHistoryWndProc
 };
 
-void ShowMessageHistory(void)
+void ShowMessageHistory()
 {
 	Window *w;
 
@@ -699,167 +717,199 @@
 	}
 }
 
+
+enum {
+	WIDGET_NEWSOPT_BTN_SUMMARY  = 4,  ///< Button that adjusts at once the level for all settings
+	WIDGET_NEWSOPT_DROP_SUMMARY,      ///< Drop down button for same upper button
+	WIDGET_NEWSOPT_SOUNDTICKER  = 7,  ///< Button activating sound on events
+	WIDGET_NEWSOPT_START_OPTION = 9,  ///< First widget that is part of a group [<] .. [.]
+};
+
 /** Setup the disabled/enabled buttons in the message window
  * If the value is 'off' disable the [<] widget, and enable the [>] one
- * Same-wise for all the others. Starting value of 3 is the first widget
+ * Same-wise for all the others. Starting value of 4 is the first widget
  * group. These are grouped as [<][>] .. [<][>], etc.
+ * @param w Window been used
+ * @param value to set in the widget
+ * @param element index of the group of widget to set
  */
 static void SetMessageButtonStates(Window *w, byte value, int element)
 {
-	element *= 2;
+	element *= NB_WIDG_PER_SETTING;
 
-	SetWindowWidgetDisabledState(w, element + 3, value == 0);
-	SetWindowWidgetDisabledState(w, element + 3 + 1, value == 2);
+	SetWindowWidgetDisabledState(w, element + WIDGET_NEWSOPT_START_OPTION, value == 0);
+	SetWindowWidgetDisabledState(w, element + WIDGET_NEWSOPT_START_OPTION + 2, value == 2);
 }
 
+/**
+ * Event handler of the Message Options window
+ * @param w window pointer
+ * @param e event been triggered
+ */
 static void MessageOptionsWndProc(Window *w, WindowEvent *e)
 {
 	static const StringID message_opt[] = {STR_OFF, STR_SUMMARY, STR_FULL, INVALID_STRING_ID};
 
-	/* WP(w, def_d).data_1 are stores the clicked state of the fake widgets
-	 * WP(w, def_d).data_2 stores state of the ALL on/off/summary button */
+	/* WP(w, def_d).data_1 stores state of the ALL on/off/summary button */
 	switch (e->event) {
-	case WE_CREATE: {
-		uint32 val = _news_display_opt;
-		int i;
-		WP(w, def_d).data_1 = WP(w, def_d).data_2 = 0;
-
-		// Set up the initial disabled buttons in the case of 'off' or 'full'
-		for (i = 0; i != 10; i++, val >>= 2) SetMessageButtonStates(w, val & 0x3, i);
-	} break;
-
-	case WE_PAINT: {
-		uint32 val = _news_display_opt;
-		int click_state = WP(w, def_d).data_1;
-		int i, y;
-
-		if (_news_ticker_sound) LowerWindowWidget(w, 25);
-		DrawWindowWidgets(w);
-
-		/* XXX - Draw the fake widgets-buttons. Can't add these to the widget-desc since
-		 * openttd currently can only handle 32 widgets. So hack it *g* */
-		for (i = 0, y = 26; i != 10; i++, y += 12, click_state >>= 1, val >>= 2) {
-			bool clicked = !!(click_state & 1);
-
-			DrawFrameRect(13, y, 89, 11 + y, 3, (clicked) ? FR_LOWERED : FR_NONE);
-			DrawStringCentered(((13 + 89 + 1) >> 1) + clicked, ((y + 11 + y + 1) >> 1) - 5 + clicked, message_opt[val & 0x3], 0x10);
-			DrawString(103, y + 1, i + STR_0206_ARRIVAL_OF_FIRST_VEHICLE, 0);
-		}
-
-		DrawString(  8, y + 9, message_opt[WP(w, def_d).data_2], 0x10);
-		DrawString(103, y + 9, STR_MESSAGES_ALL, 0);
-		DrawString(103, y + 9 + 12, STR_MESSAGE_SOUND, 0);
+		case WE_CREATE: {
+			uint32 val = _news_display_opt;
+			uint32 all_val;
+			int i;
 
-	} break;
-
-	case WE_CLICK:
-		switch (e->we.click.widget) {
-		case 2: /* Clicked on any of the fake widgets */
-			if (e->we.click.pt.x > 13 && e->we.click.pt.x < 89 && e->we.click.pt.y > 26 && e->we.click.pt.y < 146) {
-				int element = (e->we.click.pt.y - 26) / 12;
-				byte val = (GetNewsDisplayValue(element) + 1) % 3;
-
-				SetMessageButtonStates(w, val, element);
-				SetNewsDisplayValue(element, val);
-
-				WP(w, def_d).data_1 |= (1 << element);
-				w->flags4 |= 5 << WF_TIMEOUT_SHL; // XXX - setup unclick (fake widget)
-				SetWindowDirty(w);
+			/* Set up the initial disabled buttons in the case of 'off' or 'full' */
+			all_val = val & 0x3;
+			for (i = 0; i < NT_END; i++, val >>= 2) {
+				SetMessageButtonStates(w, val & 0x3, i);
+				/* If the value doesn't match the ALL-button value, set the ALL-button value to 'off' */
+				if ((val & 0x3) != all_val) all_val = 0;
 			}
-			break;
-		case 23: case 24: /* Dropdown menu for all settings */
-			ShowDropDownMenu(w, message_opt, WP(w, def_d).data_2, 24, 0, 0);
-			break;
-		case 25: /* Change ticker sound on/off */
-			_news_ticker_sound ^= 1;
-			ToggleWidgetLoweredState(w, e->we.click.widget);
-			InvalidateWidget(w, e->we.click.widget);
-			break;
-		default: { /* Clicked on the [<] .. [>] widgets */
-			int wid = e->we.click.widget;
-			if (wid > 2 && wid < 23) {
-				int element = (wid - 3) / 2;
-				byte val = (GetNewsDisplayValue(element) + ((wid & 1) ? -1 : 1)) % 3;
-
-				SetMessageButtonStates(w, val, element);
-				SetNewsDisplayValue(element, val);
-				SetWindowDirty(w);
-			}
-		} break;
+			/* If all values are the same value, the ALL-button will take over this value */
+			WP(w, def_d).data_1 = all_val;
 		} break;
 
-	case WE_DROPDOWN_SELECT: {/* Select all settings for newsmessages */
-		int i;
-
-		WP(w, def_d).data_2 = e->we.dropdown.index;
+		case WE_PAINT: {
+			uint32 val = _news_display_opt;
+			int i, y;
 
-		for (i = 0; i != 10; i++) {
-			SB(_news_display_opt, i*2, 2, e->we.dropdown.index);
-			SetMessageButtonStates(w, e->we.dropdown.index, i);
-		}
-		SetWindowDirty(w);
-		break;
-		}
+			if (_news_ticker_sound) LowerWindowWidget(w, WIDGET_NEWSOPT_SOUNDTICKER);
+			DrawWindowWidgets(w);
 
-	case WE_TIMEOUT: /* XXX - Hack to animate 'fake' buttons */
-		WP(w, def_d).data_1 = 0;
-		SetWindowDirty(w);
-		break;
+			/* Draw the string of each setting on each button. */
+			for (i = 0, y = 26; i < NT_END; i++, y += 12, val >>= 2) {
+				/* 51 comes from 13 + 89 (left and right of the button)+1, shiefted by one as to get division,
+				 * which will give centered position */
+				DrawStringCentered(51, y + 1, message_opt[val & 0x3], 0x10);
+			}
+
+			/* Draw the general bottom button string as well */
+			DrawStringCentered(51, y + 10, message_opt[WP(w, def_d).data_1], 0x10);
+		} break;
+
+		case WE_CLICK:
+			switch (e->we.click.widget) {
+				case WIDGET_NEWSOPT_BTN_SUMMARY:
+				case WIDGET_NEWSOPT_DROP_SUMMARY: // Dropdown menu for all settings
+					ShowDropDownMenu(w, message_opt, WP(w, def_d).data_1, WIDGET_NEWSOPT_DROP_SUMMARY, 0, 0);
+					break;
+
+				case WIDGET_NEWSOPT_SOUNDTICKER: // Change ticker sound on/off
+					_news_ticker_sound ^= 1;
+					ToggleWidgetLoweredState(w, e->we.click.widget);
+					InvalidateWidget(w, e->we.click.widget);
+					break;
+
+				default: { // Clicked on the [<] .. [>] widgets
+					int wid = e->we.click.widget - WIDGET_NEWSOPT_START_OPTION;
+					if (wid >= 0 && wid < (NB_WIDG_PER_SETTING * NT_END)) {
+						int element = wid / NB_WIDG_PER_SETTING;
+						byte val = (GetNewsDisplayValue(element) + ((wid % NB_WIDG_PER_SETTING) ? 1 : -1)) % 3;
+
+						SetMessageButtonStates(w, val, element);
+						SetNewsDisplayValue(element, val);
+						SetWindowDirty(w);
+					}
+				} break;
+			} break;
+
+		case WE_DROPDOWN_SELECT: { // Select all settings for newsmessages
+			int i;
+
+			WP(w, def_d).data_1 = e->we.dropdown.index;
+
+			for (i = 0; i < NT_END; i++) {
+				SetMessageButtonStates(w, e->we.dropdown.index, i);
+				SetNewsDisplayValue(i, e->we.dropdown.index);
+			}
+			SetWindowDirty(w);
+		} break;
 	}
 }
 
 static const Widget _message_options_widgets[] = {
-{   WWT_CLOSEBOX,   RESIZE_NONE,    13,     0,   10,     0,    13, STR_00C5,                 STR_018B_CLOSE_WINDOW},
-{    WWT_CAPTION,   RESIZE_NONE,    13,    11,  409,     0,    13, STR_0204_MESSAGE_OPTIONS, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{      WWT_PANEL,   RESIZE_NONE,    13,     0,  409,    14,   184, 0x0,                      STR_NULL},
-
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    26,    37, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    26,    37, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
-
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    38,    49, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    38,    49, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
-
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    50,    61, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    50,    61, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
-
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    62,    73, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    62,    73, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
-
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    74,    85, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    74,    85, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
+{   WWT_CLOSEBOX,   RESIZE_NONE,    13,     0,   10,     0,    13, STR_00C5,                              STR_018B_CLOSE_WINDOW},
+{    WWT_CAPTION,   RESIZE_NONE,    13,    11,  409,     0,    13, STR_0204_MESSAGE_OPTIONS,              STR_018C_WINDOW_TITLE_DRAG_THIS},
+{      WWT_PANEL,   RESIZE_NONE,    13,     0,  409,    14,   196, 0x0,                                   STR_NULL},
 
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    86,    97, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    86,    97, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
-
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    98,   109, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    98,   109, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
-
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,   110,   121, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,   110,   121, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
+/* Text at the top of the main panel, in black */
+{      WWT_LABEL,   RESIZE_NONE,    13,     0,  409,    13,    26, STR_0205_MESSAGE_TYPES,                STR_NULL},
 
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,   122,   133, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,   122,   133, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
+/* General drop down and sound button */
+{      WWT_PANEL,   RESIZE_NONE,     3,     4,   86,   166,   177, 0x0,                                   STR_NULL},
+{    WWT_TEXTBTN,   RESIZE_NONE,     3,    87,   98,   166,   177, STR_0225,                              STR_NULL},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,   167,   179, STR_MESSAGES_ALL,                      STR_NULL},
 
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,   134,   145, SPR_ARROW_LEFT,           STR_HSCROLL_BAR_SCROLLS_LIST},
-{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,   134,   145, SPR_ARROW_RIGHT,          STR_HSCROLL_BAR_SCROLLS_LIST},
+{  WWT_TEXTBTN_2,   RESIZE_NONE,     3,     4,   98,   178,   189, STR_02DB_OFF,                          STR_NULL},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,   179,   191, STR_MESSAGE_SOUND,                     STR_NULL},
 
-{      WWT_PANEL,   RESIZE_NONE,     3,     4,   86,   154,   165, 0x0,                      STR_NULL},
-{    WWT_TEXTBTN,   RESIZE_NONE,     3,    87,   98,   154,   165, STR_0225,                 STR_NULL},
-{  WWT_TEXTBTN_2,   RESIZE_NONE,     3,     4,   98,   166,   177, STR_02DB_OFF,             STR_NULL},
+/* Each four group is composed of the buttons [<] [..] [>] and the descriptor of the setting */
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    26,    37, SPR_ARROW_LEFT,                        STR_HSCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    13,   89,    26,    37, STR_EMPTY,                             STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    26,    37, SPR_ARROW_RIGHT,                       STR_HSCROLL_BAR_SCROLLS_LIST},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,    27,    39, STR_0206_ARRIVAL_OF_FIRST_VEHICLE,     STR_NULL},
 
-{      WWT_LABEL,   RESIZE_NONE,    13,     0,  409,    13,    26, STR_0205_MESSAGE_TYPES,   STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    38,    49, SPR_ARROW_LEFT,                        STR_HSCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    13,   89,    38,    49, STR_EMPTY,                             STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    38,    49, SPR_ARROW_RIGHT,                       STR_HSCROLL_BAR_SCROLLS_LIST},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,    39,    51, STR_0207_ARRIVAL_OF_FIRST_VEHICLE,     STR_NULL},
+
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    50,    61, SPR_ARROW_LEFT,                        STR_HSCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    13,   89,    50,    61, STR_EMPTY,                             STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    50,    61, SPR_ARROW_RIGHT,                       STR_HSCROLL_BAR_SCROLLS_LIST},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,    51,    63, STR_0208_ACCIDENTS_DISASTERS,          STR_NULL},
+
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    62,    73, SPR_ARROW_LEFT,                        STR_HSCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    13,   89,    62,    73, STR_EMPTY,                             STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    62,    73, SPR_ARROW_RIGHT,                       STR_HSCROLL_BAR_SCROLLS_LIST},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,    63,    75, STR_0209_COMPANY_INFORMATION,          STR_NULL},
+
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    74,    85, SPR_ARROW_LEFT,                        STR_HSCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    13,   89,    74,    85, STR_EMPTY,                             STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    74,    85, SPR_ARROW_RIGHT,                       STR_HSCROLL_BAR_SCROLLS_LIST},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,    75,    87, STR_NEWS_OPEN_CLOSE,                   STR_NULL},
+
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    86,    97, SPR_ARROW_LEFT,                        STR_HSCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    13,   89,    86,    97, STR_EMPTY,                             STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    86,    97, SPR_ARROW_RIGHT,                       STR_HSCROLL_BAR_SCROLLS_LIST},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,    87,    99, STR_020A_ECONOMY_CHANGES,              STR_NULL},
+
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,    98,   109, SPR_ARROW_LEFT,                        STR_HSCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    13,   89,    98,   109, STR_EMPTY,                             STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,    98,   109, SPR_ARROW_RIGHT,                       STR_HSCROLL_BAR_SCROLLS_LIST},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,    99,   111, STR_020B_ADVICE_INFORMATION_ON_PLAYER, STR_NULL},
+
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,   110,   121, SPR_ARROW_LEFT,                        STR_HSCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    13,   89,   110,   121, STR_EMPTY,                             STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,   110,   121, SPR_ARROW_RIGHT,                       STR_HSCROLL_BAR_SCROLLS_LIST},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,   111,   123, STR_020C_NEW_VEHICLES,                 STR_NULL},
+
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,   122,   133, SPR_ARROW_LEFT,                        STR_HSCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    13,   89,   122,   133, STR_EMPTY,                             STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,   122,   133, SPR_ARROW_RIGHT,                       STR_HSCROLL_BAR_SCROLLS_LIST},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,   123,   135, STR_020D_CHANGES_OF_CARGO_ACCEPTANCE,  STR_NULL},
+
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,   134,   145, SPR_ARROW_LEFT,                        STR_HSCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    13,   89,   134,   145, STR_EMPTY,                             STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,   134,   145, SPR_ARROW_RIGHT,                       STR_HSCROLL_BAR_SCROLLS_LIST},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,   135,   147, STR_020E_SUBSIDIES,                    STR_NULL},
+
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,     4,   12,   146,   157, SPR_ARROW_LEFT,                        STR_HSCROLL_BAR_SCROLLS_LIST},
+{ WWT_PUSHTXTBTN,   RESIZE_NONE,     3,    13,   89,   146,   157, STR_EMPTY,                             STR_NULL},
+{ WWT_PUSHIMGBTN,   RESIZE_NONE,     3,    90,   98,   146,   157, SPR_ARROW_RIGHT,                       STR_HSCROLL_BAR_SCROLLS_LIST},
+{       WWT_TEXT,   RESIZE_NONE,     3,    103, 409,   147,   159, STR_020F_GENERAL_INFORMATION,          STR_NULL},
+
 {   WIDGETS_END},
 };
 
 static const WindowDesc _message_options_desc = {
-	270, 22, 410, 185,
+	270, 22, 410, 197,
 	WC_GAME_OPTIONS, WC_NONE,
 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
 	_message_options_widgets,
 	MessageOptionsWndProc
 };
 
-void ShowMessageOptions(void)
+void ShowMessageOptions()
 {
 	DeleteWindowById(WC_GAME_OPTIONS, 0);
 	AllocateWindowDesc(&_message_options_desc);
--- a/src/npf.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/npf.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -869,7 +869,7 @@
 	return best_result;
 }
 
-void InitializeNPF(void)
+void InitializeNPF()
 {
 	init_AyStar(&_npf_aystar, NPFHash, NPF_HASH_SIZE);
 	_npf_aystar.loops_per_tick = 0;
@@ -888,7 +888,7 @@
 	 * dest_tile, not just any stop of that station.
 	 * So only for train orders to stations we fill fstd->station_index, for all
 	 * others only dest_coords */
-	if (v->current_order.type == OT_GOTO_STATION && v->type == VEH_Train) {
+	if (v->current_order.type == OT_GOTO_STATION && v->type == VEH_TRAIN) {
 		fstd->station_index = v->current_order.dest;
 		/* Let's take the closest tile of the station as our target for trains */
 		fstd->dest_coords = CalcClosestStationTile(v->current_order.dest, v->tile);
--- a/src/npf.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/npf.h	Mon Mar 19 12:38:16 2007 +0000
@@ -35,10 +35,10 @@
 	NPF_INFINITE_PENALTY = 1000 * NPF_TILE_LENGTH
 };
 
-typedef struct NPFFindStationOrTileData { /* Meant to be stored in AyStar.targetdata */
+struct NPFFindStationOrTileData { /* Meant to be stored in AyStar.targetdata */
 	TileIndex dest_coords; /* An indication of where the station is, for heuristic purposes, or the target tile */
 	StationID station_index; /* station index we're heading for, or INVALID_STATION when we're heading for a tile */
-} NPFFindStationOrTileData;
+};
 
 enum { /* Indices into AyStar.userdata[] */
 	NPF_TYPE = 0, /* Contains a TransportTypes value */
@@ -51,18 +51,18 @@
 	NPF_NODE_FLAGS,
 };
 
-typedef enum { /* Flags for AyStarNode.userdata[NPF_NODE_FLAGS]. Use NPFGetBit() and NPFGetBit() to use them. */
+enum NPFNodeFlag { /* Flags for AyStarNode.userdata[NPF_NODE_FLAGS]. Use NPFGetBit() and NPFGetBit() to use them. */
 	NPF_FLAG_SEEN_SIGNAL, /* Used to mark that a signal was seen on the way, for rail only */
 	NPF_FLAG_REVERSE, /* Used to mark that this node was reached from the second start node, if applicable */
 	NPF_FLAG_LAST_SIGNAL_RED, /* Used to mark that the last signal on this path was red */
-} NPFNodeFlag;
+};
 
-typedef struct NPFFoundTargetData { /* Meant to be stored in AyStar.userpath */
+struct NPFFoundTargetData { /* Meant to be stored in AyStar.userpath */
 	uint best_bird_dist; /* The best heuristic found. Is 0 if the target was found */
 	uint best_path_dist; /* The shortest path. Is (uint)-1 if no path is found */
 	Trackdir best_trackdir; /* The trackdir that leads to the shortest path/closest birds dist */
 	AyStarNode node; /* The node within the target the search led us to */
-} NPFFoundTargetData;
+};
 
 /* These functions below are _not_ re-entrant, in favor of speed! */
 
--- a/src/oldloader.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/oldloader.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -27,7 +27,7 @@
 	OLD_MAP_SIZE = 256 * 256
 };
 
-typedef struct LoadgameState {
+struct LoadgameState {
 	FILE *file;
 
 	uint chunk_size;
@@ -41,10 +41,10 @@
 
 	uint total_read;
 	bool failed;
-} LoadgameState;
+};
 
 /* OldChunk-Type */
-typedef enum OldChunkTypes {
+enum OldChunkType {
 	OC_SIMPLE    = 0,
 	OC_NULL      = 1,
 	OC_CHUNK     = 2,
@@ -78,20 +78,20 @@
 	OC_TILE      = OC_VAR_U32  | OC_FILE_U16,
 
 	OC_END       = 0 ///< End of the whole chunk, all 32bits set to zero
-} OldChunkType;
+};
 
 DECLARE_ENUM_AS_BIT_SET(OldChunkType);
 
 typedef bool OldChunkProc(LoadgameState *ls, int num);
 
-typedef struct OldChunks {
+struct OldChunks {
 	OldChunkType type;   ///< Type of field
 	uint32 amount;       ///< Amount of fields
 
 	void *ptr;           ///< Pointer where to save the data (may only be set if offset is 0)
 	uint offset;         ///< Offset from basepointer (may only be set if ptr is NULL)
 	OldChunkProc *proc;  ///< Pointer to function that is called with OC_CHUNK
-} OldChunks;
+};
 
 /* If it fails, check lines above.. */
 assert_compile(sizeof(TileIndex) == 4);
@@ -290,7 +290,7 @@
 
 extern uint32 GetOldTownName(uint32 townnameparts, byte old_town_name_type);
 
-static void FixOldTowns(void)
+static void FixOldTowns()
 {
 	Town *town;
 
@@ -303,7 +303,7 @@
 	}
 }
 
-static void FixOldStations(void)
+static void FixOldStations()
 {
 	Station *st;
 
@@ -315,7 +315,7 @@
 	}
 }
 
-static void FixOldVehicles(void)
+static void FixOldVehicles()
 {
 	/* Check for shared orders, and link them correctly */
 	Vehicle* v;
@@ -374,7 +374,7 @@
 static uint16 _old_string_id_2;
 static uint16 _old_extra_chunk_nums;
 
-static void ReadTTDPatchFlags(void)
+static void ReadTTDPatchFlags()
 {
 	int i;
 
@@ -486,9 +486,9 @@
 	AssignOrder(GetOrder(num), UnpackOldOrder(_old_order));
 
 	/* Relink the orders to eachother (in TTD(Patch) the orders for one
-	vehicle are behind eachother, with OT_NOTHING as indication that
+	vehicle are behind eachother, with an invalid order (OT_NOTHING) as indication that
 	it is the last order */
-	if (num > 0 && GetOrder(num)->type != OT_NOTHING)
+	if (num > 0 && GetOrder(num)->IsValid())
 		GetOrder(num - 1)->next = GetOrder(num);
 
 	return true;
@@ -1068,13 +1068,13 @@
 	 * Basically v->type -= 0x10; would suffice, but play safely */
 	switch (v->type) {
 		default: NOT_REACHED();
-		case 0x00 /*VEH_Invalid */: v->type = VEH_Invalid;  res = LoadChunk(ls, NULL,           vehicle_empty_chunk);    break;
-		case 0x10 /*VEH_Train   */: v->type = VEH_Train;    res = LoadChunk(ls, &v->u.rail,     vehicle_train_chunk);    break;
-		case 0x11 /*VEH_Road    */: v->type = VEH_Road;     res = LoadChunk(ls, &v->u.road,     vehicle_road_chunk);     break;
-		case 0x12 /*VEH_Ship    */: v->type = VEH_Ship;     res = LoadChunk(ls, &v->u.ship,     vehicle_ship_chunk);     break;
-		case 0x13 /*VEH_Aircraft*/: v->type = VEH_Aircraft; res = LoadChunk(ls, &v->u.air,      vehicle_air_chunk);      break;
-		case 0x14 /*VEH_Special */: v->type = VEH_Special;  res = LoadChunk(ls, &v->u.special,  vehicle_special_chunk);  break;
-		case 0x15 /*VEH_Disaster*/: v->type = VEH_Disaster; res = LoadChunk(ls, &v->u.disaster, vehicle_disaster_chunk); break;
+		case 0x00 /*VEH_INVALID */: v->type = VEH_INVALID;  res = LoadChunk(ls, NULL,           vehicle_empty_chunk);    break;
+		case 0x10 /*VEH_TRAIN   */: v->type = VEH_TRAIN;    res = LoadChunk(ls, &v->u.rail,     vehicle_train_chunk);    break;
+		case 0x11 /*VEH_ROAD    */: v->type = VEH_ROAD;     res = LoadChunk(ls, &v->u.road,     vehicle_road_chunk);     break;
+		case 0x12 /*VEH_SHIP    */: v->type = VEH_SHIP;     res = LoadChunk(ls, &v->u.ship,     vehicle_ship_chunk);     break;
+		case 0x13 /*VEH_AIRCRAFT*/: v->type = VEH_AIRCRAFT; res = LoadChunk(ls, &v->u.air,      vehicle_air_chunk);      break;
+		case 0x14 /*VEH_SPECIAL */: v->type = VEH_SPECIAL;  res = LoadChunk(ls, &v->u.special,  vehicle_special_chunk);  break;
+		case 0x15 /*VEH_DISASTER*/: v->type = VEH_DISASTER; res = LoadChunk(ls, &v->u.disaster, vehicle_disaster_chunk); break;
 	}
 
 	/* This chunk size should always be 10 bytes */
@@ -1209,7 +1209,7 @@
 		v->string_id = RemapOldStringID(_old_string_id);
 
 		/* Vehicle-subtype is different in TTD(Patch) */
-		if (v->type == VEH_Special) v->subtype = v->subtype >> 1;
+		if (v->type == VEH_SPECIAL) v->subtype = v->subtype >> 1;
 	}
 
 	return true;
@@ -1611,7 +1611,7 @@
 
 	fclose(ls.file);
 
-	_pause = 2;
+	_pause_game = 2;
 
 	return true;
 }
--- a/src/oldpool.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/oldpool.h	Mon Mar 19 12:38:16 2007 +0000
@@ -3,7 +3,7 @@
 #ifndef OLDPOOL_H
 #define OLDPOOL_H
 
-typedef struct OldMemoryPool OldMemoryPool;
+struct OldMemoryPool;
 
 /* The function that is called after a new block is added
      start_item is the first item of the new made block */
@@ -68,7 +68,7 @@
 		); \
 	} \
 \
-	static inline uint Get##name##PoolSize(void) \
+	static inline uint Get##name##PoolSize() \
 	{ \
 		return _##name##_pool.total_items; \
 	}
--- a/src/openttd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/openttd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -64,14 +64,15 @@
 #include "road_map.h"
 #include "water_map.h"
 #include "industry_map.h"
+#include "unmovable_map.h"
 
 #include <stdarg.h>
 
-void CallLandscapeTick(void);
-void IncreaseDate(void);
-void DoPaletteAnimations(void);
-void MusicLoop(void);
-void ResetMusic(void);
+void CallLandscapeTick();
+void IncreaseDate();
+void DoPaletteAnimations();
+void MusicLoop();
+void ResetMusic();
 
 extern void SetDifficultyLevel(int mode, GameOptions *gm_opt);
 extern Player* DoStartupNewPlayer(bool is_ai);
@@ -137,7 +138,7 @@
 }
 
 extern const char _openttd_revision[];
-static void showhelp(void)
+static void showhelp()
 {
 	char buf[4096], *p;
 
@@ -265,7 +266,7 @@
 	res[1] = clamp(strtoul(t + 1, NULL, 0), 64, MAX_SCREEN_HEIGHT);
 }
 
-static void InitializeDynamicVariables(void)
+static void InitializeDynamicVariables()
 {
 	/* Dynamic stuff needs to be initialized somewhere... */
 	_town_sort     = NULL;
@@ -273,7 +274,7 @@
 }
 
 
-static void UnInitializeGame(void)
+static void UnInitializeGame()
 {
 	UnInitWindowSystem();
 
@@ -294,7 +295,7 @@
 	free(_config_file);
 }
 
-static void LoadIntroGame(void)
+static void LoadIntroGame()
 {
 	char filename[256];
 
@@ -319,7 +320,7 @@
 		WaitTillGeneratedWorld();
 	}
 
-	_pause = 0;
+	_pause_game = 0;
 	SetLocalPlayer(PLAYER_FIRST);
 	/* Make sure you can't scroll in the menu */
 	_scrolling_viewport = 0;
@@ -331,7 +332,7 @@
 }
 
 #if defined(UNIX) && !defined(__MORPHOS__)
-extern void DedicatedFork(void);
+extern void DedicatedFork();
 #endif
 
 int ttd_main(int argc, char *argv[])
@@ -418,6 +419,8 @@
 				_switch_mode = SM_LOAD;
 			} else {
 				_switch_mode = SM_NEWGAME;
+				/* Give a random map */
+				generation_seed = InteractiveRandom();
 			}
 			break;
 		case 'G': generation_seed = atoi(mgo.opt); break;
@@ -430,7 +433,7 @@
 		}
 	}
 
-	DeterminePaths();
+	DeterminePaths(argv[0]);
 	CheckExternalFiles();
 
 #if defined(UNIX) && !defined(__MORPHOS__)
@@ -593,7 +596,7 @@
 	return 0;
 }
 
-void HandleExitGameRequest(void)
+void HandleExitGameRequest()
 {
 	if (_game_mode == GM_MENU) { // do not ask to quit on the main screen
 		_exit_game = true;
@@ -610,8 +613,8 @@
  * at any given time */
 static ThreadMsg _message = MSG_OTTD_NO_MESSAGE;
 
-static inline void OTTD_ReleaseMutex(void) {_message = MSG_OTTD_NO_MESSAGE;}
-static inline ThreadMsg OTTD_PollThreadEvent(void) {return _message;}
+static inline void OTTD_ReleaseMutex() {_message = MSG_OTTD_NO_MESSAGE;}
+static inline ThreadMsg OTTD_PollThreadEvent() {return _message;}
 
 /** Called by running thread to execute some action in the main game.
  * It will stall as long as the mutex is not freed (handled) by the game */
@@ -649,7 +652,7 @@
 
 }
 
-static void MakeNewGameDone(void)
+static void MakeNewGameDone()
 {
 	/* In a dedicated server, the server does not play */
 	if (_network_dedicated) {
@@ -679,14 +682,14 @@
 	GenerateWorld(from_heightmap ? GW_HEIGHTMAP : GW_NEWGAME, 1 << _patches.map_x, 1 << _patches.map_y);
 }
 
-static void MakeNewEditorWorldDone(void)
+static void MakeNewEditorWorldDone()
 {
 	SetLocalPlayer(OWNER_NONE);
 
 	MarkWholeScreenDirty();
 }
 
-static void MakeNewEditorWorld(void)
+static void MakeNewEditorWorld()
 {
 	_game_mode = GM_EDITOR;
 
@@ -696,16 +699,16 @@
 	GenerateWorld(GW_EMPTY, 1 << _patches.map_x, 1 << _patches.map_y);
 }
 
-void StartupPlayers(void);
-void StartupDisasters(void);
-extern void StartupEconomy(void);
+void StartupPlayers();
+void StartupDisasters();
+extern void StartupEconomy();
 
 /**
  * Start Scenario starts a new game based on a scenario.
  * Eg 'New Game' --> select a preset scenario
  * This starts a scenario based on your current difficulty settings
  */
-static void StartScenario(void)
+static void StartScenario()
 {
 	_game_mode = GM_NORMAL;
 
@@ -900,10 +903,10 @@
 // The state must not be changed from anywhere
 // but here.
 // That check is enforced in DoCommand.
-void StateGameLoop(void)
+void StateGameLoop()
 {
 	// dont execute the state loop during pause
-	if (_pause) return;
+	if (_pause_game) return;
 	if (IsGeneratingWorld()) return;
 
 	if (_game_mode == GM_EDITOR) {
@@ -932,7 +935,7 @@
 	}
 }
 
-static void DoAutosave(void)
+static void DoAutosave()
 {
 	char buf[200];
 
@@ -998,7 +1001,7 @@
 	{ 0,  0}, // 15 : impossible
 };
 
-static void HandleKeyScrolling(void)
+static void HandleKeyScrolling()
 {
 	if (_dirkeys && !_no_scroll) {
 		int factor = _shift_pressed ? 50 : 10;
@@ -1006,7 +1009,7 @@
 	}
 }
 
-void GameLoop(void)
+void GameLoop()
 {
 	ThreadMsg message;
 
@@ -1064,16 +1067,16 @@
 	StateGameLoop();
 #endif /* ENABLE_NETWORK */
 
-	if (!_pause && _display_opt & DO_FULL_ANIMATION) DoPaletteAnimations();
+	if (!_pause_game && _display_opt & DO_FULL_ANIMATION) DoPaletteAnimations();
 
-	if (!_pause || _cheats.build_in_pause.value) MoveAllTextEffects();
+	if (!_pause_game || _cheats.build_in_pause.value) MoveAllTextEffects();
 
 	InputLoop();
 
 	MusicLoop();
 }
 
-void BeforeSaveGame(void)
+void BeforeSaveGame()
 {
 	const Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
 
@@ -1084,7 +1087,7 @@
 	}
 }
 
-static void ConvertTownOwner(void)
+static void ConvertTownOwner()
 {
 	TileIndex tile;
 
@@ -1106,7 +1109,7 @@
 }
 
 // before savegame version 4, the name of the company determined if it existed
-static void CheckIsPlayerActive(void)
+static void CheckIsPlayerActive()
 {
 	Player *p;
 
@@ -1116,7 +1119,7 @@
 }
 
 // since savegame version 4.1, exclusive transport rights are stored at towns
-static void UpdateExclusiveRights(void)
+static void UpdateExclusiveRights()
 {
 	Town *t;
 
@@ -1142,7 +1145,7 @@
 	18,  2, 20, };
 
 // since savegame version 4.2 the currencies are arranged differently
-static void UpdateCurrencies(void)
+static void UpdateCurrencies()
 {
 	_opt.currency = convert_currency[_opt.currency];
 }
@@ -1150,7 +1153,7 @@
 /* Up to revision 1413 the invisible tiles at the southern border have not been
  * MP_VOID, even though they should have. This is fixed by this function
  */
-static void UpdateVoidTiles(void)
+static void UpdateVoidTiles()
 {
 	uint i;
 
@@ -1159,14 +1162,14 @@
 }
 
 // since savegame version 6.0 each sign has an "owner", signs without owner (from old games are set to 255)
-static void UpdateSignOwner(void)
+static void UpdateSignOwner()
 {
 	Sign *si;
 
 	FOR_ALL_SIGNS(si) si->owner = OWNER_NONE;
 }
 
-extern void UpdateOldAircraft( void );
+extern void UpdateOldAircraft();
 
 
 static inline RailType UpdateRailType(RailType rt, RailType min)
@@ -1174,7 +1177,7 @@
 	return rt >= min ? (RailType)(rt + 1): rt;
 }
 
-bool AfterLoadGame(void)
+bool AfterLoadGame()
 {
 	TileIndex map_size = MapSize();
 	Window *w;
@@ -1209,12 +1212,12 @@
 	if (_opt.road_side) _opt.road_side = 1;
 
 	/* Check if all NewGRFs are present, we are very strict in MP mode */
-	GCF_Flags gcf_res = IsGoodGRFConfigList();
-	if (_networking && gcf_res != GCF_ACTIVATED) return false;
+	GRFListCompatibility gcf_res = IsGoodGRFConfigList();
+	if (_networking && gcf_res != GLC_ALL_GOOD) return false;
 
 	switch (gcf_res) {
-		case GCF_COMPATIBLE: _switch_mode_errorstr = STR_NEWGRF_COMPATIBLE_LOAD_WARNING; break;
-		case GCF_NOT_FOUND: _switch_mode_errorstr = STR_NEWGRF_DISABLED_WARNING; break;
+		case GLC_COMPATIBLE: _switch_mode_errorstr = STR_NEWGRF_COMPATIBLE_LOAD_WARNING; break;
+		case GLC_NOT_FOUND: _switch_mode_errorstr = STR_NEWGRF_DISABLED_WARNING; break;
 		default: break;
 	}
 
@@ -1444,7 +1447,7 @@
 		}
 
 		FOR_ALL_VEHICLES(v) {
-			if (v->type != VEH_Train && v->type != VEH_Road) continue;
+			if (v->type != VEH_TRAIN && v->type != VEH_ROAD) continue;
 			if (IsBridgeTile(v->tile)) {
 				DiagDirection dir = GetBridgeRampDirection(v->tile);
 
@@ -1461,7 +1464,7 @@
 			} else {
 				continue;
 			}
-			if (v->type == VEH_Train) {
+			if (v->type == VEH_TRAIN) {
 				v->u.rail.track = TRACK_BIT_WORMHOLE;
 			} else {
 				v->u.road.state = RVSB_WORMHOLE;
@@ -1503,7 +1506,7 @@
 		RailType min_rail = RAILTYPE_ELECTRIC;
 
 		FOR_ALL_VEHICLES(v) {
-			if (v->type == VEH_Train) {
+			if (v->type == VEH_TRAIN) {
 				RailType rt = RailVehInfo(v->engine_type)->railtype;
 
 				v->u.rail.railtype = rt;
@@ -1548,7 +1551,7 @@
 		}
 
 		FOR_ALL_VEHICLES(v) {
-			if (v->type == VEH_Train && (IsFrontEngine(v) || IsFreeWagon(v))) TrainConsistChanged(v);
+			if (v->type == VEH_TRAIN && (IsFrontEngine(v) || IsFreeWagon(v))) TrainConsistChanged(v);
 		}
 
 	}
@@ -1640,7 +1643,7 @@
 	if (CheckSavegameVersion(25)) {
 		Vehicle *v;
 		FOR_ALL_VEHICLES(v) {
-			if (v->type == VEH_Road) {
+			if (v->type == VEH_ROAD) {
 				v->vehstatus &= ~0x40;
 				v->u.road.slot = NULL;
 				v->u.road.slot_age = 0;
@@ -1649,14 +1652,14 @@
 	} else {
 		Vehicle *v;
 		FOR_ALL_VEHICLES(v) {
-			if (v->type == VEH_Road && v->u.road.slot != NULL) v->u.road.slot->num_vehicles++;
+			if (v->type == VEH_ROAD && v->u.road.slot != NULL) v->u.road.slot->num_vehicles++;
 		}
 	}
 
 	if (CheckSavegameVersion(26)) {
 		Station *st;
 		FOR_ALL_STATIONS(st) {
-			st->last_vehicle_type = VEH_Invalid;
+			st->last_vehicle_type = VEH_INVALID;
 		}
 	}
 
@@ -1791,6 +1794,25 @@
 		FOR_ALL_VEHICLES(v) {
 			v->cargo_source_xy = IsValidStationID(v->cargo_source) ? GetStation(v->cargo_source)->xy : v->tile;
 		}
+
+		/* Store position of the station where the goods come from, so there
+		 * are no very high payments when stations get removed. However, if the
+		 * station where the goods came from is already removed, the source
+		 * information is lost. In that case we set it to the position of this
+		 * station */
+		Station *st;
+		FOR_ALL_STATIONS(st) {
+			for (CargoID c = 0; c < NUM_CARGO; c++) {
+				GoodsEntry *ge = &st->goods[c];
+
+				/* In old versions, enroute_from used 0xFF as INVALID_STATION */
+				if (CheckSavegameVersion(7) && ge->enroute_from == 0xFF) {
+					ge->enroute_from = INVALID_STATION;
+				}
+
+				ge->enroute_from_xy = IsValidStationID(ge->enroute_from) ? GetStation(ge->enroute_from)->xy : st->xy;
+			}
+		}
 	}
 
 	if (CheckSavegameVersion(45)) {
@@ -1823,7 +1845,7 @@
 		Vehicle *v;
 		/* Aircraft units changed from 8 mph to 1 km/h */
 		FOR_ALL_VEHICLES(v) {
-			if (v->type == VEH_Aircraft && v->subtype <= AIR_AIRCRAFT) {
+			if (v->type == VEH_AIRCRAFT && v->subtype <= AIR_AIRCRAFT) {
 				const AircraftVehicleInfo *avi = AircraftVehInfo(v->engine_type);
 				v->cur_speed *= 129;
 				v->cur_speed /= 10;
@@ -1835,6 +1857,14 @@
 
 	if (CheckSavegameVersion(49)) FOR_ALL_PLAYERS(p) p->face = ConvertFromOldPlayerFace(p->face);
 
+	if (CheckSavegameVersion(52)) {
+		for (TileIndex t = 0; t < map_size; t++) {
+			if (IsStatueTile(t)) {
+				_m[t].m2 = CalcClosestTownFromTile(t, (uint)-1)->index;
+			}
+		}
+	}
+
 	return true;
 }
 
@@ -1844,7 +1874,7 @@
  * hash AfterLoadVehicles() will loop infinitely. We need AfterLoadVehicles()
  * to recalculate vehicle data as some NewGRF vehicle sets could have been
  * removed or added and changed statistics */
-void ReloadNewGRFData(void)
+void ReloadNewGRFData()
 {
 	/* reload grf data */
 	GfxLoadSprites();
--- a/src/openttd.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/openttd.h	Mon Mar 19 12:38:16 2007 +0000
@@ -11,43 +11,43 @@
 #include "hal.h"
 #include "helpers.hpp"
 
-typedef struct Oblong {
+struct Oblong {
 	int x, y;
 	int width, height;
-} Oblong;
+};
 
-typedef struct BoundingRect {
+struct BoundingRect {
 	int width;
 	int height;
-} BoundingRect;
+};
 
-typedef struct Pair {
+struct Pair {
 	int a;
 	int b;
-} Pair;
+};
 
 #include "map.h"
 #include "slope.h"
 
 // Forward declarations of structs.
-typedef struct Vehicle Vehicle;
-typedef struct Depot Depot;
-typedef struct Waypoint Waypoint;
-typedef struct Window Window;
-typedef struct Station Station;
-typedef struct ViewPort ViewPort;
-typedef struct Town Town;
-typedef struct NewsItem NewsItem;
-typedef struct Industry Industry;
-typedef struct DrawPixelInfo DrawPixelInfo;
+struct Vehicle;
+struct Depot;
+struct Waypoint;
+struct Window;
+struct Station;
+struct ViewPort;
+struct Town;
+struct NewsItem;
+struct Industry;
+struct DrawPixelInfo;
 typedef byte VehicleOrderID;  ///< The index of an order within its current vehicle (not pool related)
 typedef byte CargoID;
 typedef byte LandscapeID;
 typedef uint32 SpriteID;      ///< The number of a sprite, without mapping bits and colortables
-typedef struct PalSpriteID {
+struct PalSpriteID {
 	SpriteID sprite;
 	SpriteID pal;
-} PalSpriteID;
+};
 typedef uint16 EngineID;
 typedef uint16 UnitID;
 typedef uint16 StringID;
@@ -140,7 +140,7 @@
 typedef OwnerByte PlayerByte;
 
 
-typedef enum TransportTypes {
+enum TransportType {
 	/* These constants are for now linked to the representation of bridges
 	 * and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge.
 	 * In an ideal world, these constants would be used everywhere when
@@ -153,20 +153,20 @@
 	TRANSPORT_WATER, // = 2
 	TRANSPORT_END,
 	INVALID_TRANSPORT = 0xff,
-} TransportType;
+};
 
 /** Define basic enum properties */
 template <> struct EnumPropsT<TransportType> : MakeEnumPropsT<TransportType, byte, TRANSPORT_BEGIN, TRANSPORT_END, INVALID_TRANSPORT> {};
 typedef TinyEnumT<TransportType> TransportTypeByte;
 
 
-typedef struct TileInfo {
+struct TileInfo {
 	uint x;
 	uint y;
 	Slope tileh;
 	TileIndex tile;
 	uint z;
-} TileInfo;
+};
 
 
 /* Display Options */
@@ -195,7 +195,7 @@
 	NUM_PRICES = 49,
 };
 
-typedef struct Prices {
+struct Prices {
 	int32 station_value;
 	int32 build_rail;
 	int32 build_road;
@@ -243,11 +243,11 @@
 	int32 roadveh_running;
 	int32 ship_running;
 	int32 build_industry;
-} Prices;
+};
 
 #define GAME_DIFFICULTY_NUM 19
 
-typedef struct GameDifficulty {
+struct GameDifficulty {
 	int max_no_competitors;
 	int competitor_start_time;
 	int number_towns;
@@ -267,7 +267,7 @@
 	int disasters;
 	int town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff
 	int economic_growth;
-} GameDifficulty;
+};
 
 enum {
 	// Temperate
@@ -318,18 +318,18 @@
 
 typedef uint AcceptedCargo[NUM_CARGO];
 
-typedef struct TileDesc {
+struct TileDesc {
 	StringID str;
 	Owner owner;
 	Date build_date;
 	uint32 dparam[2];
-} TileDesc;
+};
 
-typedef struct {
+struct ViewportSign {
 	int32 left;
 	int32 top;
 	byte width_1, width_2;
-} ViewportSign;
+};
 
 
 typedef void DrawTileProc(TileInfo *ti);
@@ -366,7 +366,7 @@
 typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y);
 typedef Slope GetSlopeTilehProc(TileIndex, Slope tileh);
 
-typedef struct {
+struct TileTypeProcs {
 	DrawTileProc *draw_tile_proc;
 	GetSlopeZProc *get_slope_z_proc;
 	ClearTileProc *clear_tile_proc;
@@ -380,7 +380,7 @@
 	GetProducedCargoProc *get_produced_cargo_proc;
 	VehicleEnterTileProc *vehicle_enter_tile_proc;
 	GetSlopeTilehProc *get_slope_tileh_proc;
-} TileTypeProcs;
+};
 
 
 enum WindowClass {
@@ -576,11 +576,11 @@
 /** To have a concurrently running thread interface with the main program, use
  * the OTTD_SendThreadMessage() function. Actions to perform upon the message are handled
  * in the ProcessSentMessage() function */
-typedef enum ThreadMsgs {
+enum ThreadMsg {
 	MSG_OTTD_NO_MESSAGE,
 	MSG_OTTD_SAVETHREAD_DONE,
 	MSG_OTTD_SAVETHREAD_ERROR,
-} ThreadMsg;
+};
 
 void OTTD_SendThreadMessage(ThreadMsg msg);
 
--- a/src/order.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/order.h	Mon Mar 19 12:38:16 2007 +0000
@@ -88,8 +88,8 @@
  * - Vehicle -> current_order
  * - REF_SHEDULE (all REFs are currently limited to 16 bits!!)
  */
-typedef struct Order {
-	struct Order *next;   ///< Pointer to next order. If NULL, end of list
+struct Order {
+	Order *next;          ///< Pointer to next order. If NULL, end of list
 
 	OrderTypeByte type;
 	uint8  flags;
@@ -99,24 +99,28 @@
 
 	CargoID refit_cargo; // Refit CargoID
 	byte refit_subtype; // Refit subtype
-} Order;
+
+	bool IsValid() const;
+	void Free();
+	void FreeChain();
+};
 
 #define MAX_BACKUP_ORDER_COUNT 40
 
-typedef struct {
+struct BackuppedOrders {
 	VehicleID clone;
 	VehicleOrderID orderindex;
 	Order order[MAX_BACKUP_ORDER_COUNT + 1];
 	uint16 service_interval;
 	char name[32];
-} BackuppedOrders;
+};
 
 VARDEF TileIndex _backup_orders_tile;
 VARDEF BackuppedOrders _backup_orders_data[1];
 
 DECLARE_OLD_POOL(Order, Order, 6, 1000)
 
-static inline VehicleOrderID GetMaxOrderIndex(void)
+static inline VehicleOrderID GetMaxOrderIndex()
 {
 	/* TODO - This isn't the real content of the function, but
 	 *  with the new pool-system this will be replaced with one that
@@ -126,7 +130,7 @@
 	return GetOrderPoolSize() - 1;
 }
 
-static inline VehicleOrderID GetNumOrders(void)
+static inline VehicleOrderID GetNumOrders()
 {
 	return GetOrderPoolSize();
 }
@@ -134,18 +138,26 @@
 /**
  * Check if a Order really exists.
  */
-static inline bool IsValidOrder(const Order *o)
+inline bool Order::IsValid() const
 {
-	return o->type != OT_NOTHING;
+	return type != OT_NOTHING;
 }
 
-static inline void DeleteOrder(Order *o)
+inline void Order::Free()
 {
-	o->type = OT_NOTHING;
-	o->next = NULL;
+	type  = OT_NOTHING;
+	flags = 0;
+	dest  = 0;
+	next  = NULL;
 }
 
-#define FOR_ALL_ORDERS_FROM(order, start) for (order = GetOrder(start); order != NULL; order = (order->index + 1U < GetOrderPoolSize()) ? GetOrder(order->index + 1U) : NULL) if (IsValidOrder(order))
+inline void Order::FreeChain()
+{
+	if (next != NULL) next->FreeChain();
+	Free();
+}
+
+#define FOR_ALL_ORDERS_FROM(order, start) for (order = GetOrder(start); order != NULL; order = (order->index + 1U < GetOrderPoolSize()) ? GetOrder(order->index + 1U) : NULL) if (order->IsValid())
 #define FOR_ALL_ORDERS(order) FOR_ALL_ORDERS_FROM(order, 0)
 
 
@@ -160,7 +172,7 @@
 		return true;
 
 	FOR_ALL_ORDERS(order)
-		if (order->type == OT_NOTHING)
+		if (!order->IsValid())
 			if (--amount == 0)
 				return true;
 
--- a/src/order_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/order_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -15,6 +15,7 @@
 #include "news.h"
 #include "saveload.h"
 #include "vehicle_gui.h"
+#include "cargotype.h"
 
 /**
  * Called if a new block is added to the order-pool
@@ -49,7 +50,7 @@
 
 	// Sanity check
 	// TTD stores invalid orders as OT_NOTHING with non-zero flags/station
-	if (order.type == OT_NOTHING && (order.flags != 0 || order.dest != 0)) {
+	if (!order.IsValid() && (order.flags != 0 || order.dest != 0)) {
 		order.type = OT_DUMMY;
 		order.flags = 0;
 	}
@@ -109,14 +110,14 @@
  * @return Order* if a free space is found, else NULL.
  *
  */
-static Order *AllocateOrder(void)
+static Order *AllocateOrder()
 {
 	Order *order;
 
 	/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
 	 * TODO - This is just a temporary stage, this will be removed. */
 	for (order = GetOrder(0); order != NULL; order = (order->index + 1U < GetOrderPoolSize()) ? GetOrder(order->index + 1U) : NULL) {
-		if (!IsValidOrder(order)) {
+		if (!order->IsValid()) {
 			OrderID index = order->index;
 
 			memset(order, 0, sizeof(*order));
@@ -213,23 +214,23 @@
 			}
 
 			switch (v->type) {
-				case VEH_Train:
+				case VEH_TRAIN:
 					if (!(st->facilities & FACIL_TRAIN)) return CMD_ERROR;
 					break;
 
-				case VEH_Road:
-					if (v->cargo_type == CT_PASSENGERS) {
+				case VEH_ROAD:
+					if (IsCargoInClass(v->cargo_type, CC_PASSENGERS)) {
 						if (!(st->facilities & FACIL_BUS_STOP)) return CMD_ERROR;
 					} else {
 						if (!(st->facilities & FACIL_TRUCK_STOP)) return CMD_ERROR;
 					}
 					break;
 
-				case VEH_Ship:
+				case VEH_SHIP:
 					if (!(st->facilities & FACIL_DOCK)) return CMD_ERROR;
 					break;
 
-				case VEH_Aircraft:
+				case VEH_AIRCRAFT:
 					if (!(st->facilities & FACIL_AIRPORT)) return CMD_ERROR;
 					break;
 
@@ -254,7 +255,7 @@
 				case OF_NON_STOP | OF_UNLOAD:
 				case OF_NON_STOP | OF_UNLOAD | OF_TRANSFER:
 				case OF_NON_STOP | OF_TRANSFER:
-					if (v->type != VEH_Train) return CMD_ERROR;
+					if (v->type != VEH_TRAIN) return CMD_ERROR;
 					break;
 
 				default: return CMD_ERROR;
@@ -263,7 +264,7 @@
 		}
 
 		case OT_GOTO_DEPOT: {
-			if (v->type == VEH_Aircraft) {
+			if (v->type == VEH_AIRCRAFT) {
 				const Station* st;
 
 				if (!IsValidStationID(new_order.dest)) return CMD_ERROR;
@@ -283,15 +284,15 @@
 				if (!CheckOwnership(GetTileOwner(dp->xy))) return CMD_ERROR;
 
 				switch (v->type) {
-					case VEH_Train:
+					case VEH_TRAIN:
 						if (!IsTileDepotType(dp->xy, TRANSPORT_RAIL)) return CMD_ERROR;
 						break;
 
-					case VEH_Road:
+					case VEH_ROAD:
 						if (!IsTileDepotType(dp->xy, TRANSPORT_ROAD)) return CMD_ERROR;
 						break;
 
-					case VEH_Ship:
+					case VEH_SHIP:
 						if (!IsTileDepotType(dp->xy, TRANSPORT_WATER)) return CMD_ERROR;
 						break;
 
@@ -309,7 +310,7 @@
 
 				case OF_NON_STOP | OF_PART_OF_ORDERS:
 				case OF_NON_STOP | OF_PART_OF_ORDERS | OF_HALT_IN_DEPOT:
-					if (v->type != VEH_Train) return CMD_ERROR;
+					if (v->type != VEH_TRAIN) return CMD_ERROR;
 					break;
 
 				default: return CMD_ERROR;
@@ -320,7 +321,7 @@
 		case OT_GOTO_WAYPOINT: {
 			const Waypoint* wp;
 
-			if (v->type != VEH_Train) return CMD_ERROR;
+			if (v->type != VEH_TRAIN) return CMD_ERROR;
 
 			if (!IsValidWaypointID(new_order.dest)) return CMD_ERROR;
 			wp = GetWaypoint(new_order.dest);
@@ -334,7 +335,7 @@
 				case 0: break;
 
 				case OF_NON_STOP:
-					if (v->type != VEH_Train) return CMD_ERROR;
+					if (v->type != VEH_TRAIN) return CMD_ERROR;
 					break;
 
 				default: return CMD_ERROR;
@@ -353,7 +354,7 @@
 	 * handle any more then this.. */
 	if (v->num_orders >= MAX_BACKUP_ORDER_COUNT) return_cmd_error(STR_8832_TOO_MANY_ORDERS);
 
-	if (v->type == VEH_Ship &&
+	if (v->type == VEH_SHIP &&
 			IsHumanPlayer(v->owner) &&
 			!_patches.new_pathfinding_all) {
 		// Make sure the new destination is not too far away from the previous
@@ -496,8 +497,7 @@
 		}
 
 		/* Give the item free */
-		order->type = OT_NOTHING;
-		order->next = NULL;
+		order->Free();
 
 		u = GetFirstVehicleFromSharedList(v);
 		DeleteOrderWarnings(u);
@@ -553,9 +553,9 @@
 
 		v->cur_order_index = b;
 
-		if (v->type == VEH_Train) v->u.rail.days_since_order_progr = 0;
+		if (v->type == VEH_TRAIN) v->u.rail.days_since_order_progr = 0;
 
-		if (v->type == VEH_Road) ClearSlot(v);
+		if (v->type == VEH_ROAD) ClearSlot(v);
 
 		/* NON-stop flag is misused to see if a train is in a station that is
 		 * on his order list or not */
@@ -566,8 +566,8 @@
 	}
 
 	/* We have an aircraft/ship, they have a mini-schedule, so update them all */
-	if (v->type == VEH_Aircraft) InvalidateWindowClasses(WC_AIRCRAFT_LIST);
-	if (v->type == VEH_Ship) InvalidateWindowClasses(WC_SHIPS_LIST);
+	if (v->type == VEH_AIRCRAFT) InvalidateWindowClasses(WC_AIRCRAFT_LIST);
+	if (v->type == VEH_SHIP) InvalidateWindowClasses(WC_SHIPS_LIST);
 
 	return 0;
 }
@@ -685,8 +685,8 @@
 				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 && (src->cargo_type == CT_PASSENGERS || dst->cargo_type == CT_PASSENGERS))
+			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;
 			}
 
@@ -732,14 +732,14 @@
 				return CMD_ERROR;
 
 			/* Trucks can't copy all the orders from busses (and visa versa) */
-			if (src->type == VEH_Road) {
+			if (src->type == VEH_ROAD) {
 				const Order *order;
 				TileIndex required_dst = INVALID_TILE;
 
 				FOR_VEHICLE_ORDERS(src, order) {
 					if (order->type == OT_GOTO_STATION) {
 						const Station *st = GetStation(order->dest);
-						if (dst->cargo_type == CT_PASSENGERS) {
+						if (IsCargoInClass(dst->cargo_type, CC_PASSENGERS)) {
 							if (st->bus_stops != NULL) required_dst = st->bus_stops->xy;
 						} else {
 							if (st->truck_stops != NULL) required_dst = st->truck_stops->xy;
@@ -871,9 +871,8 @@
 			*dest = *order;
 			dest++;
 		}
-		/* End the list with an OT_NOTHING */
-		dest->type = OT_NOTHING;
-		dest->next = NULL;
+		/* End the list with an empty order */
+		dest->Free();
 	}
 }
 
@@ -902,7 +901,7 @@
 	 *  order number is one more than the current amount of orders, and because
 	 *  in network the commands are queued before send, the second insert always
 	 *  fails in test mode. By bypassing the test-mode, that no longer is a problem. */
-	for (i = 0; bak->order[i].type != OT_NOTHING; i++) {
+	for (i = 0; bak->order[i].IsValid(); i++) {
 		if (!DoCommandP(0, v->index + (i << 16), PackOrder(&bak->order[i]), NULL, CMD_INSERT_ORDER | CMD_NO_TEST_IF_IN_NETWORK))
 			break;
 	}
@@ -951,11 +950,11 @@
 {
 	switch (v->type) {
 		default: NOT_REACHED();
-		case VEH_Train:     return st->train_tile;
-		case VEH_Aircraft:  return st->airport_tile;
-		case VEH_Ship:      return st->dock_tile;
-		case VEH_Road:
-			if (v->cargo_type == CT_PASSENGERS) {
+		case VEH_TRAIN:     return st->train_tile;
+		case VEH_AIRCRAFT:  return st->airport_tile;
+		case VEH_SHIP:      return st->dock_tile;
+		case VEH_ROAD:
+			if (IsCargoInClass(v->cargo_type, CC_PASSENGERS)) {
 				return (st->bus_stops != NULL) ? st->bus_stops->xy : 0;
 			} else {
 				return (st->truck_stops != NULL) ? st->truck_stops->xy : 0;
@@ -1063,7 +1062,7 @@
 		}
 
 		order = &v->current_order;
-		if ((v->type == VEH_Aircraft && order->type == OT_GOTO_DEPOT ? OT_GOTO_STATION : order->type) == type &&
+		if ((v->type == VEH_AIRCRAFT && order->type == OT_GOTO_DEPOT ? OT_GOTO_STATION : order->type) == type &&
 				v->current_order.dest == destination) {
 			order->type = OT_DUMMY;
 			order->flags = 0;
@@ -1073,7 +1072,7 @@
 		/* Clear the order from the order-list */
 		invalidate = false;
 		FOR_VEHICLE_ORDERS(v, order) {
-			if ((v->type == VEH_Aircraft && order->type == OT_GOTO_DEPOT ? OT_GOTO_STATION : order->type) == type &&
+			if ((v->type == VEH_AIRCRAFT && order->type == OT_GOTO_DEPOT ? OT_GOTO_STATION : order->type) == type &&
 					order->dest == destination) {
 				order->type = OT_DUMMY;
 				order->flags = 0;
@@ -1112,8 +1111,6 @@
  */
 void DeleteVehicleOrders(Vehicle *v)
 {
-	Order *cur, *next;
-
 	DeleteOrderWarnings(v);
 
 	/* If we have a shared order-list, don't delete the list, but just
@@ -1146,7 +1143,7 @@
 	}
 
 	/* Remove the orders */
-	cur = v->orders;
+	Order *cur = v->orders;
 	v->orders = NULL;
 	v->num_orders = 0;
 
@@ -1156,18 +1153,14 @@
 
 		switch (v->type) {
 			default: NOT_REACHED();
-			case VEH_Train:    window_class = WC_TRAINS_LIST;   break;
-			case VEH_Road:     window_class = WC_ROADVEH_LIST;  break;
-			case VEH_Ship:     window_class = WC_SHIPS_LIST;    break;
-			case VEH_Aircraft: window_class = WC_AIRCRAFT_LIST; break;
+			case VEH_TRAIN:    window_class = WC_TRAINS_LIST;   break;
+			case VEH_ROAD:     window_class = WC_ROADVEH_LIST;  break;
+			case VEH_SHIP:     window_class = WC_SHIPS_LIST;    break;
+			case VEH_AIRCRAFT: window_class = WC_AIRCRAFT_LIST; break;
 		}
 		DeleteWindowById(window_class, (cur->index << 16) | (v->type << 11) | VLW_SHARED_ORDERS | v->owner);
-	}
 
-	while (cur != NULL) {
-		next = cur->next;
-		DeleteOrder(cur);
-		cur = next;
+		cur->FreeChain(); // Free the orders.
 	}
 }
 
@@ -1199,7 +1192,7 @@
 	return false;
 }
 
-void InitializeOrders(void)
+void InitializeOrders()
 {
 	CleanPool(&_Order_pool);
 	AddBlockToPool(&_Order_pool);
@@ -1221,7 +1214,7 @@
 	SLE_END()
 };
 
-static void Save_ORDR(void)
+static void Save_ORDR()
 {
 	Order *order;
 
@@ -1231,7 +1224,7 @@
 	}
 }
 
-static void Load_ORDR(void)
+static void Load_ORDR()
 {
 	if (CheckSavegameVersionOldStyle(5, 2)) {
 		/* Version older than 5.2 did not have a ->next pointer. Convert them
@@ -1274,9 +1267,9 @@
 		/* Update all the next pointer */
 		for (i = 1; i < len; ++i) {
 			/* The orders were built like this:
-			 *   Vehicle one had order[0], and as long as order++.type was not
-			 *   OT_NOTHING, it was part of the order-list of that vehicle */
-			if (GetOrder(i)->type != OT_NOTHING)
+			 *   While the order is valid, set the previous will get it's next pointer set
+			 *   We start with index 1 because no order will have the first in it's next pointer */
+			if (GetOrder(i)->IsValid())
 				GetOrder(i - 1)->next = GetOrder(i);
 		}
 	} else {
--- a/src/order_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/order_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -98,7 +98,7 @@
 				(uint)v->num_orders + ((shared_orders || v->num_orders != 0) ? 1 : 0) <= (uint)WP(w, order_d).sel);
 
 		/* non-stop only for trains */
-		SetWindowWidgetDisabledState(w, ORDER_WIDGET_NON_STOP,  v->type != VEH_Train || order == NULL);
+		SetWindowWidgetDisabledState(w, ORDER_WIDGET_NON_STOP,  v->type != VEH_TRAIN || order == NULL);
 		SetWindowWidgetDisabledState(w, ORDER_WIDGET_FULL_LOAD, order == NULL); // full load
 		SetWindowWidgetDisabledState(w, ORDER_WIDGET_UNLOAD,    order == NULL); // unload
 		SetWindowWidgetDisabledState(w, ORDER_WIDGET_TRANSFER,  order == NULL); // transfer
@@ -162,16 +162,16 @@
 				case OT_GOTO_DEPOT: {
 					StringID s = STR_NULL;
 
-					if (v->type == VEH_Aircraft) {
+					if (v->type == VEH_AIRCRAFT) {
 						s = STR_GO_TO_AIRPORT_HANGAR;
 						SetDParam(2, order->dest);
 					} else {
 						SetDParam(2, GetDepot(order->dest)->town_index);
 
 						switch (v->type) {
-							case VEH_Train: s = (order->flags & OF_NON_STOP) ? STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT : STR_GO_TO_TRAIN_DEPOT; break;
-							case VEH_Road:  s = STR_9038_GO_TO_ROADVEH_DEPOT; break;
-							case VEH_Ship:  s = STR_GO_TO_SHIP_DEPOT; break;
+							case VEH_TRAIN: s = (order->flags & OF_NON_STOP) ? STR_880F_GO_NON_STOP_TO_TRAIN_DEPOT : STR_GO_TO_TRAIN_DEPOT; break;
+							case VEH_ROAD:  s = STR_9038_GO_TO_ROADVEH_DEPOT; break;
+							case VEH_SHIP:  s = STR_GO_TO_SHIP_DEPOT; break;
 							default: break;
 						}
 					}
@@ -231,7 +231,7 @@
 	if (_patches.gotodepot) {
 		switch (GetTileType(tile)) {
 		case MP_RAILWAY:
-			if (v->type == VEH_Train && IsTileOwner(tile, _local_player)) {
+			if (v->type == VEH_TRAIN && IsTileOwner(tile, _local_player)) {
 				if (IsRailDepot(tile)) {
 					order.type = OT_GOTO_DEPOT;
 					order.flags = OF_PART_OF_ORDERS;
@@ -242,7 +242,7 @@
 			break;
 
 		case MP_STREET:
-			if (GetRoadTileType(tile) == ROAD_TILE_DEPOT && v->type == VEH_Road && IsTileOwner(tile, _local_player)) {
+			if (GetRoadTileType(tile) == ROAD_TILE_DEPOT && v->type == VEH_ROAD && IsTileOwner(tile, _local_player)) {
 				order.type = OT_GOTO_DEPOT;
 				order.flags = OF_PART_OF_ORDERS;
 				order.dest = GetDepotByTile(tile)->index;
@@ -251,7 +251,7 @@
 			break;
 
 		case MP_STATION:
-			if (v->type != VEH_Aircraft) break;
+			if (v->type != VEH_AIRCRAFT) break;
 			if (IsHangar(tile) && IsTileOwner(tile, _local_player)) {
 				order.type = OT_GOTO_DEPOT;
 				order.flags = OF_PART_OF_ORDERS;
@@ -261,7 +261,7 @@
 			break;
 
 		case MP_WATER:
-			if (v->type != VEH_Ship) break;
+			if (v->type != VEH_SHIP) break;
 			if (IsTileDepotType(tile, TRANSPORT_WATER) &&
 					IsTileOwner(tile, _local_player)) {
 				TileIndex tile2 = GetOtherShipDepotTile(tile);
@@ -279,7 +279,7 @@
 
 	// check waypoint
 	if (IsTileType(tile, MP_RAILWAY) &&
-			v->type == VEH_Train &&
+			v->type == VEH_TRAIN &&
 			IsTileOwner(tile, _local_player) &&
 			IsRailWaypoint(tile)) {
 		order.type = OT_GOTO_WAYPOINT;
@@ -294,10 +294,10 @@
 
 		if (st->owner == _current_player || st->owner == OWNER_NONE) {
 			byte facil;
-			(facil=FACIL_DOCK, v->type == VEH_Ship) ||
-			(facil=FACIL_TRAIN, v->type == VEH_Train) ||
-			(facil=FACIL_AIRPORT, v->type == VEH_Aircraft) ||
-			(facil=FACIL_BUS_STOP, v->type == VEH_Road && v->cargo_type == CT_PASSENGERS) ||
+			(facil=FACIL_DOCK, v->type == VEH_SHIP) ||
+			(facil=FACIL_TRAIN, v->type == VEH_TRAIN) ||
+			(facil=FACIL_AIRPORT, v->type == VEH_AIRCRAFT) ||
+			(facil=FACIL_BUS_STOP, v->type == VEH_ROAD && IsCargoInClass(v->cargo_type, CC_PASSENGERS)) ||
 			(facil=FACIL_TRUCK_STOP, 1);
 			if (st->facilities & facil) {
 				order.type = OT_GOTO_STATION;
@@ -309,8 +309,7 @@
 	}
 
 	// not found
-	order.type = OT_NOTHING;
-	order.flags = 0;
+	order.Free();
 	order.dest = INVALID_STATION;
 	return order;
 }
@@ -319,7 +318,7 @@
 {
 	if (u->type != v->type) return false;
 
-	if (u->type == VEH_Train && !IsFrontEngine(u)) {
+	if (u->type == VEH_TRAIN && !IsFrontEngine(u)) {
 		u = GetFirstVehicleInChain(u);
 		if (!IsFrontEngine(u)) return false;
 	}
@@ -347,7 +346,7 @@
 	if (u != NULL && HandleOrderVehClick(v, u, w)) return;
 
 	cmd = GetOrderCmdFromTile(v, tile);
-	if (cmd.type == OT_NOTHING) return;
+	if (!cmd.IsValid()) return;
 
 	if (DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), PackOrder(&cmd), NULL, CMD_INSERT_ORDER | CMD_MSG(STR_8833_CAN_T_INSERT_NEW_ORDER))) {
 		if (WP(w,order_d).sel != -1) WP(w,order_d).sel++;
@@ -465,7 +464,7 @@
 
 				switch (ord->type) {
 					case OT_GOTO_STATION:  xy = GetStation(ord->dest)->xy ; break;
-					case OT_GOTO_DEPOT:    xy = (v->type == VEH_Aircraft) ?  GetStation(ord->dest)->xy : GetDepot(ord->dest)->xy;    break;
+					case OT_GOTO_DEPOT:    xy = (v->type == VEH_AIRCRAFT) ?  GetStation(ord->dest)->xy : GetDepot(ord->dest)->xy;    break;
 					case OT_GOTO_WAYPOINT: xy = GetWaypoint(ord->dest)->xy; break;
 					default:               xy = 0; break;
 				}
@@ -677,7 +676,7 @@
 	if (v->owner != _local_player) {
 		w = AllocateWindowDescFront(&_other_orders_desc, veh);
 	} else {
-		w = AllocateWindowDescFront((v->type == VEH_Train) ? &_orders_train_desc : &_orders_desc, veh);
+		w = AllocateWindowDescFront((v->type == VEH_TRAIN) ? &_orders_train_desc : &_orders_desc, veh);
 	}
 
 	if (w != NULL) {
--- a/src/os/macosx/macos.mm	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/os/macosx/macos.mm	Mon Mar 19 12:38:16 2007 +0000
@@ -24,7 +24,7 @@
 
 void ToggleFullScreen(bool fs);
 
-static char *GetOSString(void)
+static char *GetOSString()
 {
 	static char buffer[175];
 	const char* CPU;
--- a/src/os/macosx/splash.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/os/macosx/splash.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -26,7 +26,7 @@
 	DEBUG(misc, 1, "[libpng] warning: %s - %s", message, (char *)png_get_error_ptr(png_ptr));
 }
 
-void DisplaySplashImage(void)
+void DisplaySplashImage()
 {
 	png_byte header[8];
 	FILE *f;
@@ -139,6 +139,6 @@
 
 #else /* WITH_PNG */
 
-void DisplaySplashImage(void) {}
+void DisplaySplashImage() {}
 
 #endif /* WITH_PNG */
--- a/src/os/macosx/splash.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/os/macosx/splash.h	Mon Mar 19 12:38:16 2007 +0000
@@ -9,7 +9,7 @@
 extern "C" {
 #endif //__cplusplus
 
-	void DisplaySplashImage(void);
+	void DisplaySplashImage();
 
 #ifdef __cplusplus
 }
--- a/src/os2.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/os2.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -9,7 +9,7 @@
 #include "gui.h"
 #include "functions.h"
 #include "macros.h"
-#include "fios.h"
+#include "fileio.h"
 
 #include <dirent.h>
 #include <unistd.h>
@@ -33,7 +33,7 @@
 	return file[3] == '\0';
 }
 
-void FiosGetDrives(void)
+void FiosGetDrives()
 {
 	unsigned disk, disk2, save, total;
 
@@ -114,20 +114,12 @@
 	char filename[MAX_PATH];
 
 	snprintf(filename, lengthof(filename), "%s" PATHSEP "%s", path, ent->d_name);
-	if (stat(filename, sb) != 0) return false;
-
-	return (ent->d_name[0] != '.'); // hidden file
+	return stat(filename, sb) == 0;
 }
 
-static void ChangeWorkingDirectory(char *exe)
+bool FiosIsHiddenFile(const struct dirent *ent)
 {
-	char *s = strrchr(exe, PATHSEPCHAR);
-
-	if (s != NULL) {
-		*s = '\0';
-		chdir(exe);
-		*s = PATHSEPCHAR;
-	}
+	return ent->d_name[0] == '.';
 }
 
 void ShowInfo(const unsigned char *str)
@@ -166,97 +158,11 @@
 
 int CDECL main(int argc, char* argv[])
 {
-	// change the working directory to enable doubleclicking in UIs
-	ChangeWorkingDirectory(argv[0]);
-
 	_random_seeds[1][1] = _random_seeds[1][0] = _random_seeds[0][1] = _random_seeds[0][0] = time(NULL);
 
 	return ttd_main(argc, argv);
 }
 
-void DeterminePaths(void)
-{
-	char *s;
-
-	_paths.game_data_dir = (char *)malloc(MAX_PATH);
-	ttd_strlcpy(_paths.game_data_dir, GAME_DATA_DIR, MAX_PATH);
-#if defined SECOND_DATA_DIR
-	_paths.second_data_dir = malloc(MAX_PATH);
-	ttd_strlcpy(_paths.second_data_dir, SECOND_DATA_DIR, MAX_PATH);
-#endif
-
-#if defined(USE_HOMEDIR)
-	{
-		const char *homedir = getenv("HOME");
-
-		if (homedir == NULL) {
-			const struct passwd *pw = getpwuid(getuid());
-			if (pw != NULL) homedir = pw->pw_dir;
-		}
-
-		_paths.personal_dir = str_fmt("%s" PATHSEP "%s", homedir, PERSONAL_DIR);
-	}
-
-#else /* not defined(USE_HOMEDIR) */
-
-	_paths.personal_dir = (char *)malloc(MAX_PATH);
-	ttd_strlcpy(_paths.personal_dir, PERSONAL_DIR, MAX_PATH);
-
-	// check if absolute or relative path
-	s = strchr(_paths.personal_dir, PATHSEPCHAR);
-
-	// add absolute path
-	if (s == NULL || _paths.personal_dir != s) {
-		getcwd(_paths.personal_dir, MAX_PATH);
-		s = strchr(_paths.personal_dir, 0);
-		*s++ = PATHSEPCHAR;
-		ttd_strlcpy(s, PERSONAL_DIR, MAX_PATH);
-	}
-
-#endif /* defined(USE_HOMEDIR) */
-
-	s = strchr(_paths.personal_dir, 0);
-
-	// append a / ?
-	if (s[-1] != PATHSEPCHAR) strcpy(s, PATHSEP);
-
-	_paths.save_dir = str_fmt("%ssave", _paths.personal_dir);
-	_paths.autosave_dir = str_fmt("%s" PATHSEP "autosave", _paths.save_dir);
-	_paths.scenario_dir = str_fmt("%sscenario", _paths.personal_dir);
-	_paths.heightmap_dir = str_fmt("%sscenario" PATHSEP "heightmap", _paths.personal_dir);
-	_paths.gm_dir = str_fmt("%sgm" PATHSEP, _paths.game_data_dir);
-	_paths.data_dir = str_fmt("%sdata" PATHSEP, _paths.game_data_dir);
-
-	if (_config_file == NULL)
-		_config_file = str_fmt("%sopenttd.cfg", _paths.personal_dir);
-
-	_highscore_file = str_fmt("%shs.dat", _paths.personal_dir);
-	_log_file = str_fmt("%sopenttd.log", _paths.personal_dir);
-
-#if defined CUSTOM_LANG_DIR
-	// sets the search path for lng files to the custom one
-	_paths.lang_dir = malloc( MAX_PATH );
-	ttd_strlcpy( _paths.lang_dir, CUSTOM_LANG_DIR, MAX_PATH);
-#else
-	_paths.lang_dir = str_fmt("%slang" PATHSEP, _paths.game_data_dir);
-#endif
-
-	// create necessary folders
-#ifndef __INNOTEK_LIBC__
-	mkdir(_paths.personal_dir);
-	mkdir(_paths.save_dir);
-	mkdir(_paths.autosave_dir);
-	mkdir(_paths.scenario_dir);
-	mkdir(_paths.heightmap_dir);
-#else
-	mkdir(_paths.personal_dir, 0755);
-	mkdir(_paths.save_dir, 0755);
-	mkdir(_paths.autosave_dir, 0755);
-	mkdir(_paths.scenario_dir, 0755);
-	mkdir(_paths.heightmap_dir, 0755);
-#endif
-}
-
 /**
  * Insert a chunk of text from the clipboard onto the textbuffer. Get TEXT clipboard
  * and append this up to the maximum length (either absolute or screenlength). If maxlength
--- a/src/os_timer.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/os_timer.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -9,12 +9,12 @@
 #if defined(_MSC_VER) && !defined(RDTSC_AVAILABLE)
 # if _MSC_VER >= 1400
 #include <intrin.h>
-uint64 _rdtsc(void)
+uint64 _rdtsc()
 {
 	return __rdtsc();
 }
 #	else
-uint64 _declspec(naked) _rdtsc(void)
+uint64 _declspec(naked) _rdtsc()
 {
 	_asm {
 		rdtsc
@@ -27,14 +27,14 @@
 
 /* rdtsc for OS/2. Hopefully this works, who knows */
 #if defined (__WATCOMC__) && !defined(RDTSC_AVAILABLE)
-unsigned __int64 _rdtsc( void);
+unsigned __int64 _rdtsc();
 # pragma aux _rdtsc = 0x0F 0x31 value [edx eax] parm nomemory modify exact [edx eax] nomemory;
 # define RDTSC_AVAILABLE
 #endif
 
 /* rdtsc for all other *nix-en (hopefully). Use GCC syntax */
 #if defined(__i386__) || defined(__x86_64__) && !defined(RDTSC_AVAILABLE)
-uint64 _rdtsc(void)
+uint64 _rdtsc()
 {
 	uint32 high, low;
 	__asm__ __volatile__ ("rdtsc" : "=a" (low), "=d" (high));
@@ -45,7 +45,7 @@
 
 /* rdtsc for PPC which has this not */
 #if (defined(__POWERPC__) || defined(__powerpc__)) && !defined(RDTSC_AVAILABLE)
-uint64 _rdtsc(void)
+uint64 _rdtsc()
 {
 	uint32 high = 0, high2 = 0, low;
 	/* PPC does not have rdtsc, so we cheat by reading the two 32-bit time-counters
@@ -70,5 +70,5 @@
  * you just won't be able to profile your code with TIC()/TOC() */
 #if !defined(RDTSC_AVAILABLE)
 #warning "(non-fatal) No support for rdtsc(), you won't be able to profile with TIC/TOC"
-uint64 _rdtsc(void) {return 0;}
+uint64 _rdtsc() {return 0;}
 #endif
--- a/src/pathfind.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/pathfind.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -423,7 +423,7 @@
 		after_proc(&tpf);
 }
 
-typedef struct {
+struct StackedItem {
 	TileIndex tile;
 	uint16 cur_length; // This is the current length to this tile.
 	uint16 priority; // This is the current length + estimated length to the goal.
@@ -431,7 +431,7 @@
 	byte depth;
 	byte state;
 	byte first_track;
-} StackedItem;
+};
 
 static const Trackdir _new_trackdir[6][4] = {
 {TRACKDIR_X_NE,    INVALID_TRACKDIR, TRACKDIR_X_SW,    INVALID_TRACKDIR,},
@@ -442,13 +442,13 @@
 {INVALID_TRACKDIR, INVALID_TRACKDIR, TRACKDIR_RIGHT_S, TRACKDIR_RIGHT_N,},
 };
 
-typedef struct HashLink {
+struct HashLink {
 	TileIndex tile;
 	uint16 typelength;
 	uint16 next;
-} HashLink;
+};
 
-typedef struct {
+struct NewTrackPathFinder {
 	NTPEnumProc *enum_proc;
 	void *userdata;
 	TileIndex dest;
@@ -468,7 +468,7 @@
 
 	HashLink links[0x400]; // hash links
 
-} NewTrackPathFinder;
+};
 #define NTP_GET_LINK_OFFS(tpf, link) ((byte*)(link) - (byte*)tpf->links)
 #define NTP_GET_LINK_PTR(tpf, link_offs) (HashLink*)((byte*)tpf->links + (link_offs))
 
--- a/src/pathfind.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/pathfind.h	Mon Mar 19 12:38:16 2007 +0000
@@ -14,7 +14,7 @@
 //#define PF_BENCH // perform simple benchmarks on the train pathfinder (not
 //supported on all archs)
 
-typedef struct TrackPathFinder TrackPathFinder;
+struct TrackPathFinder;
 typedef bool TPFEnumProc(TileIndex tile, void *data, Trackdir trackdir, uint length, byte *state);
 typedef void TPFAfterProc(TrackPathFinder *tpf);
 
@@ -30,17 +30,17 @@
  */
 #define PATHFIND_HASH_TILE(tile) (TileX(tile) & 0x1F) + ((TileY(tile) & 0x1F) << 5)
 
-typedef struct TrackPathFinderLink {
+struct TrackPathFinderLink {
 	TileIndex tile;
 	uint16 flags;
 	uint16 next;
-} TrackPathFinderLink;
+};
 
-typedef struct RememberData {
+struct RememberData {
 	uint16 cur_length;
 	byte depth;
 	byte pft_var6;
-} RememberData;
+};
 
 struct TrackPathFinder {
 	int num_links_left;
@@ -67,10 +67,10 @@
 
 void FollowTrack(TileIndex tile, uint16 flags, DiagDirection direction, TPFEnumProc* enum_proc, TPFAfterProc* after_proc, void* data);
 
-typedef struct {
+struct FindLengthOfTunnelResult {
 	TileIndex tile;
 	int length;
-} FindLengthOfTunnelResult;
+};
 FindLengthOfTunnelResult FindLengthOfTunnel(TileIndex tile, DiagDirection direction);
 
 void NewTrainPathfind(TileIndex tile, TileIndex dest, RailTypeMask railtypes, DiagDirection direction, NTPEnumProc* enum_proc, void* data);
--- a/src/player.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/player.h	Mon Mar 19 12:38:16 2007 +0000
@@ -9,15 +9,15 @@
 #include "engine.h"
 #include "livery.h"
 
-typedef struct PlayerEconomyEntry {
+struct PlayerEconomyEntry {
 	int32 income;
 	int32 expenses;
 	int32 delivered_cargo;
 	int32 performance_history; // player score (scale 0-1000)
 	int64 company_value;
-} PlayerEconomyEntry;
+};
 
-typedef struct AiBuildRec {
+struct AiBuildRec {
 	TileIndex spec_tile;
 	TileIndex use_tile;
 	byte rand_rng;
@@ -28,9 +28,9 @@
 	byte buildcmd_b;
 	byte direction;
 	CargoID cargo;
-} AiBuildRec;
+};
 
-typedef struct PlayerAI {
+struct PlayerAI {
 	byte state;
 	byte tick;            // Used to determine how often to move
 	uint32 state_counter; // Can hold tile index!
@@ -68,9 +68,9 @@
 
 	TileIndex banned_tiles[16];
 	byte banned_val[16];
-} PlayerAI;
+};
 
-typedef struct Ai_PathFinderInfo {
+struct Ai_PathFinderInfo {
 	TileIndex start_tile_tl; // tl = top-left
 	TileIndex start_tile_br; // br = bottom-right
 	TileIndex end_tile_tl;   // tl = top-left
@@ -84,17 +84,17 @@
 	int position;            // Current position in the build-path, needed to build the path
 
 	bool rail_or_road;       // true = rail, false = road
-} Ai_PathFinderInfo;
+};
 
 // The amount of memory reserved for the AI-special-vehicles
 #define AI_MAX_SPECIAL_VEHICLES 100
 
-typedef struct Ai_SpecialVehicle {
+struct Ai_SpecialVehicle {
 	VehicleID veh_id;
 	uint32 flag;
-} Ai_SpecialVehicle;
+};
 
-typedef struct PlayerAiNew {
+struct PlayerAiNew {
 	uint8 state;
 	uint tick;
 	uint idle;
@@ -144,12 +144,12 @@
 	int to_ic;
 	byte to_type;
 
-} PlayerAiNew;
+};
 
 
 typedef uint32 PlayerFace;
 
-typedef struct Player {
+struct Player {
 	uint32 name_2;
 	uint16 name_1;
 
@@ -198,7 +198,7 @@
 	int16 engine_renew_months;
 	uint32 engine_renew_money;
 	uint16 num_engines[TOTAL_NUM_ENGINES]; // caches the number of engines of each type the player owns (no need to save this)
-} Player;
+};
 
 uint16 GetDrawStringPlayerColor(PlayerID player);
 
@@ -217,7 +217,7 @@
 // NOSAVE: can be determined from player structs
 VARDEF byte _player_colors[MAX_PLAYERS];
 
-static inline byte ActivePlayerCount(void)
+static inline byte ActivePlayerCount()
 {
 	const Player *p;
 	byte count = 0;
@@ -235,7 +235,7 @@
 	return &_players[i];
 }
 
-static inline bool IsLocalPlayer(void)
+static inline bool IsLocalPlayer()
 {
 	return _local_player == _current_player;
 }
@@ -282,17 +282,17 @@
 	return RAILTYPE_RAIL;
 }
 
-typedef struct HighScore {
+struct HighScore {
 	char company[100];
 	StringID title; // NO_SAVE, has troubles with changing string-numbers.
 	uint16 score;   // do NOT change type, will break hs.dat
-} HighScore;
+};
 
 VARDEF HighScore _highscore_table[5][5]; // 4 difficulty-settings (+ network); top 5
-void SaveToHighScore(void);
-void LoadFromHighScore(void);
+void SaveToHighScore();
+void LoadFromHighScore();
 int8 SaveHighScoreValue(const Player *p);
-int8 SaveHighScoreValueNetwork(void);
+int8 SaveHighScoreValueNetwork();
 
 /* Engine Replacement Functions */
 
--- a/src/player_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/player_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -286,10 +286,10 @@
 	3,
 };
 
-typedef struct livery_d {
+struct livery_d {
 	uint32 sel;
 	LiveryClass livery_class;
-} livery_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(livery_d));
 
 static void ShowColourDropDownMenu(Window *w, uint32 widget)
@@ -645,10 +645,10 @@
 	FOR_ALL_VEHICLES(v) {
 		if (v->owner == player) {
 			switch (v->type) {
-				case VEH_Train:    if (IsFrontEngine(v)) train++; break;
-				case VEH_Road:     road++; break;
-				case VEH_Aircraft: if (IsNormalAircraft(v)) air++; break;
-				case VEH_Ship:     ship++; break;
+				case VEH_TRAIN:    if (IsFrontEngine(v)) train++; break;
+				case VEH_ROAD:     road++; break;
+				case VEH_AIRCRAFT: if (IsNormalAircraft(v)) air++; break;
+				case VEH_SHIP:     ship++; break;
 				default: break;
 			}
 		}
@@ -1132,7 +1132,7 @@
 
 /* Show the endgame victory screen in 2050. Update the new highscore
  * if it was high enough */
-void ShowEndGameChart(void)
+void ShowEndGameChart()
 {
 	Window *w;
 
--- a/src/players.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/players.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -337,7 +337,7 @@
 static const byte _color_similar_1[16] = {8, 6, 255, 12,  255, 0, 1, 1, 0, 13,  11,  10, 3,   9,  15, 14};
 static const byte _color_similar_2[16] = {5, 7, 255, 255, 255, 8, 7, 6, 5, 12, 255, 255, 9, 255, 255, 255};
 
-static byte GeneratePlayerColor(void)
+static byte GeneratePlayerColor()
 {
 	byte colors[16], pcolor, t2;
 	int i,j,n;
@@ -425,7 +425,7 @@
 	}
 }
 
-static Player *AllocatePlayer(void)
+static Player *AllocatePlayer()
 {
 	Player *p;
 	// Find a free slot
@@ -494,13 +494,13 @@
 	return p;
 }
 
-void StartupPlayers(void)
+void StartupPlayers()
 {
 	// The AI starts like in the setting with +2 month max
 	_next_competitor_start = _opt.diff.competitor_start_time * 90 * DAY_TICKS + RandomRange(60 * DAY_TICKS) + 1;
 }
 
-static void MaybeStartNewPlayer(void)
+static void MaybeStartNewPlayer()
 {
 	uint n;
 	Player *p;
@@ -527,14 +527,14 @@
 	_next_competitor_start += _network_server ? InteractiveRandomRange(60 * DAY_TICKS) : RandomRange(60 * DAY_TICKS);
 }
 
-void InitializePlayers(void)
+void InitializePlayers()
 {
 	memset(_players, 0, sizeof(_players));
 	for (PlayerID i = PLAYER_FIRST; i != MAX_PLAYERS; i++) _players[i].index = i;
 	_cur_player_tick_index = 0;
 }
 
-void OnTick_Players(void)
+void OnTick_Players()
 {
 	Player *p;
 
@@ -560,7 +560,7 @@
 
 extern void ShowPlayerFinances(PlayerID player);
 
-void PlayersYearlyLoop(void)
+void PlayersYearlyLoop()
 {
 	Player *p;
 
@@ -593,7 +593,7 @@
 		const Engine* e = GetEngine(i);
 		const EngineInfo *ei = EngInfo(i);
 
-		if (e->type == VEH_Train && HASBIT(ei->climates, _opt.landscape) &&
+		if (e->type == VEH_TRAIN && HASBIT(ei->climates, _opt.landscape) &&
 				(HASBIT(e->player_avail, p) || _date >= e->intro_date + 365)) {
 			const RailVehicleInfo *rvi = RailVehInfo(i);
 
@@ -704,7 +704,7 @@
 					return CMD_ERROR;
 
 				// make sure that we do not replace a plane with a helicopter or vise versa
-				if (GetEngine(new_engine_type)->type == VEH_Aircraft &&
+				if (GetEngine(new_engine_type)->type == VEH_AIRCRAFT &&
 						(AircraftVehInfo(old_engine_type)->subtype & AIR_CTOL) != (AircraftVehInfo(new_engine_type)->subtype & AIR_CTOL))
 					return CMD_ERROR;
 
@@ -743,7 +743,7 @@
 			if (flags & DC_EXEC) {
 				p->renew_keep_length = (bool)GB(p2, 0, 1);
 				if (IsLocalPlayer()) {
-					InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train);
+					InvalidateWindow(WC_REPLACE_VEHICLE, VEH_TRAIN);
 				}
 			}
 		break;
@@ -946,7 +946,7 @@
 }
 
 /* Return true if any cheat has been used, false otherwise */
-static bool CheatHasBeenUsed(void)
+static bool CheatHasBeenUsed()
 {
 	const Cheat* cht = (Cheat*)&_cheats;
 	const Cheat* cht_last = &cht[sizeof(_cheats) / sizeof(Cheat)];
@@ -998,7 +998,7 @@
 
 /* Save the highscores in a network game when it has ended */
 #define LAST_HS_ITEM lengthof(_highscore_table) - 1
-int8 SaveHighScoreValueNetwork(void)
+int8 SaveHighScoreValueNetwork()
 {
 	const Player* p;
 	const Player* pl[MAX_PLAYERS];
@@ -1036,7 +1036,7 @@
 }
 
 /* Save HighScore table to file */
-void SaveToHighScore(void)
+void SaveToHighScore()
 {
 	FILE *fp = fopen(_highscore_file, "wb");
 
@@ -1060,7 +1060,7 @@
 }
 
 /* Initialize the highscore table to 0 and if any file exists, load in values */
-void LoadFromHighScore(void)
+void LoadFromHighScore()
 {
 	FILE *fp = fopen(_highscore_file, "rb");
 
@@ -1257,7 +1257,7 @@
 	}
 }
 
-static void Save_PLYR(void)
+static void Save_PLYR()
 {
 	Player *p;
 	FOR_ALL_PLAYERS(p) {
@@ -1268,7 +1268,7 @@
 	}
 }
 
-static void Load_PLYR(void)
+static void Load_PLYR()
 {
 	int index;
 	while ((index = SlIterateArray()) != -1) {
--- a/src/queue.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/queue.h	Mon Mar 19 12:38:16 2007 +0000
@@ -9,21 +9,19 @@
 //#define HASH_STATS
 
 
-typedef struct Queue Queue;
+struct Queue;
 typedef bool Queue_PushProc(Queue* q, void* item, int priority);
 typedef void* Queue_PopProc(Queue* q);
 typedef bool Queue_DeleteProc(Queue* q, void* item, int priority);
 typedef void Queue_ClearProc(Queue* q, bool free_values);
 typedef void Queue_FreeProc(Queue* q, bool free_values);
 
-typedef struct InsSortNode InsSortNode;
 struct InsSortNode {
 	void* item;
 	int priority;
 	InsSortNode* next;
 };
 
-typedef struct BinaryHeapNode BinaryHeapNode;
 struct BinaryHeapNode {
 	void* item;
 	int priority;
@@ -99,7 +97,6 @@
 /*
  * Hash
  */
-typedef struct HashNode HashNode;
 struct HashNode {
 	uint key1;
 	uint key2;
@@ -111,7 +108,7 @@
  * the resulting range is clearly defined.
  */
 typedef uint Hash_HashProc(uint key1, uint key2);
-typedef struct Hash {
+struct Hash {
 	/* The hash function used */
 	Hash_HashProc* hash;
 	/* The amount of items in the hash */
@@ -123,7 +120,7 @@
 	/* A pointer to an array of numbuckets booleans, which will be true if
 	 * there are any Nodes in the bucket */
 	bool* buckets_in_use;
-} Hash;
+};
 
 /* Call these function to manipulate a hash */
 
--- a/src/rail.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/rail.h	Mon Mar 19 12:38:16 2007 +0000
@@ -9,7 +9,7 @@
 #include "direction.h"
 #include "tile.h"
 
-typedef enum RailTypes {
+enum RailType {
 	RAILTYPE_BEGIN    = 0,
 	RAILTYPE_RAIL     = 0,
 	RAILTYPE_ELECTRIC = 1,
@@ -17,7 +17,7 @@
 	RAILTYPE_MAGLEV   = 3,
 	RAILTYPE_END,
 	INVALID_RAILTYPE  = 0xFF
-} RailType;
+};
 
 typedef byte RailTypeMask;
 
@@ -30,7 +30,7 @@
 
 /** These are used to specify a single track.
  * Can be translated to a trackbit with TrackToTrackbit */
-typedef enum Track {
+enum Track {
 	TRACK_BEGIN = 0,
 	TRACK_X     = 0,
 	TRACK_Y     = 1,
@@ -40,7 +40,7 @@
 	TRACK_RIGHT = 5,
 	TRACK_END,
 	INVALID_TRACK = 0xFF
-} Track;
+};
 
 /** Allow incrementing of Track variables */
 DECLARE_POSTFIX_INCREMENT(Track);
@@ -61,7 +61,7 @@
 
 
 /** Bitfield corresponding to Track */
-typedef enum TrackBits {
+enum TrackBits {
 	TRACK_BIT_NONE    = 0U,
 	TRACK_BIT_X       = 1U << TRACK_X,
 	TRACK_BIT_Y       = 1U << TRACK_Y,
@@ -81,7 +81,7 @@
 	TRACK_BIT_WORMHOLE = 0x40U,
 	TRACK_BIT_DEPOT   = 0x80U,
 	INVALID_TRACK_BIT = 0xFF
-} TrackBits;
+};
 
 /** Define basic enum properties */
 template <> struct EnumPropsT<TrackBits> : MakeEnumPropsT<TrackBits, byte, TRACK_BIT_NONE, TRACK_BIT_ALL, INVALID_TRACK_BIT> {};
@@ -110,7 +110,7 @@
  * reversing track dirs are not considered to be 'valid' except in a small
  * corner in the road vehicle controller.
  */
-typedef enum Trackdirs {
+enum Trackdir {
 	TRACKDIR_BEGIN    =  0,
 	TRACKDIR_X_NE     =  0,
 	TRACKDIR_Y_SE     =  1,
@@ -130,7 +130,7 @@
 	TRACKDIR_RVREV_NW = 15,
 	TRACKDIR_END,
 	INVALID_TRACKDIR  = 0xFF,
-} Trackdir;
+};
 
 /** Define basic enum properties */
 template <> struct EnumPropsT<Trackdir> : MakeEnumPropsT<Trackdir, byte, TRACKDIR_BEGIN, TRACKDIR_END, INVALID_TRACKDIR> {};
@@ -138,7 +138,7 @@
 
 /** These are a combination of tracks and directions. Values are 0-5 in one
  * direction (corresponding to the Track enum) and 8-13 in the other direction. */
-typedef enum TrackdirBits {
+enum TrackdirBits {
 	TRACKDIR_BIT_NONE     = 0x0000,
 	TRACKDIR_BIT_X_NE     = 0x0001,
 	TRACKDIR_BIT_Y_SE     = 0x0002,
@@ -155,7 +155,7 @@
 	TRACKDIR_BIT_RIGHT_N  = 0x2000,
 	TRACKDIR_BIT_MASK     = 0x3F3F,
 	INVALID_TRACKDIR_BIT  = 0xFFFF,
-} TrackdirBits;
+};
 
 /** Define basic enum properties */
 template <> struct EnumPropsT<TrackdirBits> : MakeEnumPropsT<TrackdirBits, uint16, TRACKDIR_BIT_NONE, TRACKDIR_BIT_MASK, INVALID_TRACKDIR_BIT> {};
@@ -164,7 +164,7 @@
 
 /** This struct contains all the info that is needed to draw and construct tracks.
  */
-typedef struct RailtypeInfo {
+struct RailtypeInfo {
 	/** Struct containing the main sprites. @note not all sprites are listed, but only
 	 *  the ones used directly in the code */
 	struct {
@@ -237,7 +237,7 @@
 	 * Offset to add to ground sprite when drawing custom waypoints / stations
 	 */
 	byte custom_ground_offset;
-} RailtypeInfo;
+};
 
 
 // these are the maximums used for updating signal blocks, and checking if a depot is in a pbs block
--- a/src/rail_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/rail_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -879,7 +879,7 @@
 
 			/* update power of trains in this depot */
 			FOR_ALL_VEHICLES(v) {
-				if (v->type == VEH_Train && IsFrontEngine(v) && v->tile == tile && v->u.rail.track == 0x80) {
+				if (v->type == VEH_TRAIN && IsFrontEngine(v) && v->tile == tile && v->u.rail.track == 0x80) {
 					TrainPowerChanged(v);
 				}
 			}
@@ -1417,7 +1417,7 @@
 	DrawTileSequence(x, y, dts->ground_sprite + offset, dts->seq, 0);
 }
 
-typedef struct SetSignalsData {
+struct SetSignalsData {
 	int cur;
 	int cur_stack;
 	bool stop;
@@ -1435,7 +1435,7 @@
 	TileIndex next_tile[NUM_SSD_STACK];
 	DiagDirectionByte next_dir[NUM_SSD_STACK];
 
-} SetSignalsData;
+};
 
 static bool SetSignalsEnumProc(TileIndex tile, void* data, Trackdir trackdir, uint length, byte* state)
 {
@@ -1473,16 +1473,16 @@
 }
 
 /* Struct to parse data from VehicleFromPos to SignalVehicleCheckProc */
-typedef struct SignalVehicleCheckStruct {
+struct SignalVehicleCheckStruct {
 	TileIndex tile;
 	uint track;
-} SignalVehicleCheckStruct;
+};
 
 static void *SignalVehicleCheckProc(Vehicle *v, void *data)
 {
 	const SignalVehicleCheckStruct* dest = (SignalVehicleCheckStruct*)data;
 
-	if (v->type != VEH_Train) return NULL;
+	if (v->type != VEH_TRAIN) return NULL;
 
 	/* Wrong tile, or no train? Not a match */
 	if (v->tile != dest->tile) return NULL;
@@ -1888,7 +1888,7 @@
 static void ClickTile_Track(TileIndex tile)
 {
 	switch (GetRailTileType(tile)) {
-		case RAIL_TILE_DEPOT:    ShowDepotWindow(tile, VEH_Train);                  break;
+		case RAIL_TILE_DEPOT:    ShowDepotWindow(tile, VEH_TRAIN);                  break;
 		case RAIL_TILE_WAYPOINT: ShowRenameWaypointWindow(GetWaypointByTile(tile)); break;
 		default: break;
 	}
@@ -1951,7 +1951,7 @@
 	int length;
 
 	// this routine applies only to trains in depot tiles
-	if (v->type != VEH_Train || !IsTileDepotType(tile, TRANSPORT_RAIL)) return VETSB_CONTINUE;
+	if (v->type != VEH_TRAIN || !IsTileDepotType(tile, TRANSPORT_RAIL)) return VETSB_CONTINUE;
 
 	/* depot direction */
 	dir = GetRailDepotDirection(tile);
--- a/src/rail_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/rail_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -45,9 +45,9 @@
 
 
 static void HandleStationPlacement(TileIndex start, TileIndex end);
-static void ShowBuildTrainDepotPicker(void);
-static void ShowBuildWaypointPicker(void);
-static void ShowStationBuilder(void);
+static void ShowBuildTrainDepotPicker();
+static void ShowBuildWaypointPicker();
+static void ShowStationBuilder();
 
 void CcPlaySound1E(bool success, TileIndex tile, uint32 p1, uint32 p2)
 {
@@ -348,7 +348,7 @@
 	);
 }
 
-static void HandleAutodirPlacement(void)
+static void HandleAutodirPlacement()
 {
 	TileHighlightData *thd = &_thd;
 	int trackstat = thd->drawstyle & 0xF; // 0..5
@@ -361,7 +361,7 @@
 	DoRailroadTrack(trackstat);
 }
 
-static void HandleAutoSignalPlacement(void)
+static void HandleAutoSignalPlacement()
 {
 	TileHighlightData *thd = &_thd;
 	uint32 p2 = GB(thd->drawstyle, 0, 3); // 0..5
@@ -1012,7 +1012,7 @@
 	StationBuildWndProc
 };
 
-static void ShowStationBuilder(void)
+static void ShowStationBuilder()
 {
 	Window *w;
 	if (GetNumStationClasses() <= 2 && GetNumCustomStations(STAT_CLASS_DFLT) == 1) {
@@ -1091,7 +1091,7 @@
 	BuildTrainDepotWndProc
 };
 
-static void ShowBuildTrainDepotPicker(void)
+static void ShowBuildTrainDepotPicker()
 {
 	AllocateWindowDesc(&_build_depot_desc);
 }
@@ -1177,7 +1177,7 @@
 	BuildWaypointWndProc
 };
 
-static void ShowBuildWaypointPicker(void)
+static void ShowBuildWaypointPicker()
 {
 	Window *w = AllocateWindowDesc(&_build_waypoint_desc);
 	w->hscroll.cap = 5;
@@ -1185,7 +1185,7 @@
 }
 
 
-void InitializeRailGui(void)
+void InitializeRailGui()
 {
 	_build_depot_direction = DIAGDIR_NW;
 	_railstation.numtracks = 1;
--- a/src/rail_map.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/rail_map.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,12 +8,12 @@
 #include "tile.h"
 
 
-typedef enum RailTileType {
+enum RailTileType {
 	RAIL_TILE_NORMAL   = 0,
 	RAIL_TILE_SIGNALS  = 1,
 	RAIL_TILE_WAYPOINT = 2,
 	RAIL_TILE_DEPOT    = 3,
-} RailTileType;
+};
 
 static inline RailTileType GetRailTileType(TileIndex t)
 {
@@ -118,12 +118,12 @@
 	return (WaypointID)_m[t].m2;
 }
 
-typedef enum SignalType {
+enum SignalType {
 	SIGTYPE_NORMAL  = 0, // normal signal
 	SIGTYPE_ENTRY   = 1, // presignal block entry
 	SIGTYPE_EXIT    = 2, // presignal block exit
 	SIGTYPE_COMBO   = 3  // presignal inter-block
-} SignalType;
+};
 
 static inline SignalType GetSignalType(TileIndex t)
 {
@@ -159,10 +159,10 @@
 }
 
 
-typedef enum SignalVariant {
+enum SignalVariant {
 	SIG_ELECTRIC  = 0,
 	SIG_SEMAPHORE = 1
-} SignalVariant;
+};
 
 static inline SignalVariant GetSignalVariant(TileIndex t)
 {
@@ -183,10 +183,10 @@
  * simple boolean logic will do. But do try to compare to this enum instead of
  * normal boolean evaluation, since that will make future additions easier.
  */
-typedef enum SignalStates {
+enum SignalState {
 	SIGNAL_STATE_RED   = 0,
 	SIGNAL_STATE_GREEN = 1,
-} SignalState;
+};
 
 static inline SignalState GetSingleSignalState(TileIndex t, byte signalbit)
 {
@@ -242,7 +242,7 @@
 RailType GetTileRailType(TileIndex tile);
 
 
-typedef enum RailGroundType {
+enum RailGroundType {
 	RAIL_GROUND_BARREN       =  0,
 	RAIL_GROUND_GRASS        =  1,
 	RAIL_GROUND_FENCE_NW     =  2,
@@ -256,7 +256,7 @@
 	RAIL_GROUND_FENCE_HORIZ1 = 10,
 	RAIL_GROUND_FENCE_HORIZ2 = 11,
 	RAIL_GROUND_ICE_DESERT   = 12,
-} RailGroundType;
+};
 
 static inline void SetRailGroundType(TileIndex t, RailGroundType rgt)
 {
--- a/src/road.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/road.h	Mon Mar 19 12:38:16 2007 +0000
@@ -5,7 +5,7 @@
 
 #include "helpers.hpp"
 
-typedef enum RoadBits {
+enum RoadBits {
 	ROAD_NONE = 0U,
 	ROAD_NW  = 1U,
 	ROAD_SW  = 2U,
@@ -14,7 +14,7 @@
 	ROAD_X   = ROAD_SW | ROAD_NE,
 	ROAD_Y   = ROAD_NW | ROAD_SE,
 	ROAD_ALL = ROAD_X  | ROAD_Y
-} RoadBits;
+};
 
 DECLARE_ENUM_AS_BIT_SET(RoadBits);
 
--- a/src/road_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/road_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -70,7 +70,7 @@
 		// you can remove all kind of roads with extra dynamite
 		if (_patches.extra_dynamite) return true;
 
-		t = ClosestTownFromTile(tile, _patches.dist_local_authority);
+		t = ClosestTownFromTile(tile, (uint)-1);
 
 		SetDParam(0, t->index);
 		_error_message = STR_2009_LOCAL_AUTHORITY_REFUSES;
@@ -599,11 +599,11 @@
 }
 
 
-typedef struct DrawRoadTileStruct {
+struct DrawRoadTileStruct {
 	uint16 image;
 	byte subcoord_x;
 	byte subcoord_y;
-} DrawRoadTileStruct;
+};
 
 #include "table/road_land.h"
 
@@ -935,7 +935,7 @@
 
 static void ClickTile_Road(TileIndex tile)
 {
-	if (GetRoadTileType(tile) == ROAD_TILE_DEPOT) ShowDepotWindow(tile, VEH_Road);
+	if (GetRoadTileType(tile) == ROAD_TILE_DEPOT) ShowDepotWindow(tile, VEH_ROAD);
 }
 
 static const byte _road_trackbits[16] = {
@@ -1001,7 +1001,7 @@
 {
 	switch (GetRoadTileType(tile)) {
 		case ROAD_TILE_CROSSING:
-			if (v->type == VEH_Train && !IsCrossingBarred(tile)) {
+			if (v->type == VEH_TRAIN && !IsCrossingBarred(tile)) {
 				/* train crossing a road */
 				SndPlayVehicleFx(SND_0E_LEVEL_CROSSING, v);
 				BarCrossing(tile);
@@ -1010,7 +1010,7 @@
 			break;
 
 		case ROAD_TILE_DEPOT:
-			if (v->type == VEH_Road &&
+			if (v->type == VEH_ROAD &&
 					v->u.road.frame == 11 &&
 					_roadveh_enter_depot_unk0[GetRoadDepotDirection(tile)] == v->u.road.state) {
 				VehicleEnterDepot(v);
--- a/src/road_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/road_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -21,9 +21,9 @@
 #include "station.h"
 
 
-static void ShowBusStationPicker(void);
-static void ShowTruckStationPicker(void);
-static void ShowRoadDepotPicker(void);
+static void ShowBusStationPicker();
+static void ShowTruckStationPicker();
+static void ShowRoadDepotPicker();
 
 static bool _remove_button_clicked;
 
@@ -346,7 +346,7 @@
 	BuildRoadToolbWndProc
 };
 
-void ShowBuildRoadToolbar(void)
+void ShowBuildRoadToolbar()
 {
 	if (!IsValidPlayer(_current_player)) return;
 
@@ -380,7 +380,7 @@
 	BuildRoadToolbWndProc
 };
 
-void ShowBuildRoadScenToolbar(void)
+void ShowBuildRoadScenToolbar()
 {
 	AllocateWindowDescFront(&_build_road_scen_desc, 0);
 }
@@ -440,7 +440,7 @@
 	BuildRoadDepotWndProc
 };
 
-static void ShowRoadDepotPicker(void)
+static void ShowRoadDepotPicker()
 {
 	AllocateWindowDesc(&_build_road_depot_desc);
 }
@@ -543,7 +543,7 @@
 	RoadStationPickerWndProc
 };
 
-static void ShowBusStationPicker(void)
+static void ShowBusStationPicker()
 {
 	AllocateWindowDesc(&_bus_station_picker_desc);
 }
@@ -572,12 +572,12 @@
 	RoadStationPickerWndProc
 };
 
-static void ShowTruckStationPicker(void)
+static void ShowTruckStationPicker()
 {
 	AllocateWindowDesc(&_truck_station_picker_desc);
 }
 
-void InitializeRoadGui(void)
+void InitializeRoadGui()
 {
 	_road_depot_orientation = DIAGDIR_NW;
 	_road_station_picker_orientation = DIAGDIR_NW;
--- a/src/road_map.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/road_map.h	Mon Mar 19 12:38:16 2007 +0000
@@ -9,11 +9,11 @@
 #include "tile.h"
 
 
-typedef enum RoadTileType {
+enum RoadTileType {
 	ROAD_TILE_NORMAL,
 	ROAD_TILE_CROSSING,
 	ROAD_TILE_DEPOT
-} RoadTileType;
+};
 
 static inline RoadTileType GetRoadTileType(TileIndex t)
 {
@@ -105,7 +105,7 @@
 }
 
 
-typedef enum Roadside {
+enum Roadside {
 	ROADSIDE_BARREN           = 0,
 	ROADSIDE_GRASS            = 1,
 	ROADSIDE_PAVED            = 2,
@@ -113,7 +113,7 @@
 	ROADSIDE_TREES            = 5,
 	ROADSIDE_GRASS_ROAD_WORKS = 6,
 	ROADSIDE_PAVED_ROAD_WORKS = 7
-} Roadside;
+};
 
 static inline Roadside GetRoadside(TileIndex tile)
 {
--- a/src/roadveh.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/roadveh.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,7 +8,7 @@
 
 static inline bool IsRoadVehInDepot(const Vehicle* v)
 {
-	assert(v->type == VEH_Road);
+	assert(v->type == VEH_ROAD);
 	return v->u.road.state == 254;
 }
 
--- a/src/roadveh_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/roadveh_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -30,6 +30,7 @@
 #include "newgrf_sound.h"
 #include "yapf/yapf.h"
 #include "date.h"
+#include "cargotype.h"
 
 static const uint16 _roadveh_images[63] = {
 	0xCD4, 0xCDC, 0xCE4, 0xCEC, 0xCF4, 0xCFC, 0xD0C, 0xD14,
@@ -128,7 +129,7 @@
 	UnitID unit_num;
 	Engine *e;
 
-	if (!IsEngineBuildable(p1, VEH_Road, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
+	if (!IsEngineBuildable(p1, VEH_ROAD, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
 
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
@@ -144,7 +145,7 @@
 	if (v == NULL) return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 
 	/* find the first free roadveh id */
-	unit_num = HASBIT(p2, 0) ? 0 : GetFreeUnitNumber(VEH_Road);
+	unit_num = HASBIT(p2, 0) ? 0 : GetFreeUnitNumber(VEH_ROAD);
 	if (unit_num > _patches.max_roadveh)
 		return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 
@@ -200,7 +201,7 @@
 		v->date_of_last_service = _date;
 		v->build_year = _cur_year;
 
-		v->type = VEH_Road;
+		v->type = VEH_ROAD;
 		v->cur_image = 0xC15;
 		v->random_bits = VehicleRandomBits();
 
@@ -213,7 +214,7 @@
 		RebuildVehicleLists();
 		InvalidateWindow(WC_COMPANY, v->owner);
 		if (IsLocalPlayer())
-			InvalidateAutoreplaceWindow(VEH_Road); // updates the replace Road window
+			InvalidateAutoreplaceWindow(VEH_ROAD); // updates the replace Road window
 
 		GetPlayer(_current_player)->num_engines[p1]++;
 	}
@@ -235,7 +236,7 @@
 
 	v = GetVehicle(p1);
 
-	if (v->type != VEH_Road || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_ROAD || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	/* Check if this road veh can be started/stopped. The callback will fail or
 	 * return 0xFF if it can. */
@@ -285,7 +286,7 @@
 
 	v = GetVehicle(p1);
 
-	if (v->type != VEH_Road || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_ROAD || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
@@ -306,11 +307,11 @@
 	return -(int32)v->value;
 }
 
-typedef struct RoadFindDepotData {
+struct RoadFindDepotData {
 	uint best_length;
 	TileIndex tile;
 	OwnerByte owner;
-} RoadFindDepotData;
+};
 
 static const DiagDirection _road_pf_directions[] = {
 	DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_SW, DIAGDIR_SE, INVALID_DIAGDIR, INVALID_DIAGDIR,
@@ -384,14 +385,14 @@
 	if (p2 & DEPOT_MASS_SEND) {
 		/* Mass goto depot requested */
 		if (!ValidVLWFlags(p2 & VLW_MASK)) return CMD_ERROR;
-		return SendAllVehiclesToDepot(VEH_Road, flags, p2 & DEPOT_SERVICE, _current_player, (p2 & VLW_MASK), p1);
+		return SendAllVehiclesToDepot(VEH_ROAD, flags, p2 & DEPOT_SERVICE, _current_player, (p2 & VLW_MASK), p1);
 	}
 
 	if (!IsValidVehicleID(p1)) return CMD_ERROR;
 
 	v = GetVehicle(p1);
 
-	if (v->type != VEH_Road || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_ROAD || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	if (v->vehstatus & VS_CRASHED) return CMD_ERROR;
 
@@ -454,7 +455,7 @@
 
 	v = GetVehicle(p1);
 
-	if (v->type != VEH_Road || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_ROAD || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	if (v->vehstatus & VS_STOPPED ||
 			v->u.road.crashed_ctr != 0 ||
@@ -577,7 +578,7 @@
 	const Vehicle* u = (Vehicle*)data;
 
 	return
-		v->type == VEH_Train &&
+		v->type == VEH_TRAIN &&
 		myabs(v->z_pos - u->z_pos) <= 6 &&
 		myabs(v->x_pos - u->x_pos) <= 4 &&
 		myabs(v->y_pos - u->y_pos) <= 4 ?
@@ -595,7 +596,7 @@
 	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
 
 	pass = 1;
-	if (v->cargo_type == CT_PASSENGERS) pass += v->cargo_count;
+	if (IsCargoInClass(v->cargo_type, CC_PASSENGERS)) pass += v->cargo_count;
 	v->cargo_count = 0;
 
 	SetDParam(0, pass);
@@ -682,8 +683,7 @@
 	order = GetVehicleOrder(v, v->cur_order_index);
 
 	if (order == NULL) {
-		v->current_order.type = OT_NOTHING;
-		v->current_order.flags = 0;
+		v->current_order.Free();
 		v->dest_tile = 0;
 		ClearSlot(v);
 		return;
@@ -706,7 +706,7 @@
 			}
 
 			rs = GetStation(order->dest)->GetPrimaryRoadStop(
-				v->cargo_type == CT_PASSENGERS ? RoadStop::BUS : RoadStop::TRUCK
+				IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK
 			);
 
 			if (rs != NULL) {
@@ -785,12 +785,12 @@
 	}
 }
 
-typedef struct RoadVehFindData {
+struct RoadVehFindData {
 	int x;
 	int y;
 	const Vehicle* veh;
 	Direction dir;
-} RoadVehFindData;
+};
 
 static void* EnumCheckRoadVehClose(Vehicle *v, void* data)
 {
@@ -804,7 +804,7 @@
 
 	return
 		rvf->veh != v &&
-		v->type == VEH_Road &&
+		v->type == VEH_ROAD &&
 		!IsRoadVehInDepot(v) &&
 		myabs(v->z_pos - rvf->veh->z_pos) < 6 &&
 		v->direction == rvf->dir &&
@@ -844,7 +844,7 @@
 
 static void RoadVehArrivesAt(const Vehicle* v, Station* st)
 {
-	if (v->cargo_type == CT_PASSENGERS) {
+	if (IsCargoInClass(v->cargo_type, CC_PASSENGERS)) {
 		/* Check if station was ever visited before */
 		if (!(st->had_vehicle_of_type & HVOT_BUS)) {
 			uint32 flags;
@@ -933,19 +933,19 @@
 	return ChangeDir(old_dir, delta);
 }
 
-typedef struct OvertakeData {
+struct OvertakeData {
 	const Vehicle* u;
 	const Vehicle* v;
 	TileIndex tile;
 	byte tilebits;
-} OvertakeData;
+};
 
 static void* EnumFindVehToOvertake(Vehicle* v, void* data)
 {
 	const OvertakeData* od = (OvertakeData*)data;
 
 	return
-		v->tile == od->tile && v->type == VEH_Road && v != od->u && v != od->v ?
+		v->tile == od->tile && v->type == VEH_ROAD && v != od->u && v != od->v ?
 			v : NULL;
 }
 
@@ -1030,11 +1030,11 @@
 	return i;
 }
 
-typedef struct {
+struct FindRoadToChooseData {
 	TileIndex dest;
 	uint maxtracklen;
 	uint mindist;
-} FindRoadToChooseData;
+};
 
 static bool EnumRoadTrackFindDist(TileIndex tile, void* data, Trackdir trackdir, uint length, byte* state)
 {
@@ -1092,7 +1092,7 @@
 			trackdirs = TRACKDIR_BIT_NONE;
 		} else {
 			/* Our station */
-			RoadStop::Type rstype = (v->cargo_type == CT_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK;
+			RoadStop::Type rstype = IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK;
 
 			if (GetRoadStopType(tile) != rstype) {
 				/* Wrong station type */
@@ -1256,9 +1256,9 @@
 	RVC_DRIVE_THROUGH_STOP_FRAME = 7
 };
 
-typedef struct RoadDriveEntry {
-	byte x,y;
-} RoadDriveEntry;
+struct RoadDriveEntry {
+	byte x, y;
+};
 
 #include "table/roadveh.h"
 
@@ -1547,7 +1547,7 @@
 			_road_veh_data_1[v->u.road.state - RVSB_IN_ROAD_STOP + (_opt.road_side << RVS_DRIVE_SIDE)] == v->u.road.frame) ||
 			(IS_BYTE_INSIDE(v->u.road.state, RVSB_IN_DT_ROAD_STOP, RVSB_IN_DT_ROAD_STOP_END) &&
 			v->current_order.dest == GetStationIndex(v->tile) &&
-			GetRoadStopType(v->tile) == ((v->cargo_type == CT_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK) &&
+			GetRoadStopType(v->tile) == (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK) &&
 			v->u.road.frame == RVC_DRIVE_THROUGH_STOP_FRAME)) {
 
 		RoadStop *rs = GetRoadStopByTile(v->tile, GetRoadStopType(v->tile));
@@ -1563,7 +1563,7 @@
 
 			if (IsDriveThroughStopTile(v->tile)) {
 				TileIndex next_tile = TILE_ADD(v->tile, TileOffsByDir(v->direction));
-				RoadStop::Type type = (v->cargo_type == CT_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK;
+				RoadStop::Type type = IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK;
 
 				assert(HASBIT(v->u.road.state, RVS_IS_STOPPING));
 
@@ -1618,8 +1618,7 @@
 				v->cur_speed = 0;
 				return;
 			}
-			v->current_order.type = OT_NOTHING;
-			v->current_order.flags = 0;
+			v->current_order.Free();
 			ClearSlot(v);
 		}
 
@@ -1756,7 +1755,7 @@
 	/* update destination */
 	if (v->current_order.type == OT_GOTO_STATION && v->u.road.slot == NULL && !(v->vehstatus & VS_CRASHED)) {
 		Station* st = GetStation(v->current_order.dest);
-		RoadStop* rs = st->GetPrimaryRoadStop(v->cargo_type == CT_PASSENGERS ? RoadStop::BUS : RoadStop::TRUCK);
+		RoadStop* rs = st->GetPrimaryRoadStop(IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK);
 		RoadStop* best = NULL;
 
 		if (rs != NULL) {
@@ -1824,12 +1823,12 @@
 }
 
 
-void RoadVehiclesYearlyLoop(void)
+void RoadVehiclesYearlyLoop()
 {
 	Vehicle *v;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Road) {
+		if (v->type == VEH_ROAD) {
 			v->profit_last_year = v->profit_this_year;
 			v->profit_this_year = 0;
 			InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
@@ -1856,10 +1855,10 @@
 
 	v = GetVehicle(p1);
 
-	if (v->type != VEH_Road || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_ROAD || !CheckOwnership(v->owner)) return CMD_ERROR;
 	if (!IsRoadVehInDepotStopped(v)) return_cmd_error(STR_9013_MUST_BE_STOPPED_INSIDE);
 
-	if (new_cid > NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
+	if (new_cid >= NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
 
 	SET_EXPENSES_TYPE(EXPENSES_ROADVEH_RUN);
 
--- a/src/saveload.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/saveload.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -28,12 +28,12 @@
 #include "variables.h"
 #include <setjmp.h>
 
-extern const uint16 SAVEGAME_VERSION = 51;
+extern const uint16 SAVEGAME_VERSION = 52;
 uint16 _sl_version;       ///< the major savegame version identifier
 byte   _sl_minor_version; ///< the minor savegame version, DO NOT USE!
 
 typedef void WriterProc(uint len);
-typedef uint ReaderProc(void);
+typedef uint ReaderProc();
 
 /** The saveload struct, containing reader-writer functions, bufffer, version, etc. */
 static struct {
@@ -63,7 +63,7 @@
 	uint bufsize;                        ///< the size of the temporary memory *buf
 	FILE *fh;                            ///< the file from which is read or written to
 
-	void (*excpt_uninit)(void);          ///< the function to execute on any encountered error
+	void (*excpt_uninit)();              ///< the function to execute on any encountered error
 	const char *excpt_msg;               ///< the error message
 	jmp_buf excpt;                       ///< @todo used to jump to "exception handler";  really ugly
 } _sl;
@@ -74,7 +74,7 @@
 /**
  * Fill the input buffer by reading from the file with the given reader
  */
-static void SlReadFill(void)
+static void SlReadFill()
 {
 	uint len = _sl.read_bytes();
 	assert(len != 0);
@@ -84,7 +84,7 @@
 	_sl.offs_base += len;
 }
 
-static inline uint32 SlGetOffs(void) {return _sl.offs_base - (_sl.bufe - _sl.bufp);}
+static inline uint32 SlGetOffs() {return _sl.offs_base - (_sl.bufe - _sl.bufp);}
 
 /** Return the size in bytes of a certain type of normal/atomic variable
  * as it appears in memory. See VarTypes
@@ -111,13 +111,13 @@
 }
 
 /** Return the size in bytes of a reference (pointer) */
-static inline size_t SlCalcRefLen(void) {return 2;}
+static inline size_t SlCalcRefLen() {return 2;}
 
 /** Flush the output buffer by writing to disk with the given reader.
  * If the buffer pointer has not yet been set up, set it up now. Usually
  * only called when the buffer is full, or there is no more data to be processed
  */
-static void SlWriteFill(void)
+static void SlWriteFill()
 {
 	/* flush the buffer to disk (the writer) */
 	if (_sl.bufp != NULL) {
@@ -145,14 +145,14 @@
  * flush it to its final destination
  * @return return the read byte from file
  */
-static inline byte SlReadByteInternal(void)
+static inline byte SlReadByteInternal()
 {
 	if (_sl.bufp == _sl.bufe) SlReadFill();
 	return *_sl.bufp++;
 }
 
 /** Wrapper for SlReadByteInternal */
-byte SlReadByte(void) {return SlReadByteInternal();}
+byte SlReadByte() {return SlReadByteInternal();}
 
 /** Write away a single byte from memory. If the temporary buffer is full,
  * flush it to its destination (file)
@@ -167,19 +167,19 @@
 /** Wrapper for SlWriteByteInternal */
 void SlWriteByte(byte b) {SlWriteByteInternal(b);}
 
-static inline int SlReadUint16(void)
+static inline int SlReadUint16()
 {
 	int x = SlReadByte() << 8;
 	return x | SlReadByte();
 }
 
-static inline uint32 SlReadUint32(void)
+static inline uint32 SlReadUint32()
 {
 	uint32 x = SlReadUint16() << 16;
 	return x | SlReadUint16();
 }
 
-static inline uint64 SlReadUint64(void)
+static inline uint64 SlReadUint64()
 {
 	uint32 x = SlReadUint32();
 	uint32 y = SlReadUint32();
@@ -213,7 +213,7 @@
  * x = ((x & 0x7F) << 8) + SlReadByte();
  * @return Return the value of the index
  */
-static uint SlReadSimpleGamma(void)
+static uint SlReadSimpleGamma()
 {
 	uint i = SlReadByte();
 	if (HASBIT(i, 7)) {
@@ -269,10 +269,10 @@
 	return 1 + (i >= (1 << 7)) + (i >= (1 << 14)) + (i >= (1 << 21));
 }
 
-static inline uint SlReadSparseIndex(void) {return SlReadSimpleGamma();}
+static inline uint SlReadSparseIndex() {return SlReadSimpleGamma();}
 static inline void SlWriteSparseIndex(uint index) {SlWriteSimpleGamma(index);}
 
-static inline uint SlReadArrayLength(void) {return SlReadSimpleGamma();}
+static inline uint SlReadArrayLength() {return SlReadSimpleGamma();}
 static inline void SlWriteArrayLength(uint length) {SlWriteSimpleGamma(length);}
 static inline uint SlGetArrayLength(uint length) {return SlGetGammaLength(length);}
 
@@ -286,7 +286,7 @@
  * Iterate through the elements of an array and read the whole thing
  * @return The index of the object, or -1 if we have reached the end of current block
  */
-int SlIterateArray(void)
+int SlIterateArray()
 {
 	int index;
 	static uint32 next_offs;
@@ -382,7 +382,7 @@
 }
 
 /* Get the length of the current object */
-uint SlGetFieldLength(void) {return _sl.obj_len;}
+uint SlGetFieldLength() {return _sl.obj_len;}
 
 /** Return a signed-long version of the value of a setting
  * @param ptr pointer to the variable
@@ -850,7 +850,7 @@
 /* Stub Chunk handlers to only calculate length and do nothing else */
 static ChunkSaveLoadProc *_tmp_proc_1;
 static inline void SlStubSaveProc2(void *arg) {_tmp_proc_1();}
-static void SlStubSaveProc(void) {SlAutolength(SlStubSaveProc2, NULL);}
+static void SlStubSaveProc() {SlAutolength(SlStubSaveProc2, NULL);}
 
 /** Save a chunk of data (eg. vehicles, stations, etc.). Each chunk is
  * prefixed by an ID identifying it, followed by data, and terminator where appropiate
@@ -891,7 +891,7 @@
 }
 
 /** Save all chunks */
-static void SlSaveChunks(void)
+static void SlSaveChunks()
 {
 	const ChunkHandler *ch;
 	const ChunkHandler* const *chsc;
@@ -933,7 +933,7 @@
 }
 
 /** Load all chunks */
-static void SlLoadChunks(void)
+static void SlLoadChunks()
 {
 	uint32 id;
 	const ChunkHandler *ch;
@@ -954,7 +954,7 @@
 
 #include "minilzo.h"
 
-static uint ReadLZO(void)
+static uint ReadLZO()
 {
 	byte out[LZO_SIZE + LZO_SIZE / 64 + 16 + 3 + 8];
 	uint32 tmp[2];
@@ -999,14 +999,14 @@
 	if (fwrite(out, outlen + sizeof(uint32)*2, 1, _sl.fh) != 1) SlError("file write failed");
 }
 
-static bool InitLZO(void)
+static bool InitLZO()
 {
 	_sl.bufsize = LZO_SIZE;
 	_sl.buf = _sl.buf_ori = (byte*)malloc(LZO_SIZE);
 	return true;
 }
 
-static void UninitLZO(void)
+static void UninitLZO()
 {
 	free(_sl.buf_ori);
 }
@@ -1014,7 +1014,7 @@
 /*********************************************
  ******** START OF NOCOMP CODE (uncompressed)*
  *********************************************/
-static uint ReadNoComp(void)
+static uint ReadNoComp()
 {
 	return fread(_sl.buf, 1, LZO_SIZE, _sl.fh);
 }
@@ -1024,14 +1024,14 @@
 	fwrite(_sl.buf, 1, size, _sl.fh);
 }
 
-static bool InitNoComp(void)
+static bool InitNoComp()
 {
 	_sl.bufsize = LZO_SIZE;
 	_sl.buf = _sl.buf_ori =(byte*)malloc(LZO_SIZE);
 	return true;
 }
 
-static void UninitNoComp(void)
+static void UninitNoComp()
 {
 	free(_sl.buf_ori);
 }
@@ -1045,18 +1045,18 @@
 #include "gfx.h"
 #include "gui.h"
 
-typedef struct ThreadedSave {
+struct ThreadedSave {
 	uint count;
 	byte ff_state;
 	bool saveinprogress;
 	CursorID cursor;
-} ThreadedSave;
+};
 
 /* A maximum size of of 128K * 500 = 64.000KB savegames */
 STATIC_OLD_POOL(Savegame, byte, 17, 500, NULL, NULL)
 static ThreadedSave _ts;
 
-static bool InitMem(void)
+static bool InitMem()
 {
 	_ts.count = 0;
 
@@ -1069,7 +1069,7 @@
 	return true;
 }
 
-static void UnInitMem(void)
+static void UnInitMem()
 {
 	CleanPool(&_Savegame_pool);
 }
@@ -1091,7 +1091,7 @@
 
 static z_stream _z;
 
-static bool InitReadZlib(void)
+static bool InitReadZlib()
 {
 	memset(&_z, 0, sizeof(_z));
 	if (inflateInit(&_z) != Z_OK) return false;
@@ -1101,7 +1101,7 @@
 	return true;
 }
 
-static uint ReadZlib(void)
+static uint ReadZlib()
 {
 	int r;
 
@@ -1126,13 +1126,13 @@
 	return 4096 - _z.avail_out;
 }
 
-static void UninitReadZlib(void)
+static void UninitReadZlib()
 {
 	inflateEnd(&_z);
 	free(_sl.buf_ori);
 }
 
-static bool InitWriteZlib(void)
+static bool InitWriteZlib()
 {
 	memset(&_z, 0, sizeof(_z));
 	if (deflateInit(&_z, 6) != Z_OK) return false;
@@ -1168,7 +1168,7 @@
 	WriteZlibLoop(&_z, _sl.buf, len, 0);
 }
 
-static void UninitWriteZlib(void)
+static void UninitWriteZlib()
 {
 	/* flush any pending output. */
 	if (_sl.fh) WriteZlibLoop(&_z, NULL, 0, Z_FINISH);
@@ -1326,18 +1326,18 @@
 }
 
 /** The format for a reader/writer type of a savegame */
-typedef struct {
+struct SaveLoadFormat {
 	const char *name;           ///< name of the compressor/decompressor (debug-only)
 	uint32 tag;                 ///< the 4-letter tag by which it is identified in the savegame
 
-	bool (*init_read)(void);    ///< function executed upon initalization of the loader
+	bool (*init_read)();        ///< function executed upon initalization of the loader
 	ReaderProc *reader;         ///< function that loads the data from the file
-	void (*uninit_read)(void);  ///< function executed when reading is finished
+	void (*uninit_read)();      ///< function executed when reading is finished
 
-	bool (*init_write)(void);   ///< function executed upon intialization of the saver
+	bool (*init_write)();       ///< function executed upon intialization of the saver
 	WriterProc *writer;         ///< function that saves the data to the file
-	void (*uninit_write)(void); ///< function executed when writing is done
-} SaveLoadFormat;
+	void (*uninit_write)();     ///< function executed when writing is done
+};
 
 static const SaveLoadFormat _saveload_formats[] = {
 	{"memory", 0,                NULL,         NULL,       NULL,           InitMem,       WriteMem,    UnInitMem},
@@ -1377,12 +1377,12 @@
 
 /* actual loader/saver function */
 void InitializeGame(int mode, uint size_x, uint size_y);
-extern bool AfterLoadGame(void);
-extern void BeforeSaveGame(void);
+extern bool AfterLoadGame();
+extern void BeforeSaveGame();
 extern bool LoadOldSaveGame(const char *file);
 
 /** Small helper function to close the to be loaded savegame an signal error */
-static inline SaveOrLoadResult AbortSaveLoad(void)
+static inline SaveOrLoadResult AbortSaveLoad()
 {
 	if (_sl.fh != NULL) fclose(_sl.fh);
 
@@ -1393,7 +1393,7 @@
 /** Update the gui accordingly when starting saving
  * and set locks on saveload. Also turn off fast-forward cause with that
  * saving takes Aaaaages */
-void SaveFileStart(void)
+void SaveFileStart()
 {
 	_ts.ff_state = _fast_forward;
 	_fast_forward = 0;
@@ -1405,7 +1405,7 @@
 
 /** Update the gui accordingly when saving is done and release locks
  * on saveload */
-void SaveFileDone(void)
+void SaveFileDone()
 {
 	_fast_forward = _ts.ff_state;
 	if (_cursor.sprite == SPR_CURSOR_ZZZ) SetMouseCursor(SPR_CURSOR_MOUSE, PAL_NONE);
@@ -1415,7 +1415,7 @@
 }
 
 /** Show a gui message when saving has failed */
-void SaveFileError(void)
+void SaveFileError()
 {
 	ShowErrorMessage(STR_4007_GAME_SAVE_FAILED, STR_NULL, 0, 0);
 	SaveFileDone();
@@ -1487,7 +1487,7 @@
 	return NULL;
 }
 
-void WaitTillSaved(void)
+void WaitTillSaved()
 {
 	OTTDJoinThread(save_thread);
 	save_thread = NULL;
@@ -1658,7 +1658,7 @@
 }
 
 /** Do a save when exiting the game (patch option) _patches.autosave_on_exit */
-void DoExitSave(void)
+void DoExitSave()
 {
 	char buf[200];
 	snprintf(buf, sizeof(buf), "%s%sexit.sav", _paths.autosave_dir, PATHSEP);
--- a/src/saveload.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/saveload.h	Mon Mar 19 12:38:16 2007 +0000
@@ -9,41 +9,41 @@
 
 #define SIZE_MAX ((size_t)-1)
 
-typedef enum SaveOrLoadResult {
+enum SaveOrLoadResult {
 	SL_OK     = 0, // completed successfully
 	SL_ERROR  = 1, // error that was caught before internal structures were modified
 	SL_REINIT = 2, // error that was caught in the middle of updating game state, need to clear it. (can only happen during load)
-} SaveOrLoadResult;
+};
 
-typedef enum SaveOrLoadMode {
+enum SaveOrLoadMode {
 	SL_INVALID  = -1,
 	SL_LOAD     =  0,
 	SL_SAVE     =  1,
 	SL_OLD_LOAD =  2,
 	SL_PNG      =  3,
 	SL_BMP      =  4,
-} SaveOrLoadMode;
+};
 
 SaveOrLoadResult SaveOrLoad(const char *filename, int mode);
-void WaitTillSaved(void);
-void DoExitSave(void);
+void WaitTillSaved();
+void DoExitSave();
 
 
-typedef void ChunkSaveLoadProc(void);
+typedef void ChunkSaveLoadProc();
 typedef void AutolengthProc(void *arg);
 
-typedef struct {
+struct ChunkHandler {
 	uint32 id;
 	ChunkSaveLoadProc *save_proc;
 	ChunkSaveLoadProc *load_proc;
 	uint32 flags;
-} ChunkHandler;
+};
 
-typedef struct {
+struct NullStruct {
 	byte null;
-} NullStruct;
+};
 
-typedef enum SLRefType {
+enum SLRefType {
 	REF_ORDER         = 0,
 	REF_VEHICLE       = 1,
 	REF_STATION       = 2,
@@ -51,7 +51,7 @@
 	REF_VEHICLE_OLD   = 4,
 	REF_ROADSTOPS     = 5,
 	REF_ENGINE_RENEWS = 6,
-} SLRefType;
+};
 
 #define SL_MAX_VERSION 255
 
@@ -166,7 +166,7 @@
 typedef byte SaveLoadType;
 
 /** SaveLoad type struct. Do NOT use this directly but use the SLE_ macros defined just below! */
-typedef struct SaveLoad {
+struct SaveLoad {
 	SaveLoadType cmd;    ///< the action to take with the saved/loaded type, All types need different action
 	VarType conv;        ///< type of the variable to be saved, int
 	uint16 length;       ///< (conditional) length of the variable (eg. arrays) (max array size is 65536 elements)
@@ -177,7 +177,7 @@
 	 * during runtime. Decision on which one to use is controlled by the function
 	 * that is called to save it. address: SlGlobList, offset: SlObject */
 	void *address;       ///< address of variable OR offset of variable in the struct (max offset is 65536)
-} SaveLoad;
+};
 
 /* Same as SaveLoad but global variables are used (for better readability); */
 typedef SaveLoad SaveLoadGlobVarList;
@@ -290,14 +290,14 @@
 void WriteValue(void *ptr, VarType conv, int64 val);
 
 void SlSetArrayIndex(uint index);
-int SlIterateArray(void);
+int SlIterateArray();
 
 void SlAutolength(AutolengthProc *proc, void *arg);
-uint SlGetFieldLength(void);
+uint SlGetFieldLength();
 void SlSetLength(size_t length);
 size_t SlCalcObjMemberLength(const void *object, const SaveLoad *sld);
 
-byte SlReadByte(void);
+byte SlReadByte();
 void SlWriteByte(byte b);
 
 void SlGlobList(const SaveLoadGlobVarList *sldg);
@@ -305,7 +305,7 @@
 void SlObject(void *object, const SaveLoad *sld);
 bool SlObjectMember(void *object, const SaveLoad *sld);
 
-void SaveFileStart(void);
-void SaveFileDone(void);
-void SaveFileError(void);
+void SaveFileStart();
+void SaveFileDone();
+void SaveFileError();
 #endif /* SAVELOAD_H */
--- a/src/screenshot.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/screenshot.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -24,11 +24,11 @@
 typedef void ScreenshotCallback(void *userdata, Pixel *buf, uint y, uint pitch, uint n);
 typedef bool ScreenshotHandlerProc(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette);
 
-typedef struct {
+struct ScreenshotFormat {
 	const char *name;
 	const char *extension;
 	ScreenshotHandlerProc *proc;
-} ScreenshotFormat;
+};
 
 //************************************************
 //*** SCREENSHOT CODE FOR WINDOWS BITMAP (.BMP)
@@ -37,29 +37,29 @@
 #pragma pack(push, 1)
 #endif
 
-typedef struct BitmapFileHeader {
+struct BitmapFileHeader {
 	uint16 type;
 	uint32 size;
 	uint32 reserved;
 	uint32 off_bits;
-} GCC_PACK BitmapFileHeader;
+} GCC_PACK;
 assert_compile(sizeof(BitmapFileHeader) == 14);
 
 #if defined(_MSC_VER) || defined(__WATCOMC__)
 #pragma pack(pop)
 #endif
 
-typedef struct BitmapInfoHeader {
+struct BitmapInfoHeader {
 	uint32 size;
 	int32 width, height;
 	uint16 planes, bitcount;
 	uint32 compression, sizeimage, xpels, ypels, clrused, clrimp;
-} BitmapInfoHeader;
+};
 assert_compile(sizeof(BitmapInfoHeader) == 40);
 
-typedef struct RgbQuad {
+struct RgbQuad {
 	byte blue, green, red, reserved;
-} RgbQuad;
+};
 assert_compile(sizeof(RgbQuad) == 4);
 
 // generic .BMP writer
@@ -260,7 +260,7 @@
 //*** SCREENSHOT CODE FOR ZSOFT PAINTBRUSH (.PCX)
 //************************************************
 
-typedef struct {
+struct PcxHeader {
 	byte manufacturer;
 	byte version;
 	byte rle;
@@ -276,7 +276,7 @@
 	uint16 width;
 	uint16 height;
 	byte filler[54];
-} PcxHeader;
+};
 assert_compile(sizeof(PcxHeader) == 128);
 
 static bool MakePCXImage(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette)
@@ -421,7 +421,7 @@
 	{"PCX", "pcx", &MakePCXImage},
 };
 
-void InitializeScreenshotFormats(void)
+void InitializeScreenshotFormats()
 {
 	int i, j;
 	for (i = 0, j = 0; i != lengthof(_screenshot_formats); i++)
@@ -524,18 +524,18 @@
 	current_screenshot_type = t;
 }
 
-bool IsScreenshotRequested(void)
+bool IsScreenshotRequested()
 {
 	return (current_screenshot_type != SC_NONE);
 }
 
-static bool MakeSmallScreenshot(void)
+static bool MakeSmallScreenshot()
 {
 	const ScreenshotFormat *sf = _screenshot_formats + _cur_screenshot_format;
 	return sf->proc(MakeScreenshotName(sf->extension), CurrentScreenCallback, NULL, _screen.width, _screen.height, 8, _cur_palette);
 }
 
-static bool MakeWorldScreenshot(void)
+static bool MakeWorldScreenshot()
 {
 	ViewPort vp;
 	const ScreenshotFormat *sf;
@@ -554,7 +554,7 @@
 	return sf->proc(MakeScreenshotName(sf->extension), LargeWorldCallback, &vp, vp.width, vp.height, 8, _cur_palette);
 }
 
-bool MakeScreenshot(void)
+bool MakeScreenshot()
 {
 	switch (current_screenshot_type) {
 		case SC_VIEWPORT:
--- a/src/screenshot.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/screenshot.h	Mon Mar 19 12:38:16 2007 +0000
@@ -3,20 +3,20 @@
 #ifndef SCREENSHOT_H
 #define SCREENSHOT_H
 
-void InitializeScreenshotFormats(void);
+void InitializeScreenshotFormats();
 
 const char *GetScreenshotFormatDesc(int i);
 void SetScreenshotFormat(int i);
 
-typedef enum ScreenshotType {
+enum ScreenshotType {
 	SC_NONE,
 	SC_VIEWPORT,
 	SC_WORLD
-} ScreenshotType;
+};
 
-bool MakeScreenshot(void);
+bool MakeScreenshot();
 void SetScreenshotType(ScreenshotType t);
-bool IsScreenshotRequested(void);
+bool IsScreenshotRequested();
 
 extern char _screenshot_format_name[8];
 extern uint _num_screenshot_formats;
--- a/src/sdl.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/sdl.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -65,7 +65,7 @@
 
 SDLProcs sdl_proc;
 
-static const char *LoadSdlDLL(void)
+static const char *LoadSdlDLL()
 {
 	if (sdl_proc.SDL_Init != NULL)
 		return NULL;
--- a/src/sdl.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/sdl.h	Mon Mar 19 12:38:16 2007 +0000
@@ -13,10 +13,10 @@
 #ifdef DYNAMICALLY_LOADED_SDL
 	#include <SDL.h>
 
-	typedef struct SDLProcs {
+	struct SDLProcs {
 		int (SDLCALL *SDL_Init)(Uint32);
 		int (SDLCALL *SDL_InitSubSystem)(Uint32);
-		char *(SDLCALL *SDL_GetError)(void);
+		char *(SDLCALL *SDL_GetError)();
 		void (SDLCALL *SDL_QuitSubSystem)(Uint32);
 		void (SDLCALL *SDL_UpdateRect)(SDL_Surface *, Sint32, Sint32, Uint32, Uint32);
 		void (SDLCALL *SDL_UpdateRects)(SDL_Surface *, int, SDL_Rect *);
@@ -26,15 +26,15 @@
 		void (SDLCALL *SDL_FreeSurface)(SDL_Surface *);
 		int (SDLCALL *SDL_PollEvent)(SDL_Event *);
 		void (SDLCALL *SDL_WarpMouse)(Uint16, Uint16);
-		uint32 (SDLCALL *SDL_GetTicks)(void);
+		uint32 (SDLCALL *SDL_GetTicks)();
 		int (SDLCALL *SDL_OpenAudio)(SDL_AudioSpec *, SDL_AudioSpec*);
 		void (SDLCALL *SDL_PauseAudio)(int);
-		void (SDLCALL *SDL_CloseAudio)(void);
+		void (SDLCALL *SDL_CloseAudio)();
 		int (SDLCALL *SDL_LockSurface)(SDL_Surface*);
 		void (SDLCALL *SDL_UnlockSurface)(SDL_Surface*);
-		SDLMod (SDLCALL *SDL_GetModState)(void);
+		SDLMod (SDLCALL *SDL_GetModState)();
 		void (SDLCALL *SDL_Delay)(Uint32);
-		void (SDLCALL *SDL_Quit)(void);
+		void (SDLCALL *SDL_Quit)();
 		SDL_Surface *(SDLCALL *SDL_SetVideoMode)(int, int, int, Uint32);
 		int (SDLCALL *SDL_EnableKeyRepeat)(int, int);
 		void (SDLCALL *SDL_EnableUNICODE)(int);
@@ -46,7 +46,7 @@
 		int (SDLCALL *SDL_SetColorKey)(SDL_Surface *, Uint32, Uint32);
 		void (SDLCALL *SDL_WM_SetIcon)(SDL_Surface *, Uint8 *);
 		Uint32 (SDLCALL *SDL_MapRGB)(SDL_PixelFormat *, Uint8, Uint8, Uint8);
-	} SDLProcs;
+	};
 
 	extern SDLProcs sdl_proc;
 
--- a/src/settings.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/settings.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -41,6 +41,7 @@
 #include "date.h"
 #include "rail.h"
 #include "helpers.hpp"
+#include "news.h"
 #ifdef WITH_FREETYPE
 #include "gfx.h"
 #include "fontcache.h"
@@ -49,10 +50,10 @@
 /** The patch values that are used for new games and/or modified in config file */
 Patches _patches_newgame;
 
-typedef struct IniFile IniFile;
-typedef struct IniItem IniItem;
-typedef struct IniGroup IniGroup;
-typedef struct SettingsMemoryPool SettingsMemoryPool;
+struct IniFile;
+struct IniItem;
+struct IniGroup;
+struct SettingsMemoryPool;
 
 typedef const char *SettingListCallbackProc(const IniItem *item, uint index);
 typedef void SettingDescProc(IniFile *ini, const SettingDesc *desc, const char *grpname, void *object);
@@ -153,7 +154,7 @@
 };
 
 // allocate an inifile object
-static IniFile *ini_alloc(void)
+static IniFile *ini_alloc()
 {
 	IniFile *ini;
 	SettingsMemoryPool *pool;
@@ -1183,7 +1184,6 @@
 
 static const SettingDescGlobVarList _misc_settings[] = {
 	SDTG_MMANY("display_opt",     SLE_UINT8, S, 0, _display_opt,       (DO_SHOW_TOWN_NAMES|DO_SHOW_STATION_NAMES|DO_SHOW_SIGNS|DO_FULL_ANIMATION|DO_FULL_DETAIL|DO_TRANS_BUILDINGS|DO_WAYPOINTS), "SHOW_TOWN_NAMES|SHOW_STATION_NAMES|SHOW_SIGNS|FULL_ANIMATION|TRANS_BUILDINGS|FULL_DETAIL|WAYPOINTS", STR_NULL, NULL),
-	  SDTG_VAR("news_display_opt", SLE_UINT, S, 0, _news_display_opt,0xAAAAAAAA,0,0xAAAAAAAA,0,STR_NULL, NULL), // default to all full messages: 10101010101010101010 = 0xAAAAAAAA
 	 SDTG_BOOL("news_ticker_sound",          S, 0, _news_ticker_sound,     true,    STR_NULL, NULL),
 	 SDTG_BOOL("fullscreen",                 S, 0, _fullscreen,           false,    STR_NULL, NULL),
 	  SDTG_STR("videodriver",      SLE_STRB,C|S,0, _ini_videodriver,       NULL,    STR_NULL, NULL),
@@ -1283,6 +1283,8 @@
 	SDT_BOOL(Patches, link_terraform_toolbar,        S, 0, false,        STR_CONFIG_PATCHES_LINK_TERRAFORM_TOOLBAR,NULL),
 	 SDT_VAR(Patches, liveries,           SLE_UINT8, S,MS,  2, 0,  2, 0, STR_CONFIG_PATCHES_LIVERIES,              RedrawScreen),
 	SDT_BOOL(Patches, prefer_teamchat,               S, 0, false,        STR_CONFIG_PATCHES_PREFER_TEAMCHAT,       NULL),
+	SDT_VAR(Patches, scrollwheel_scrolling,SLE_UINT8,S,MS, 0,  0,  2, 0, STR_CONFIG_PATCHES_SCROLLWHEEL_SCROLLING, NULL),
+	SDT_VAR(Patches,scrollwheel_multiplier,SLE_UINT8,S, 0, 5,  1, 15, 1, STR_CONFIG_PATCHES_SCROLLWHEEL_MULTIPLIER,NULL),
 
 	/***************************************************************************/
 	/* Construction section of the GUI-configure patches window */
@@ -1502,6 +1504,43 @@
 #undef NO
 #undef CR
 
+static uint NewsDisplayLoadConfig(IniFile *ini, const char *grpname)
+{
+	IniGroup *group = ini_getgroup(ini, grpname, -1);
+	IniItem *item;
+	/* By default, set everything to full (0xAAAAAAAA = 1010101010101010) */
+	uint res = 0xAAAAAAAA;
+
+	/* If no group exists, return everything full */
+	if (group == NULL) return res;
+
+	for (item = group->item; item != NULL; item = item->next) {
+		int news_item = -1;
+		for (int i = 0; i < NT_END; i++) {
+			if (strcasecmp(item->name, _news_display_name[i]) == 0) {
+				news_item = i;
+				break;
+			}
+		}
+		if (news_item == -1) {
+			DEBUG(misc, 0, "Invalid display option: %s", item->name);
+			continue;
+		}
+
+		if (strcasecmp(item->value, "full") == 0) {
+			SB(res, news_item * 2, 2, 2);
+		} else if (strcasecmp(item->value, "off") == 0) {
+			SB(res, news_item * 2, 2, 0);
+		} else if (strcasecmp(item->value, "summarized") == 0) {
+			SB(res, news_item * 2, 2, 1);
+		} else {
+			DEBUG(misc, 0, "Invalid display value: %s", item->value);
+			continue;
+		}
+	}
+
+	return res;
+}
 
 /* Load a GRF configuration from the given group name */
 static GRFConfig *GRFLoadConfig(IniFile *ini, const char *grpname, bool is_static)
@@ -1530,7 +1569,7 @@
 		if (!FillGRFDetails(c, is_static)) {
 			const char *msg;
 
-			if (HASBIT(c->flags, GCF_NOT_FOUND)) {
+			if (c->status == GCS_NOT_FOUND) {
 				msg = "not found";
 			} else if (HASBIT(c->flags, GCF_UNSAFE)) {
 				msg = "unsafe for static use";
@@ -1556,6 +1595,26 @@
 	return first;
 }
 
+static void NewsDisplaySaveConfig(IniFile *ini, const char *grpname, uint news_display)
+{
+	IniGroup *group = ini_getgroup(ini, grpname, -1);
+	IniItem **item;
+
+	if (group == NULL) return;
+	group->item = NULL;
+	item = &group->item;
+
+	for (int i = 0; i < NT_END; i++) {
+		const char *value;
+		int v = GB(news_display, i * 2, 2);
+
+		value = (v == 0 ? "off" : (v == 1 ? "summarized" : "full"));
+
+		*item = ini_item_alloc(group, _news_display_name[i], strlen(_news_display_name[i]));
+		(*item)->value = (char*)pool_strdup(&ini->pool, value, strlen(value));
+		item = &(*item)->next;
+	}
+}
 
 /* Save a GRF configuration to the given group name */
 static void GRFSaveConfig(IniFile *ini, const char *grpname, const GRFConfig *list)
@@ -1599,22 +1658,24 @@
 }
 
 /** Load the values from the configuration files */
-void LoadFromConfig(void)
+void LoadFromConfig()
 {
 	IniFile *ini = ini_load(_config_file);
 	HandleSettingDescs(ini, ini_load_settings, ini_load_setting_list);
 	_grfconfig_newgame = GRFLoadConfig(ini, "newgrf", false);
 	_grfconfig_static  = GRFLoadConfig(ini, "newgrf-static", true);
+	_news_display_opt  = NewsDisplayLoadConfig(ini, "news_display");
 	ini_free(ini);
 }
 
 /** Save the values to the configuration file */
-void SaveToConfig(void)
+void SaveToConfig()
 {
 	IniFile *ini = ini_load(_config_file);
 	HandleSettingDescs(ini, ini_save_settings, ini_save_setting_list);
 	GRFSaveConfig(ini, "newgrf", _grfconfig_newgame);
 	GRFSaveConfig(ini, "newgrf-static", _grfconfig_static);
+	NewsDisplaySaveConfig(ini, "news_display", _news_display_opt);
 	ini_save(_config_file, ini);
 	ini_free(ini);
 }
@@ -1794,7 +1855,7 @@
 	SaveSettings((const SettingDesc*)sdg, NULL);
 }
 
-static void Load_OPTS(void)
+static void Load_OPTS()
 {
 	/* Copy over default setting since some might not get loaded in
 	 * a networking environment. This ensures for example that the local
@@ -1803,12 +1864,12 @@
 	LoadSettings(_gameopt_settings, &_opt);
 }
 
-static void Save_OPTS(void)
+static void Save_OPTS()
 {
 	SaveSettings(_gameopt_settings, &_opt);
 }
 
-static void Load_PATS(void)
+static void Load_PATS()
 {
 	/* Copy over default setting since some might not get loaded in
 	 * a networking environment. This ensures for example that the local
@@ -1817,23 +1878,13 @@
 	LoadSettings(_patch_settings, &_patches);
 }
 
-static void Save_PATS(void)
+static void Save_PATS()
 {
 	SaveSettings(_patch_settings, &_patches);
 }
 
-void CheckConfig(void)
+void CheckConfig()
 {
-	// fix up news_display_opt from old to new
-	int i;
-	uint32 tmp;
-	for (i = 0, tmp = _news_display_opt; i != 10; i++, tmp >>= 2) {
-		if ((tmp & 0x3) == 0x3) { // old settings
-			_news_display_opt = 0xAAAAAAAA; // set all news-messages to full 1010101010...
-			break;
-		}
-	}
-
 	// Increase old default values for pf_maxdepth and pf_maxlength
 	// to support big networks.
 	if (_patches_newgame.pf_maxdepth == 16 && _patches_newgame.pf_maxlength == 512) {
@@ -1842,7 +1893,7 @@
 	}
 }
 
-void UpdatePatches(void)
+void UpdatePatches()
 {
 	/* Since old(er) savegames don't have any patches saved, we initialise
 	 * them with the default values just as it was in the old days.
--- a/src/settings.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/settings.h	Mon Mar 19 12:38:16 2007 +0000
@@ -46,7 +46,7 @@
 
 typedef int32 OnChange(int32 var);
 
-typedef struct SettingDescBase {
+struct SettingDescBase {
 	const char *name;       ///< name of the setting. Used in configuration file and for console
 	const void *def;        ///< default value given when none is present
 	SettingDescType cmd;    ///< various flags for the variable
@@ -56,12 +56,12 @@
 	const char *many;       ///< ONE/MANY_OF_MANY: string of possible values for this type
 	StringID str;           ///< (translated) string with descriptive text; gui and console
 	OnChange *proc;         ///< callback procedure for when the value is changed
-} SettingDescBase;
+};
 
-typedef struct SettingDesc {
+struct SettingDesc {
 	SettingDescBase desc;   ///< Settings structure (going to configuration file)
 	SaveLoad save;          ///< Internal structure (going to savegame, parts to config)
-} SettingDesc;
+};
 
 /* NOTE: The only difference between SettingDesc and SettingDescGlob is
  * that one uses global variables as a source and the other offsets
@@ -72,10 +72,10 @@
  * offset in a certain struct */
 typedef SettingDesc SettingDescGlobVarList;
 
-typedef enum {
+enum IniGroupType {
 	IGT_VARIABLES = 0, ///< values of the form "landscape = hilly"
 	IGT_LIST      = 1, ///< a list of values, seperated by \n and terminated by the next group block
-} IniGroupType;
+};
 
 /** The patch values that are used for new games and/or modified in config file */
 extern Patches _patches_newgame;
--- a/src/settings_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/settings_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -64,7 +64,7 @@
 	return buf;
 }
 
-static int GetCurRes(void)
+static int GetCurRes()
 {
 	int i;
 
@@ -77,18 +77,18 @@
 	return i;
 }
 
-static inline bool RoadVehiclesAreBuilt(void)
+static inline bool RoadVehiclesAreBuilt()
 {
 	const Vehicle* v;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Road) return true;
+		if (v->type == VEH_ROAD) return true;
 	}
 	return false;
 }
 
 
-static void ShowCustCurrency(void);
+static void ShowCustCurrency();
 
 static void GameOptionsWndProc(Window *w, WindowEvent *e)
 {
@@ -289,18 +289,18 @@
 };
 
 
-void ShowGameOptions(void)
+void ShowGameOptions()
 {
 	DeleteWindowById(WC_GAME_OPTIONS, 0);
 	AllocateWindowDesc(&_game_options_desc);
 }
 
-typedef struct {
+struct GameSettingData {
 	int16 min;
 	int16 max;
 	int16 step;
 	StringID str;
-} GameSettingData;
+};
 
 static const GameSettingData _game_setting_info[] = {
 	{  0,   7,  1, STR_NULL},
@@ -371,7 +371,7 @@
 	}
 }
 
-extern void StartupEconomy(void);
+extern void StartupEconomy();
 
 enum {
 	GAMEDIFF_WND_TOP_OFFSET = 45,
@@ -394,6 +394,7 @@
 		SetWindowWidgetDisabledState(w,  6, _game_mode == GM_NORMAL);
 		SetWindowWidgetDisabledState(w,  7, _game_mode == GM_EDITOR || _networking); // highscore chart in multiplayer
 		SetWindowWidgetDisabledState(w, 10, _networking && !_network_server); // Save-button in multiplayer (and if client)
+		LowerWindowWidget(w, _opt_mod_temp.diff_level + 3);
 
 		break;
 	case WE_PAINT: {
@@ -553,7 +554,7 @@
 	GameDifficultyWndProc
 };
 
-void ShowGameDifficulty(void)
+void ShowGameDifficulty()
 {
 	DeleteWindowById(WC_GAME_OPTIONS, 0);
 	/* Copy current settings (ingame or in intro) to temporary holding place
@@ -577,6 +578,11 @@
 	"link_terraform_toolbar",
 	"liveries",
 	"prefer_teamchat",
+	/* While the horizontal scrollwheel scrolling is written as general code, only
+	 *  the cocoa (OSX) driver generates input for it.
+	 *  Since it's also able to completely disable the scrollwheel will we display it on all platforms anyway */
+	"scrollwheel_scrolling",
+	"scrollwheel_multiplier",
 };
 
 static const char *_patches_construction[] = {
@@ -657,16 +663,16 @@
 	"freight_trains",
 };
 
-typedef struct PatchEntry {
+struct PatchEntry {
 	const SettingDesc *setting;
 	uint index;
-} PatchEntry;
+};
 
-typedef struct PatchPage {
+struct PatchPage {
 	const char **names;
 	PatchEntry *entries;
 	byte num;
-} PatchPage;
+};
 
 /* PatchPage holds the categories, the number of elements in each category
  * and (in NULL) a dynamic array of settings based on the string-representations
@@ -829,8 +835,8 @@
 						if (value < sdb->min) value = (sdb->flags & SGF_0ISDISABLED) ? 0 : sdb->min;
 					}
 
-					/* Set up scroller timeout */
-					if (value != oldvalue) {
+					/* Set up scroller timeout for numeric values */
+					if (value != oldvalue && !(sd->desc.flags & SGF_MULTISTRING)) {
 						WP(w,def_d).data_2 = btn * 2 + 1 + ((x >= 10) ? 1 : 0);
 						w->flags4 |= 5 << WF_TIMEOUT_SHL;
 						_left_button_clicked = false;
@@ -916,7 +922,7 @@
 	PatchesSelectionWndProc,
 };
 
-void ShowPatchesSelection(void)
+void ShowPatchesSelection()
 {
 	DeleteWindowById(WC_GAME_OPTIONS, 0);
 	AllocateWindowDesc(&_patches_selection_desc);
@@ -1136,7 +1142,7 @@
 	CustCurrencyWndProc,
 };
 
-static void ShowCustCurrency(void)
+static void ShowCustCurrency()
 {
 	_str_separator[0] = _custom_currency.separator;
 	_str_separator[1] = '\0';
--- a/src/ship.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/ship.h	Mon Mar 19 12:38:16 2007 +0000
@@ -12,7 +12,7 @@
 
 static inline bool IsShipInDepot(const Vehicle* v)
 {
-	assert(v->type == VEH_Ship);
+	assert(v->type == VEH_SHIP);
 	return v->u.ship.state == 0x80;
 }
 
--- a/src/ship_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/ship_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -264,8 +264,7 @@
 	order = GetVehicleOrder(v, v->cur_order_index);
 
 	if (order == NULL) {
-		v->current_order.type  = OT_NOTHING;
-		v->current_order.flags = 0;
+		v->current_order.Free();
 		v->dest_tile = 0;
 		return;
 	}
@@ -447,12 +446,12 @@
 	}
 }
 
-typedef struct {
+struct PathFindShip {
 	TileIndex skiptile;
 	TileIndex dest_coords;
 	uint best_bird_dist;
 	uint best_length;
-} PathFindShip;
+};
 
 static bool ShipTrackFollower(TileIndex tile, PathFindShip *pfs, int track, uint length, byte *state)
 {
@@ -705,8 +704,7 @@
 			/* A leave station order only needs one tick to get processed, so we can
 			 * always skip ahead. */
 			if (v->current_order.type == OT_LEAVESTATION) {
-				v->current_order.type = OT_NOTHING;
-				v->current_order.flags = 0;
+				v->current_order.Free();
 				InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
 			} else if (v->dest_tile != 0) {
 				/* We have a target, let's see if we reached it... */
@@ -821,12 +819,12 @@
 }
 
 
-void ShipsYearlyLoop(void)
+void ShipsYearlyLoop()
 {
 	Vehicle *v;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Ship) {
+		if (v->type == VEH_SHIP) {
 			v->profit_last_year = v->profit_this_year;
 			v->profit_this_year = 0;
 			InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
@@ -846,7 +844,7 @@
 	UnitID unit_num;
 	Engine *e;
 
-	if (!IsEngineBuildable(p1, VEH_Ship, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
+	if (!IsEngineBuildable(p1, VEH_SHIP, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
 
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
@@ -859,7 +857,7 @@
 	if (!IsTileOwner(tile, _current_player)) return CMD_ERROR;
 
 	v = AllocateVehicle();
-	unit_num = HASBIT(p2, 0) ? 0 : GetFreeUnitNumber(VEH_Ship);
+	unit_num = HASBIT(p2, 0) ? 0 : GetFreeUnitNumber(VEH_SHIP);
 
 	if (v == NULL || unit_num > _patches.max_ships)
 		return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
@@ -910,7 +908,7 @@
 		v->date_of_last_service = _date;
 		v->build_year = _cur_year;
 		v->cur_image = 0x0E5E;
-		v->type = VEH_Ship;
+		v->type = VEH_SHIP;
 		v->random_bits = VehicleRandomBits();
 
 		v->vehicle_flags = 0;
@@ -922,7 +920,7 @@
 		RebuildVehicleLists();
 		InvalidateWindow(WC_COMPANY, v->owner);
 		if (IsLocalPlayer())
-			InvalidateAutoreplaceWindow(VEH_Ship); // updates the replace Ship window
+			InvalidateAutoreplaceWindow(VEH_SHIP); // updates the replace Ship window
 
 		GetPlayer(_current_player)->num_engines[p1]++;
 	}
@@ -943,7 +941,7 @@
 
 	v = GetVehicle(p1);
 
-	if (v->type != VEH_Ship || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_SHIP || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
@@ -977,7 +975,7 @@
 
 	v = GetVehicle(p1);
 
-	if (v->type != VEH_Ship || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_SHIP || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	/* Check if this ship can be started/stopped. The callback will fail or
 	 * return 0xFF if it can. */
@@ -1016,14 +1014,14 @@
 	if (p2 & DEPOT_MASS_SEND) {
 		/* Mass goto depot requested */
 		if (!ValidVLWFlags(p2 & VLW_MASK)) return CMD_ERROR;
-		return SendAllVehiclesToDepot(VEH_Ship, flags, p2 & DEPOT_SERVICE, _current_player, (p2 & VLW_MASK), p1);
+		return SendAllVehiclesToDepot(VEH_SHIP, flags, p2 & DEPOT_SERVICE, _current_player, (p2 & VLW_MASK), p1);
 	}
 
 	if (!IsValidVehicleID(p1)) return CMD_ERROR;
 
 	v = GetVehicle(p1);
 
-	if (v->type != VEH_Ship || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_SHIP || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	if (v->vehstatus & VS_CRASHED) return CMD_ERROR;
 
@@ -1092,7 +1090,7 @@
 
 	v = GetVehicle(p1);
 
-	if (v->type != VEH_Ship || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_SHIP || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	if (!IsShipInDepotStopped(v)) {
 		return_cmd_error(STR_980B_SHIP_MUST_BE_STOPPED_IN);
@@ -1100,7 +1098,7 @@
 
 	/* Check cargo */
 	if (!ShipVehInfo(v->engine_type)->refittable) return CMD_ERROR;
-	if (new_cid > NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
+	if (new_cid >= NUM_CARGO || !CanRefitTo(v->engine_type, new_cid)) return CMD_ERROR;
 
 	SET_EXPENSES_TYPE(EXPENSES_SHIP_RUN);
 
--- a/src/signs.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/signs.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -44,7 +44,7 @@
  * Update the coordinates of all signs
  *
  */
-void UpdateAllSignVirtCoords(void)
+void UpdateAllSignVirtCoords()
 {
 	Sign *si;
 
@@ -73,7 +73,7 @@
  *
  * @return The pointer to the new sign, or NULL if there is no more free space
  */
-static Sign *AllocateSign(void)
+static Sign *AllocateSign()
 {
 	Sign *si;
 
@@ -219,7 +219,7 @@
  * Initialize the signs
  *
  */
-void InitializeSigns(void)
+void InitializeSigns()
 {
 	CleanPool(&_Sign_pool);
 	AddBlockToPool(&_Sign_pool);
@@ -241,7 +241,7 @@
  * Save all signs
  *
  */
-static void Save_SIGN(void)
+static void Save_SIGN()
 {
 	Sign *si;
 
@@ -256,7 +256,7 @@
  * Load all signs
  *
  */
-static void Load_SIGN(void)
+static void Load_SIGN()
 {
 	int index;
 	while ((index = SlIterateArray()) != -1) {
--- a/src/signs.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/signs.h	Mon Mar 19 12:38:16 2007 +0000
@@ -5,7 +5,7 @@
 
 #include "oldpool.h"
 
-typedef struct Sign {
+struct Sign {
 	StringID     str;
 	ViewportSign sign;
 	int32        x;
@@ -14,11 +14,11 @@
 	PlayerByte   owner; // placed by this player. Anyone can delete them though. OWNER_NONE for gray signs from old games.
 
 	SignID       index;
-} Sign;
+};
 
 DECLARE_OLD_POOL(Sign, Sign, 2, 16000)
 
-static inline SignID GetMaxSignIndex(void)
+static inline SignID GetMaxSignIndex()
 {
 	/* TODO - This isn't the real content of the function, but
 	 *  with the new pool-system this will be replaced with one that
@@ -28,7 +28,7 @@
 	return GetSignPoolSize() - 1;
 }
 
-static inline uint GetNumSigns(void)
+static inline uint GetNumSigns()
 {
 	return GetSignPoolSize();
 }
@@ -59,12 +59,12 @@
 
 VARDEF bool _sign_sort_dirty;
 
-void UpdateAllSignVirtCoords(void);
+void UpdateAllSignVirtCoords();
 void PlaceProc_Sign(TileIndex tile);
 
 /* misc.c */
 void ShowRenameSignWindow(const Sign *si);
 
-void ShowSignList(void);
+void ShowSignList();
 
 #endif /* SIGNS_H */
--- a/src/signs_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/signs_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -37,7 +37,7 @@
 	return strcmp(buf1, _bufcache); // sort by name
 }
 
-static void GlobalSortSignList(void)
+static void GlobalSortSignList()
 {
 	const Sign *si;
 	uint n = 0;
@@ -137,7 +137,7 @@
 };
 
 
-void ShowSignList(void)
+void ShowSignList()
 {
 	Window *w;
 
--- a/src/slope.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/slope.h	Mon Mar 19 12:38:16 2007 +0000
@@ -3,7 +3,7 @@
 #ifndef SLOPE_H
 #define SLOPE_H
 
-typedef enum Slope {
+enum Slope {
 	SLOPE_FLAT     = 0x00,
 	SLOPE_W        = 0x01,
 	SLOPE_S        = 0x02,
@@ -25,7 +25,7 @@
 	SLOPE_STEEP_S  = SLOPE_STEEP | SLOPE_WSE,
 	SLOPE_STEEP_E  = SLOPE_STEEP | SLOPE_SEN,
 	SLOPE_STEEP_N  = SLOPE_STEEP | SLOPE_ENW
-} Slope;
+};
 
 static inline bool IsSteepSlope(Slope s)
 {
--- a/src/smallmap_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/smallmap_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -256,10 +256,10 @@
 	MKCOLOR(0x27272727),
 };
 
-typedef struct AndOr {
+struct AndOr {
 	uint32 mor;
 	uint32 mand;
-} AndOr;
+};
 
 static inline uint32 ApplyMask(uint32 colour, const AndOr *mask)
 {
@@ -691,7 +691,7 @@
 		byte color;
 
 		FOR_ALL_VEHICLES(v) {
-			if (v->type != VEH_Special &&
+			if (v->type != VEH_SPECIAL &&
 					(v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) == 0) {
 				// Remap into flat coordinates.
 				Point pt = RemapCoords(
@@ -976,7 +976,7 @@
 	SmallMapWindowProc
 };
 
-void ShowSmallMap(void)
+void ShowSmallMap()
 {
 	Window *w;
 
@@ -1089,7 +1089,7 @@
 	ExtraViewPortWndProc
 };
 
-void ShowExtraViewPortWindow(void)
+void ShowExtraViewPortWindow()
 {
 	Window *w, *v;
 	int i = 0;
--- a/src/sound.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/sound.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -93,7 +93,7 @@
 	}
 }
 
-uint GetNumOriginalSounds(void)
+uint GetNumOriginalSounds()
 {
 	return _file_count;
 }
@@ -177,7 +177,7 @@
 	72,
 };
 
-void SndCopyToPool(void)
+void SndCopyToPool()
 {
 	uint i;
 
--- a/src/sound.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/sound.h	Mon Mar 19 12:38:16 2007 +0000
@@ -5,7 +5,7 @@
 
 #include "helpers.hpp"
 
-typedef struct MusicFileSettings {
+struct MusicFileSettings {
 	byte playlist;
 	byte music_vol;
 	byte effect_vol;
@@ -14,11 +14,11 @@
 	bool playing;
 	bool shuffle;
 	char extmidi[80];
-} MusicFileSettings;
+};
 
 VARDEF MusicFileSettings msf;
 
-typedef struct FileEntry {
+struct FileEntry {
 	uint32 file_offset;
 	uint32 file_size;
 	uint16 rate;
@@ -26,12 +26,12 @@
 	uint8 channels;
 	uint8 volume;
 	uint8 priority;
-} FileEntry;
+};
 
 bool SoundInitialize(const char *filename);
-uint GetNumOriginalSounds(void);
+uint GetNumOriginalSounds();
 
-typedef enum SoundFx {
+enum SoundFx {
 	SND_BEGIN = 0,
 	SND_02_SPLAT = 0,                          //  0 == 0x00 !
 	SND_03_FACTORY_WHISTLE,
@@ -107,7 +107,7 @@
 	SND_47_MAGLEV_2,
 	SND_48_DISTANT_BIRD,                    // 72 == 0x48
 	SND_END
-} SoundFx;
+};
 
 /** Define basic enum properties */
 template <> struct EnumPropsT<SoundFx> : MakeEnumPropsT<SoundFx, byte, SND_BEGIN, SND_END, SND_END> {};
@@ -116,6 +116,6 @@
 void SndPlayTileFx(SoundFx sound, TileIndex tile);
 void SndPlayVehicleFx(SoundFx sound, const Vehicle *v);
 void SndPlayFx(SoundFx sound);
-void SndCopyToPool(void);
+void SndCopyToPool();
 
 #endif /* SOUND_H */
--- a/src/sound/cocoa_s.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/sound/cocoa_s.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -116,7 +116,7 @@
 }
 
 
-static void CocoaSoundStop(void)
+static void CocoaSoundStop()
 {
 	struct AudioUnitInputCallback callback;
 
--- a/src/sound/null_s.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/sound/null_s.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -4,7 +4,7 @@
 #include "null_s.h"
 
 static const char *NullSoundStart(const char * const *parm) { return NULL; }
-static void NullSoundStop(void) {}
+static void NullSoundStop() {}
 
 const HalSoundDriver _null_sound_driver = {
 	NullSoundStart,
--- a/src/sound/sdl_s.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/sound/sdl_s.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -32,7 +32,7 @@
 	return NULL;
 }
 
-static void SdlSoundStop(void)
+static void SdlSoundStop()
 {
 	SDL_CALL SDL_CloseAudio();
 	SdlClose(SDL_INIT_AUDIO);
--- a/src/sound/win32_s.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/sound/win32_s.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -24,7 +24,7 @@
 		error("waveOutPrepareHeader failed");
 }
 
-static void FillHeaders(void)
+static void FillHeaders()
 {
 	WAVEHDR *hdr;
 
@@ -69,7 +69,7 @@
 	return NULL;
 }
 
-static void Win32SoundStop(void)
+static void Win32SoundStop()
 {
 	HWAVEOUT waveout = _waveout;
 
--- a/src/sprite.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/sprite.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,7 +8,7 @@
  * bounding box. Used especially for various multi-sprite buildings (like
  * depots or stations): */
 
-typedef struct DrawTileSeqStruct {
+struct DrawTileSeqStruct {
 	int8 delta_x; // 0x80 is sequence terminator
 	int8 delta_y;
 	int8 delta_z;
@@ -17,19 +17,19 @@
 	byte size_z;
 	SpriteID image;
 	SpriteID pal;
-} DrawTileSeqStruct;
+};
 
-typedef struct DrawTileSprites {
+struct DrawTileSprites {
 	SpriteID ground_sprite;
 	SpriteID ground_pal;
 	const DrawTileSeqStruct* seq;
-} DrawTileSprites;
+};
 
 /**
  * This structure is the same for both Industries and Houses.
  * Buildings here reference a general type of construction
  */
-typedef struct DrawBuildingsTileStruct {
+struct DrawBuildingsTileStruct {
 	PalSpriteID ground;
 	PalSpriteID building;
 	byte subtile_x:4;
@@ -38,7 +38,7 @@
 	byte height:4;
 	byte dz;
 	byte draw_proc;  /* this allows to specify a special drawing procedure.*/
-} DrawBuildingsTileStruct;
+};
 
 // Iterate through all DrawTileSeqStructs in DrawTileSprites.
 #define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++)
--- a/src/spritecache.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/spritecache.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -15,11 +15,11 @@
 #endif /* SPRITE_CACHE_SIZE */
 
 
-typedef struct SpriteCache {
+struct SpriteCache {
 	void *ptr;
 	uint32 file_pos;
 	int16 lru;
-} SpriteCache;
+};
 
 
 static uint _spritecache_items = 0;
@@ -55,18 +55,18 @@
 }
 
 
-typedef struct MemBlock {
+struct MemBlock {
 	uint32 size;
 	byte data[VARARRAY_SIZE];
-} MemBlock;
+};
 
 static uint _sprite_lru_counter;
 static MemBlock *_spritecache_ptr;
 static int _compact_cache_counter;
 
-static void CompactSpriteCache(void);
+static void CompactSpriteCache();
 
-static bool ReadSpriteHeaderSkipData(void)
+static bool ReadSpriteHeaderSkipData()
 {
 	uint16 num = FioReadWord();
 	byte type;
@@ -223,7 +223,7 @@
 	return (MemBlock*)((byte*)block + (block->size & ~S_FREE_MASK));
 }
 
-static uint32 GetSpriteCacheUsage(void)
+static uint32 GetSpriteCacheUsage()
 {
 	uint32 tot_size = 0;
 	MemBlock* s;
@@ -235,7 +235,7 @@
 }
 
 
-void IncreaseSpriteLRU(void)
+void IncreaseSpriteLRU()
 {
 	// Increase all LRU values
 	if (_sprite_lru_counter > 16384) {
@@ -265,7 +265,7 @@
 
 // Called when holes in the sprite cache should be removed.
 // That is accomplished by moving the cached data.
-static void CompactSpriteCache(void)
+static void CompactSpriteCache()
 {
 	MemBlock *s;
 
@@ -306,7 +306,7 @@
 	}
 }
 
-static void DeleteEntryFromSpriteCache(void)
+static void DeleteEntryFromSpriteCache()
 {
 	SpriteID i;
 	uint best = UINT_MAX;
@@ -403,7 +403,7 @@
 }
 
 
-void GfxInitSpriteMem(void)
+void GfxInitSpriteMem()
 {
 	// initialize sprite cache heap
 	if (_spritecache_ptr == NULL) _spritecache_ptr = (MemBlock*)malloc(SPRITE_CACHE_SIZE);
--- a/src/spritecache.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/spritecache.h	Mon Mar 19 12:38:16 2007 +0000
@@ -3,14 +3,14 @@
 #ifndef SPRITECACHE_H
 #define SPRITECACHE_H
 
-typedef struct Sprite {
+struct Sprite {
 	byte info;
 	byte height;
 	uint16 width;
 	int16 x_offs;
 	int16 y_offs;
 	byte data[VARARRAY_SIZE];
-} Sprite;
+};
 
 const void *GetRawSprite(SpriteID sprite);
 bool SpriteExists(SpriteID sprite);
@@ -25,8 +25,8 @@
 	return (byte*)GetRawSprite(sprite);
 }
 
-void GfxInitSpriteMem(void);
-void IncreaseSpriteLRU(void);
+void GfxInitSpriteMem();
+void IncreaseSpriteLRU();
 
 bool LoadNextSprite(int load_index, byte file_index);
 void DupSprite(SpriteID old_spr, SpriteID new_spr);
--- a/src/station.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/station.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -48,7 +48,7 @@
 	delete_ctr = 0;
 	facilities = 0;
 
-	last_vehicle_type = VEH_Invalid;
+	last_vehicle_type = VEH_INVALID;
 
 	random_bits = 0; // Random() must be called when station is really built (DC_EXEC)
 	waiting_triggers = 0;
@@ -155,7 +155,7 @@
 	return IsTileType(tile, MP_STATION) && GetStationIndex(tile) == index && IsRailwayStation(tile);
 }
 
-/*static*/ Station *Station::AllocateRaw(void)
+/*static*/ Station *Station::AllocateRaw()
 {
 	Station *st = NULL;
 
@@ -455,7 +455,7 @@
 		Vehicle *v;
 
 		FOR_ALL_VEHICLES(v) {
-			if (v->type == VEH_Road && v->u.road.slot == this) ClearSlot(v);
+			if (v->type == VEH_ROAD && v->u.road.slot == this) ClearSlot(v);
 		}
 	}
 	assert(num_vehicles == 0);
@@ -467,7 +467,7 @@
 
 
 /** Low-level function for allocating a RoadStop on the pool */
-RoadStop *RoadStop::AllocateRaw( void )
+RoadStop *RoadStop::AllocateRaw()
 {
 	RoadStop *rs;
 
--- a/src/station.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/station.h	Mon Mar 19 12:38:16 2007 +0000
@@ -11,13 +11,14 @@
 #include "newgrf_station.h"
 
 static const StationID INVALID_STATION = 0xFFFF;
+static const byte INITIAL_STATION_RATING = 175;
 
-typedef struct GoodsEntry {
+struct GoodsEntry {
 	GoodsEntry() :
 		waiting_acceptance(0),
 		unload_pending(0),
 		days_since_pickup(0),
-		rating(175),
+		rating(INITIAL_STATION_RATING),
 		enroute_from(INVALID_STATION),
 		enroute_from_xy(INVALID_TILE),
 		last_speed(0),
@@ -35,7 +36,7 @@
 	byte last_speed;
 	byte last_age;
 	int32 feeder_profit;
-} GoodsEntry;
+};
 
 /** A Stop for a Road Vehicle */
 struct RoadStop {
@@ -76,14 +77,14 @@
 	bool IsEntranceBusy() const;
 	void SetEntranceBusy(bool busy);
 protected:
-	static RoadStop *AllocateRaw(void);
+	static RoadStop *AllocateRaw();
 };
 
-typedef struct StationSpecList {
+struct StationSpecList {
 	const StationSpec *spec;
 	uint32 grfid;      /// GRF ID of this custom station
 	uint8  localidx;   /// Station ID within GRF of station
-} StationSpecList;
+};
 
 /** StationRect - used to track station spread out rectangle - cheaper than scanning whole map */
 struct StationRect : public Rect {
@@ -184,7 +185,7 @@
 	bool IsValid() const;
 
 protected:
-	static Station *AllocateRaw(void);
+	static Station *AllocateRaw();
 };
 
 enum {
@@ -207,26 +208,26 @@
 	HVOT_BUOY     = 1 << 6
 };
 
-typedef enum CatchmentAreas {
+enum CatchmentArea {
 	CA_NONE            =  0,
 	CA_BUS             =  3,
 	CA_TRUCK           =  3,
 	CA_TRAIN           =  4,
 	CA_DOCK            =  5
-} CatchmentArea;
+};
 
 void ModifyStationRatingAround(TileIndex tile, PlayerID owner, int amount, uint radius);
 
 void ShowStationViewWindow(StationID station);
-void UpdateAllStationVirtCoord(void);
+void UpdateAllStationVirtCoord();
 
 /* sorter stuff */
-void RebuildStationLists(void);
-void ResortStationLists(void);
+void RebuildStationLists();
+void ResortStationLists();
 
 DECLARE_OLD_POOL(Station, Station, 6, 1000)
 
-static inline StationID GetMaxStationIndex(void)
+static inline StationID GetMaxStationIndex()
 {
 	/* TODO - This isn't the real content of the function, but
 	 *  with the new pool-system this will be replaced with one that
@@ -236,7 +237,7 @@
 	return GetStationPoolSize() - 1;
 }
 
-static inline uint GetNumStations(void)
+static inline uint GetNumStations()
 {
 	return GetStationPoolSize();
 }
@@ -260,7 +261,7 @@
 /* End of stuff for ROADSTOPS */
 
 
-void AfterLoadStations(void);
+void AfterLoadStations();
 void GetProductionAroundTiles(AcceptedCargo produced, TileIndex tile, int w, int h, int rad);
 void GetAcceptanceAroundTiles(AcceptedCargo accepts, TileIndex tile, int w, int h, int rad);
 
@@ -270,7 +271,7 @@
 
 RoadStop * GetRoadStopByTile(TileIndex tile, RoadStop::Type type);
 uint GetNumRoadStops(const Station* st, RoadStop::Type type);
-RoadStop * AllocateRoadStop( void );
+RoadStop * AllocateRoadStop();
 void ClearSlot(Vehicle *v);
 
 void DeleteOilRig(TileIndex t);
--- a/src/station_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/station_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -330,7 +330,7 @@
 }
 
 // Update the virtual coords needed to draw the station sign for all stations.
-void UpdateAllStationVirtCoord(void)
+void UpdateAllStationVirtCoord()
 {
 	Station* st;
 
@@ -449,12 +449,12 @@
 	}
 }
 
-typedef struct ottd_Rectangle {
+struct ottd_Rectangle {
 	uint min_x;
 	uint min_y;
 	uint max_x;
 	uint max_y;
-} ottd_Rectangle;
+};
 
 static inline void MergePoint(ottd_Rectangle* rect, TileIndex tile)
 {
@@ -529,8 +529,9 @@
 		uint amt = min(accepts[i], 15);
 
 		// Make sure the station can accept the goods type.
-		if ((i != CT_PASSENGERS && !(st->facilities & (byte)~FACIL_BUS_STOP)) ||
-				(i == CT_PASSENGERS && !(st->facilities & (byte)~FACIL_TRUCK_STOP)))
+		bool is_passengers = IsCargoInClass(i, CC_PASSENGERS);
+		if ((!is_passengers && !(st->facilities & (byte)~FACIL_BUS_STOP)) ||
+				(is_passengers && !(st->facilities & (byte)~FACIL_TRUCK_STOP)))
 			amt = 0;
 
 		SB(st->goods[i].waiting_acceptance, 12, 4, amt);
@@ -1401,7 +1402,7 @@
 // Intercontinental Airport (vlarge) - 4 runways
 static const byte _airport_sections_intercontinental[] = {
 	102, 120,  89,  89,  89,  89,  89,  89, 118,
-	120,  22,  22,  22,  22,  22,  22, 119, 117,
+	120,  23,  23,  23,  23,  23,  23, 119, 117,
 	 87,  54,  87,   8,   8,   8,   8,  51, 117,
 	 87, 162,  87,  85, 116, 116,   8,   9,  10,
 	 87,   8,   8,  11,  31,  11,   8, 160,  32,
@@ -1410,7 +1411,7 @@
 	 87, 142,   8,  11,  29,  11,  10, 163,  10,
 	 87, 164,  87,   8,   8,   8,  10,  37, 117,
 	 87, 120,  89,  89,  89,  89,  89,  89, 119,
-	121,  22,  22,  22,  22,  22,  22, 119,  37
+	121,  23,  23,  23,  23,  23,  23, 119,  37
 };
 
 
@@ -1629,6 +1630,7 @@
 	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
 
 	if (!IsClearWaterTile(tile) || tile == 0) return_cmd_error(STR_304B_SITE_UNSUITABLE);
+	if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
 
 	/* allocate and initialize new station */
 	Station *st = new Station(tile);
@@ -1670,7 +1672,7 @@
 {
 	const Vehicle *v;
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Ship) {
+		if (v->type == VEH_SHIP) {
 			const Order *order;
 			FOR_VEHICLE_ORDERS(v, order) {
 				if (order->type == OT_GOTO_STATION && order->dest == st->index) {
@@ -1748,6 +1750,8 @@
 
 	if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile)) return CMD_ERROR;
 
+	if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
+
 	cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 	if (CmdFailed(cost)) return CMD_ERROR;
 
@@ -1757,6 +1761,8 @@
 		return_cmd_error(STR_304B_SITE_UNSUITABLE);
 	}
 
+	if (MayHaveBridgeAbove(tile_cur) && IsBridgeAbove(tile_cur)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
+
 	cost = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 	if (CmdFailed(cost)) return CMD_ERROR;
 
@@ -2071,11 +2077,11 @@
 
 static void AnimateTile_Station(TileIndex tile)
 {
-	typedef struct AnimData {
+	struct AnimData {
 		StationGfx from; // first sprite
 		StationGfx to;   // last sprite
 		byte delay;
-	} AnimData;
+	};
 
 	static const AnimData data[] = {
 		{ GFX_RADAR_LARGE_FIRST,         GFX_RADAR_LARGE_LAST,         3 },
@@ -2103,7 +2109,7 @@
 static void ClickTile_Station(TileIndex tile)
 {
 	if (IsHangar(tile)) {
-		ShowDepotWindow(tile, VEH_Aircraft);
+		ShowDepotWindow(tile, VEH_AIRCRAFT);
 	} else {
 		ShowStationViewWindow(GetStationIndex(tile));
 	}
@@ -2115,7 +2121,7 @@
 
 static uint32 VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y)
 {
-	if (v->type == VEH_Train) {
+	if (v->type == VEH_TRAIN) {
 		if (IsRailwayStation(tile) && IsFrontEngine(v) &&
 				!IsCompatibleTrainStationTile(tile + TileOffsByDiagDir(DirToDiagDir(v->direction)), tile)) {
 			StationID station_id = GetStationIndex(tile);
@@ -2145,7 +2151,7 @@
 				}
 			}
 		}
-	} else if (v->type == VEH_Road) {
+	} else if (v->type == VEH_ROAD) {
 		if (v->u.road.state < RVSB_IN_ROAD_STOP && !IsReversingRoadTrackdir((Trackdir)v->u.road.state) && v->u.road.frame == 0) {
 			if (IsRoadStop(tile)) {
 				/* Attempt to allocate a parking bay in a road stop */
@@ -2158,7 +2164,7 @@
 					if (!rs->IsFreeBay(side)) return VETSB_CANNOT_ENTER;
 
 					/* Check if the vehicle is stopping at this road stop */
-					if (GetRoadStopType(tile) == ((v->cargo_type == CT_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK) &&
+					if (GetRoadStopType(tile) == (IsCargoInClass(v->cargo_type, CC_PASSENGERS) ? RoadStop::BUS : RoadStop::TRUCK) &&
 							v->current_order.dest == GetStationIndex(tile)) {
 						SETBIT(v->u.road.state, RVS_IS_STOPPING);
 						rs->AllocateDriveThroughBay(side);
@@ -2210,6 +2216,12 @@
 
 	GoodsEntry *ge = st->goods;
 	do {
+		/* Slowly increase the rating back to his original level in the case we
+		 *  didn't deliver cargo yet to this station. This happens when a bribe
+		 *  failed while you didn't moved that cargo yet to a station. */
+		if (ge->enroute_from == INVALID_STATION && ge->rating < INITIAL_STATION_RATING)
+			ge->rating++;
+		/* Only change the rating if we are moving this cargo */
 		if (ge->enroute_from != INVALID_STATION) {
 			byte_inc_sat(&ge->enroute_time);
 			byte_inc_sat(&ge->days_since_pickup);
@@ -2234,7 +2246,7 @@
 
 			{
 				byte days = ge->days_since_pickup;
-				if (st->last_vehicle_type == VEH_Ship)
+				if (st->last_vehicle_type == VEH_SHIP)
 							days >>= 2;
 				(days > 21) ||
 				(rating += 25, days > 12) ||
@@ -2299,7 +2311,7 @@
 	if (b == 0) UpdateStationRating(st);
 }
 
-void OnTick_Station(void)
+void OnTick_Station()
 {
 	if (_game_mode == GM_EDITOR) return;
 
@@ -2312,7 +2324,7 @@
 	FOR_ALL_STATIONS(st) StationHandleSmallTick(st);
 }
 
-void StationMonthlyLoop(void)
+void StationMonthlyLoop()
 {
 }
 
@@ -2414,8 +2426,8 @@
 						(st->town->exclusive_counter == 0 || st->town->exclusivity == st->owner) && // check exclusive transport rights
 						st->goods[type].rating != 0 &&
 						(!_patches.selectgoods || st->goods[type].last_speed > 0) && // if last_speed is 0, no vehicle has been there.
-						((st->facilities & ~FACIL_BUS_STOP)   != 0 || type == CT_PASSENGERS) && // if we have other fac. than a bus stop, or the cargo is passengers
-						((st->facilities & ~FACIL_TRUCK_STOP) != 0 || type != CT_PASSENGERS)) { // if we have other fac. than a cargo bay or the cargo is not passengers
+						((st->facilities & ~FACIL_BUS_STOP)   != 0 || IsCargoInClass(type, CC_PASSENGERS)) && // if we have other fac. than a bus stop, or the cargo is passengers
+						((st->facilities & ~FACIL_TRUCK_STOP) != 0 || !IsCargoInClass(type, CC_PASSENGERS))) { // if we have other fac. than a cargo bay or the cargo is not passengers
 					if (_patches.modified_catchment) {
 						// min and max coordinates of the producer relative
 						const int x_min_prod = 9;
@@ -2537,7 +2549,7 @@
 	st->time_since_load = 255;
 	st->time_since_unload = 255;
 	st->delete_ctr = 0;
-	st->last_vehicle_type = VEH_Invalid;
+	st->last_vehicle_type = VEH_INVALID;
 	st->facilities = FACIL_AIRPORT | FACIL_DOCK;
 	st->build_date = _date;
 
@@ -2546,7 +2558,7 @@
 		st->goods[j].days_since_pickup = 0;
 		st->goods[j].enroute_from = INVALID_STATION;
 		st->goods[j].enroute_from_xy = INVALID_TILE;
-		st->goods[j].rating = 175;
+		st->goods[j].rating = INITIAL_STATION_RATING;
 		st->goods[j].last_speed = 0;
 		st->goods[j].last_age = 255;
 	}
@@ -2643,7 +2655,7 @@
 	return CMD_ERROR;
 }
 
-void InitializeStations(void)
+void InitializeStations()
 {
 	/* Clean the station pool and create 1 block in it */
 	CleanPool(&_Station_pool);
@@ -2658,7 +2670,7 @@
 }
 
 
-void AfterLoadStations(void)
+void AfterLoadStations()
 {
 	/* Update the speclists of all stations to point to the currently loaded custom stations. */
 	Station *st;
@@ -2791,18 +2803,6 @@
 	SlObject(st, _station_desc);
 	for (uint i = 0; i != NUM_CARGO; i++) {
 		SlObject(&st->goods[i], _goods_desc);
-
-		/* In older versions, enroute_from had 0xFF as INVALID_STATION, is now 0xFFFF */
-		if (CheckSavegameVersion(7) && st->goods[i].enroute_from == 0xFF) {
-			st->goods[i].enroute_from = INVALID_STATION;
-		}
-		if (CheckSavegameVersion(44)) {
-			/* Store position of the station where the goods come from, so there are no
-			 * very high payments when stations get removed. However, if the station
-			 * where the goods came from is already removed, the source information is
-			 * lost. In that case we set it to the position of this station */
-			st->goods[i].enroute_from_xy = IsValidStationID(st->goods[i].enroute_from) ? GetStation(st->goods[i].enroute_from)->xy : st->xy;
-		}
 	}
 
 	if (st->num_specs != 0) {
@@ -2814,7 +2814,7 @@
 	}
 }
 
-static void Save_STNS(void)
+static void Save_STNS()
 {
 	Station *st;
 	// Write the stations
@@ -2824,7 +2824,7 @@
 	}
 }
 
-static void Load_STNS(void)
+static void Load_STNS()
 {
 	int index;
 	while ((index = SlIterateArray()) != -1) {
@@ -2847,7 +2847,7 @@
 	if (_station_tick_ctr > GetMaxStationIndex()) _station_tick_ctr = 0;
 }
 
-static void Save_ROADSTOP(void)
+static void Save_ROADSTOP()
 {
 	RoadStop *rs;
 
@@ -2857,7 +2857,7 @@
 	}
 }
 
-static void Load_ROADSTOP(void)
+static void Load_ROADSTOP()
 {
 	int index;
 
--- a/src/station_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/station_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -30,9 +30,9 @@
 	STATIONLIST_WIDGET_BUS,
 	STATIONLIST_WIDGET_AIRPLANE,
 	STATIONLIST_WIDGET_SHIP,
-	STATIONLIST_WIDGET_CARGOSTART = 12,
-	STATIONLIST_WIDGET_NOCARGOWAITING = 24,
-	STATIONLIST_WIDGET_FACILALL = 26,
+	STATIONLIST_WIDGET_CARGOSTART = 20,
+	STATIONLIST_WIDGET_NOCARGOWAITING = 12,
+	STATIONLIST_WIDGET_FACILALL = 14,
 	STATIONLIST_WIDGET_CARGOALL,
 	STATIONLIST_WIDGET_SORTBY,
 	STATIONLIST_WIDGET_SORTCRITERIA,
@@ -138,6 +138,14 @@
 	return (_internal_sort_order & 1) ? sum2 - sum1 : sum1 - sum2;
 }
 
+/**
+ * qsort-compatible version of sorting two stations by maximum rating
+ * @param a   First object to be sorted, must be of type (const Station *)
+ * @param b   Second object to be sorted, must be of type (const Station *)
+ * @return    The sort order
+ * @retval >0 a should come before b in the list
+ * @retval <0 b should come before a in the list
+ */
 static int CDECL StationRatingMaxSorter(const void *a, const void *b)
 {
 	const Station* st1 = *(const Station**)a;
@@ -146,31 +154,31 @@
 	byte maxr2 = 0;
 
 	for (CargoID j = 0; j < NUM_CARGO; j++) {
-		if (st1->goods[j].waiting_acceptance & 0xfff) maxr1 = max(maxr1, st1->goods[j].rating);
-		if (st2->goods[j].waiting_acceptance & 0xfff) maxr2 = max(maxr2, st2->goods[j].rating);
+		if (st1->goods[j].enroute_from != INVALID_STATION) maxr1 = max(maxr1, st1->goods[j].rating);
+		if (st2->goods[j].enroute_from != INVALID_STATION) maxr2 = max(maxr2, st2->goods[j].rating);
 	}
 
 	return (_internal_sort_order & 1) ? maxr2 - maxr1 : maxr1 - maxr2;
 }
 
-typedef enum StationListFlags {
+enum StationListFlags {
 	SL_ORDER   = 0x01,
 	SL_RESORT  = 0x02,
 	SL_REBUILD = 0x04,
-} StationListFlags;
+};
 
 DECLARE_ENUM_AS_BIT_SET(StationListFlags);
 
-typedef struct plstations_d {
+struct plstations_d {
 	const Station** sort_list;
 	uint16 list_length;
 	byte sort_type;
 	StationListFlags flags;
 	uint16 resort_timer;  //was byte refresh_counter;
-} plstations_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(plstations_d));
 
-void RebuildStationLists(void)
+void RebuildStationLists()
 {
 	Window* const *wz;
 
@@ -183,7 +191,7 @@
 	}
 }
 
-void ResortStationLists(void)
+void ResortStationLists()
 {
 	Window* const *wz;
 
@@ -196,7 +204,7 @@
 	}
 }
 
-static void BuildStationsList(plstations_d* sl, PlayerID owner, byte facilities, uint16 cargo_filter)
+static void BuildStationsList(plstations_d* sl, PlayerID owner, byte facilities, uint32 cargo_filter, bool include_empty)
 {
 	uint n = 0;
 	const Station *st;
@@ -223,7 +231,7 @@
 					}
 				}
 				//stations without waiting cargo
-				if (num_waiting_cargo == 0 && HASBIT(cargo_filter, NUM_CARGO)) {
+				if (num_waiting_cargo == 0 && include_empty) {
 					station_sort[n++] = st;
 				}
 			}
@@ -261,28 +269,28 @@
 	sl->flags &= ~SL_RESORT;
 }
 
+static const uint32 _cargo_filter_max = ~0;
+static uint32 _cargo_filter = _cargo_filter_max;
+
 static void PlayerStationsWndProc(Window *w, WindowEvent *e)
 {
-	static const uint16 CARGO_ALL_SELECTED = 0x1FFF;
-
 	const PlayerID owner = (PlayerID)w->window_number;
 	static byte facilities = FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK;
-	static uint16 cargo_filter = CARGO_ALL_SELECTED;
 	static Listing station_sort = {0, 0};
+	static bool include_empty = true;
 
 	plstations_d *sl = &WP(w, plstations_d);
 
 	switch (e->event) {
 		case WE_CREATE: /* set up resort timer */
+			if (_cargo_filter == _cargo_filter_max) _cargo_filter = _cargo_mask;
+
 			for (uint i = 0; i < 5; i++) {
 				if (HASBIT(facilities, i)) LowerWindowWidget(w, i + STATIONLIST_WIDGET_TRAIN);
 			}
-			for (CargoID i = 0; i < NUM_CARGO; i++) {
-				if (HASBIT(cargo_filter, i)) LowerWindowWidget(w, i + STATIONLIST_WIDGET_CARGOSTART);
-			}
 			SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_FACILALL, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
-			SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGOALL, cargo_filter == CARGO_ALL_SELECTED);
-			SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_NOCARGOWAITING, HASBIT(cargo_filter, STATIONLIST_WIDGET_NOCARGOWAITING - NUM_CARGO));
+			SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGOALL, _cargo_filter == _cargo_mask && include_empty);
+			SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_NOCARGOWAITING, include_empty);
 
 			sl->sort_list = NULL;
 			sl->flags = SL_REBUILD;
@@ -292,7 +300,7 @@
 			break;
 
 		case WE_PAINT: {
-			BuildStationsList(sl, owner, facilities, cargo_filter);
+			BuildStationsList(sl, owner, facilities, _cargo_filter, include_empty);
 			SortStationsList(sl);
 
 			SetVScrollCount(w, sl->list_length);
@@ -314,14 +322,16 @@
 			int y = 14;
 			int xb = 2; // offset from left of widget
 
-			for (CargoID i = 0; i < NUM_CARGO; i++) {
-				const CargoSpec *cs = GetCargo(i);
-				if (cs->IsValid()) {
-					cg_ofst = IsWindowWidgetLowered(w, i + STATIONLIST_WIDGET_CARGOSTART) ? 2 : 1;
-					GfxFillRect(x + cg_ofst, y + cg_ofst, x + cg_ofst + 10 , y + cg_ofst + 7, cs->rating_colour);
-					DrawStringCentered(x + 6 + cg_ofst, y + cg_ofst, cs->abbrev, 0x10);
-				}
+			uint i = 0;
+			for (CargoID c = 0; c < NUM_CARGO; c++) {
+				const CargoSpec *cs = GetCargo(c);
+				if (!cs->IsValid()) continue;
+
+				cg_ofst = HASBIT(_cargo_filter, c) ? 2 : 1;
+				GfxFillRect(x + cg_ofst, y + cg_ofst, x + cg_ofst + 10 , y + cg_ofst + 7, cs->rating_colour);
+				DrawStringCentered(x + 6 + cg_ofst, y + cg_ofst, cs->abbrev, 0x10);
 				x += 14;
+				i++;
 			}
 
 			x += 6;
@@ -414,17 +424,22 @@
 					SetWindowDirty(w);
 					break;
 
-				case STATIONLIST_WIDGET_CARGOALL:
-					for (CargoID i = 0; i < NUM_CARGO; i++) {
+				case STATIONLIST_WIDGET_CARGOALL: {
+					uint i = 0;
+					for (CargoID c = 0; c < NUM_CARGO; c++) {
+						if (!GetCargo(c)->IsValid()) continue;
 						LowerWindowWidget(w, i + STATIONLIST_WIDGET_CARGOSTART);
+						i++;
 					}
 					LowerWindowWidget(w, STATIONLIST_WIDGET_NOCARGOWAITING);
 					LowerWindowWidget(w, STATIONLIST_WIDGET_CARGOALL);
 
-					cargo_filter = CARGO_ALL_SELECTED;
+					_cargo_filter = _cargo_mask;
+					include_empty = true;
 					sl->flags |= SL_REBUILD;
 					SetWindowDirty(w);
 					break;
+				}
 
 				case STATIONLIST_WIDGET_SORTBY: /*flip sorting method asc/desc*/
 					sl->flags ^= SL_ORDER; //DESC-flag
@@ -440,20 +455,53 @@
 					ShowDropDownMenu(w, _station_sort_listing, sl->sort_type, STATIONLIST_WIDGET_SORTDROPBTN, 0, 0);
 					break;
 
+				case STATIONLIST_WIDGET_NOCARGOWAITING:
+					if (_ctrl_pressed) {
+						include_empty = !include_empty;
+						ToggleWidgetLoweredState(w, STATIONLIST_WIDGET_NOCARGOWAITING);
+					} else {
+						for (uint i = STATIONLIST_WIDGET_CARGOSTART; i < w->widget_count; i++) {
+							RaiseWindowWidget(w, i);
+						}
+
+						_cargo_filter = 0;
+						include_empty = true;
+
+						LowerWindowWidget(w, STATIONLIST_WIDGET_NOCARGOWAITING);
+					}
+					sl->flags |= SL_REBUILD;
+					SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGOALL, _cargo_filter == _cargo_mask && include_empty);
+					SetWindowDirty(w);
+					break;
+
 				default:
-					if (e->we.click.widget >= STATIONLIST_WIDGET_CARGOSTART && e->we.click.widget <= STATIONLIST_WIDGET_NOCARGOWAITING) { //change cargo_filter
+					if (e->we.click.widget >= STATIONLIST_WIDGET_CARGOSTART) { //change cargo_filter
+						/* Determine the selected cargo type */
+						CargoID c;
+						int i = 0;
+						for (c = 0; c < NUM_CARGO; c++) {
+							if (!GetCargo(c)->IsValid()) continue;
+							if (e->we.click.widget - STATIONLIST_WIDGET_CARGOSTART == i) break;
+							i++;
+						}
+
 						if (_ctrl_pressed) {
-							TOGGLEBIT(cargo_filter, e->we.click.widget - STATIONLIST_WIDGET_CARGOSTART);
+							TOGGLEBIT(_cargo_filter, c);
 							ToggleWidgetLoweredState(w, e->we.click.widget);
 						} else {
-							for (uint i = 0; cargo_filter != 0; i++, cargo_filter >>= 1) {
-								if (HASBIT(cargo_filter, 0)) RaiseWindowWidget(w, i + STATIONLIST_WIDGET_CARGOSTART);
+							for (uint i = STATIONLIST_WIDGET_CARGOSTART; i < w->widget_count; i++) {
+								RaiseWindowWidget(w, i);
 							}
-							SETBIT(cargo_filter, e->we.click.widget - STATIONLIST_WIDGET_CARGOSTART);
+							RaiseWindowWidget(w, STATIONLIST_WIDGET_NOCARGOWAITING);
+
+							_cargo_filter = 0;
+							include_empty = false;
+
+							SETBIT(_cargo_filter, c);
 							LowerWindowWidget(w, e->we.click.widget);
 						}
 						sl->flags |= SL_REBUILD;
-						SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGOALL, cargo_filter == CARGO_ALL_SELECTED);
+						SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGOALL, _cargo_filter == _cargo_mask && include_empty);
 						SetWindowDirty(w);
 					}
 					break;
@@ -505,26 +553,14 @@
 {    WWT_TEXTBTN,   RESIZE_NONE,    14,    56,    69,    14,    24, STR_SHIP,          STR_USE_CTRL_TO_SELECT_MORE},
 //Index 11
 {      WWT_PANEL,   RESIZE_NONE,    14,    83,    88,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,    89,   102,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   103,   116,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   117,   130,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   131,   144,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   145,   158,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   159,   172,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   173,   186,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   187,   200,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   201,   214,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   215,   228,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   229,   242,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   243,   256,    14,    24, 0x0,               STR_USE_CTRL_TO_SELECT_MORE},
-{      WWT_PANEL,   RESIZE_NONE,    14,   257,   270,    14,    24, 0x0,               STR_NO_WAITING_CARGO},
-{      WWT_PANEL,  RESIZE_RIGHT,    14,   285,   357,    14,    24, 0x0,               STR_NULL},
+{      WWT_PANEL,   RESIZE_NONE,    14,    89,   102,    14,    24, 0x0,               STR_NO_WAITING_CARGO},
+{      WWT_PANEL,  RESIZE_RIGHT,    14,   117,   357,    14,    24, 0x0,               STR_NULL},
 
-//26
+//14
 {      WWT_PANEL,   RESIZE_NONE,    14,    70,    83,    14,    24, 0x0,               STR_SELECT_ALL_FACILITIES},
-{      WWT_PANEL,   RESIZE_NONE,    14,   271,   284,    14,    24, 0x0,               STR_SELECT_ALL_TYPES},
+{      WWT_PANEL,   RESIZE_NONE,    14,   103,   116,    14,    24, 0x0,               STR_SELECT_ALL_TYPES},
 
-//28
+//16
 {    WWT_TEXTBTN,   RESIZE_NONE,    14,     0,    80,    25,    36, STR_SORT_BY,       STR_SORT_ORDER_TIP},
 {      WWT_PANEL,   RESIZE_NONE,    14,    81,   232,    25,    36, 0x0,               STR_SORT_CRITERIA_TIP},
 {    WWT_TEXTBTN,   RESIZE_NONE,    14,   233,   243,    25,    36, STR_0225,          STR_SORT_CRITERIA_TIP},
@@ -552,6 +588,47 @@
 	w->vscroll.cap = 12;
 	w->resize.step_height = 10;
 	w->resize.height = w->height - 10 * 7; // minimum if 5 in the list
+
+	/* Add cargo filter buttons */
+	uint num_active = 0;
+	for (CargoID c = 0; c < NUM_CARGO; c++) {
+		if (GetCargo(c)->IsValid()) num_active++;
+	}
+
+	w->widget_count += num_active;
+	w->widget = ReallocT(w->widget, w->widget_count + 1);
+	w->widget[w->widget_count].type = WWT_LAST;
+
+	uint i = 0;
+	for (CargoID c = 0; c < NUM_CARGO; c++) {
+		if (!GetCargo(c)->IsValid()) continue;
+
+		Widget *wi = &w->widget[STATIONLIST_WIDGET_CARGOSTART + i];
+		wi->type     = WWT_PANEL;
+		wi->display_flags = RESIZE_NONE;
+		wi->color    = 14;
+		wi->left     = 89 + i * 14;
+		wi->right    = wi->left + 13;
+		wi->top      = 14;
+		wi->bottom   = 24;
+		wi->data     = 0;
+		wi->tooltips = STR_USE_CTRL_TO_SELECT_MORE;
+
+		if (HASBIT(_cargo_filter, c)) LowerWindowWidget(w, STATIONLIST_WIDGET_CARGOSTART + i);
+		i++;
+	}
+
+	w->widget[STATIONLIST_WIDGET_NOCARGOWAITING].left += num_active * 14;
+	w->widget[STATIONLIST_WIDGET_NOCARGOWAITING].right += num_active * 14;
+	w->widget[STATIONLIST_WIDGET_CARGOALL].left += num_active * 14;
+	w->widget[STATIONLIST_WIDGET_CARGOALL].right += num_active * 14;
+	w->widget[13].left += num_active * 14;
+
+	if (num_active > 15) {
+		/* Resize and fix the minimum width, if necessary */
+		ResizeWindow(w, (num_active - 15) * 14, 0);
+		w->resize.width = w->width;
+	}
 }
 
 static const Widget _station_view_expanded_widgets[] = {
@@ -632,8 +709,7 @@
 		y += 10;
 	}
 
-	CargoID i = 0;
-	do {
+	for (CargoID i = 0; i != NUM_CARGO && pos > -5; i++) {
 		uint waiting = GB(st->goods[i].waiting_acceptance, 0, 12);
 		if (waiting == 0) continue;
 
@@ -669,7 +745,7 @@
 				y += 10;
 			}
 		}
-	} while (pos > -5 && ++i != NUM_CARGO);
+	}
 
 	if (IsWindowOfPrototype(w, _station_view_widgets)) {
 		char *b = _userstring;
@@ -701,13 +777,17 @@
 
 		y = 77;
 		for (CargoID i = 0; i != NUM_CARGO; i++) {
-			if (st->goods[i].enroute_from != INVALID_STATION) {
-				SetDParam(0, GetCargo(i)->name);
-				SetDParam(2, st->goods[i].rating * 101 >> 8);
-				SetDParam(1, STR_3035_APPALLING + (st->goods[i].rating >> 5));
-				DrawString(8, y, STR_303D, 0);
-				y += 10;
-			}
+			const CargoSpec *cs = GetCargo(i);
+			if (!cs->IsValid()) continue;
+
+			const GoodsEntry *ge = &st->goods[i];
+			if (ge->enroute_from == INVALID_STATION) continue;
+
+			SetDParam(0, cs->name);
+			SetDParam(2, ge->rating * 101 >> 8);
+			SetDParam(1, STR_3035_APPALLING + (ge->rating >> 5));
+			DrawString(8, y, STR_303D, 0);
+			y += 10;
 		}
 	}
 }
@@ -748,13 +828,13 @@
 
 				case 10: { /* Show a list of scheduled trains to this station */
 					const Station *st = GetStation(w->window_number);
-					ShowVehicleListWindow(st->owner, VEH_Train, (StationID)w->window_number);
+					ShowVehicleListWindow(st->owner, VEH_TRAIN, (StationID)w->window_number);
 					break;
 				}
 
 				case 11: { /* Show a list of scheduled road-vehicles to this station */
 					const Station *st = GetStation(w->window_number);
-					ShowVehicleListWindow(st->owner, VEH_Road, (StationID)w->window_number);
+					ShowVehicleListWindow(st->owner, VEH_ROAD, (StationID)w->window_number);
 					break;
 				}
 
@@ -762,7 +842,7 @@
 					const Station *st = GetStation(w->window_number);
 					/* Since oilrigs have no owners, show the scheduled aircraft of current player */
 					PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner;
-					ShowVehicleListWindow(owner, VEH_Aircraft, (StationID)w->window_number);
+					ShowVehicleListWindow(owner, VEH_AIRCRAFT, (StationID)w->window_number);
 					break;
 				}
 
@@ -770,7 +850,7 @@
 					const Station *st = GetStation(w->window_number);
 					/* Since oilrigs/bouys have no owners, show the scheduled ships of current player */
 					PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner;
-					ShowVehicleListWindow(owner, VEH_Ship, (StationID)w->window_number);
+					ShowVehicleListWindow(owner, VEH_SHIP, (StationID)w->window_number);
 					break;
 				}
 			}
--- a/src/station_map.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/station_map.h	Mon Mar 19 12:38:16 2007 +0000
@@ -58,16 +58,16 @@
 	BUS_SIZE_EXT = GFX_BASE_END - GFX_BUS_BASE_EXT,
 };
 
-typedef enum HangarTiles {
+enum HangarTile {
 	HANGAR_TILE_0 = 32,
 	HANGAR_TILE_1 = 65,
 	HANGAR_TILE_2 = 86,
 	HANGAR_TILE_3 = 129, // added for west facing hangar
 	HANGAR_TILE_4 = 130, // added for north facing hangar
 	HANGAR_TILE_5 = 131 // added for east facing hangar
-} HangarTiles;
+};
 
-typedef enum StationType {
+enum StationType {
 	STATION_RAIL,
 	STATION_AIRPORT,
 	STATION_TRUCK,
@@ -75,7 +75,7 @@
 	STATION_OILRIG,
 	STATION_DOCK,
 	STATION_BUOY
-} StationType;
+};
 
 StationType GetStationType(TileIndex);
 
--- a/src/stdafx.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/stdafx.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,8 +8,14 @@
  * does not have stdint.h and apparently neither does MorphOS, so define
  * INT64_MAX for them ourselves. */
 #if !defined(_MSC_VER) && !defined( __MORPHOS__)
-# define __STDC_LIMIT_MACROS
-# include <stdint.h>
+# if defined (SUNOS)
+/* SunOS/Solaris does not have stdint.h, but inttypes.h defines everything
+ * stdint.h defines and we need. */
+#  include <inttypes.h>
+# else
+#  define __STDC_LIMIT_MACROS
+#  include <stdint.h>
+# endif
 #else
 # define INT64_MAX 9223372036854775807LL
 #endif
@@ -192,14 +198,16 @@
  * call to the same function and is not thread- or reentrancy-safe */
 #if !defined(STRGEN)
 # if defined(WIN32) || defined(WIN64)
-#  if defined(WINCE)
+#  include <tchar.h>
 /* XXX - WinCE without MSVCRT doesn't support wfopen, so it seems */
-#  else
-#   define fopen(file, mode) _wfopen(OTTD2FS(file), L ## mode)
-#  endif
-   const char *FS2OTTD(const wchar_t *name);
-   const wchar_t *OTTD2FS(const char *name);
+#  if !defined(WINCE)
+#   define fopen(file, mode) _tfopen(OTTD2FS(file), _T(mode))
+#  endif /* WINCE */
+
+   const char *FS2OTTD(const TCHAR *name);
+   const TCHAR *OTTD2FS(const char *name);
 # else
+
 #  define fopen(file, mode) fopen(OTTD2FS(file), mode)
    const char *FS2OTTD(const char *name);
    const char *OTTD2FS(const char *name);
--- a/src/strgen/strgen.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/strgen/strgen.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -31,7 +31,7 @@
 
 typedef void (*ParseCmdProc)(char *buf, int value);
 
-typedef struct LanguagePackHeader {
+struct LanguagePackHeader {
 	uint32 ident;
 	uint32 version;     // 32-bits of auto generated version info which is basically a hash of strings.h
 	char name[32];      // the international name of this language
@@ -40,15 +40,15 @@
 	uint16 offsets[32]; // the offsets
 	byte plural_form;   // plural form index
 	byte pad[3];        // pad header to be a multiple of 4
-} LanguagePackHeader;
+};
 
-typedef struct CmdStruct {
+struct CmdStruct {
 	const char *cmd;
 	ParseCmdProc proc;
 	long value;
 	int8 consumes;
 	byte flags;
-} CmdStruct;
+};
 
 enum {
 	C_DONTCOUNT = 1,
@@ -56,11 +56,11 @@
 };
 
 
-typedef struct Case {
+struct Case {
 	int caseidx;
 	char *string;
-	struct Case *next;
-} Case;
+	Case *next;
+};
 
 static bool _masterlang;
 static bool _translated;
@@ -68,7 +68,7 @@
 static int _cur_line;
 static int _errors, _warnings;
 
-typedef struct LangString {
+struct LangString {
 	char *name;            // Name of the string
 	char *english;         // English text
 	char *translated;      // Translated text
@@ -77,7 +77,7 @@
 	int line;              // line of string in source-file
 	Case *english_case;    // cases for english
 	Case *translated_case; // cases for foreign
-} LangString;
+};
 
 static LangString *_strings[65536];
 
@@ -106,16 +106,16 @@
 
 static const char *_cur_ident;
 
-typedef struct CmdPair {
+struct CmdPair {
 	const CmdStruct *a;
 	const char *v;
-} CmdPair;
+};
 
-typedef struct ParsedCommandStruct {
+struct ParsedCommandStruct {
 	int np;
 	CmdPair pairs[32];
 	const CmdStruct *cmd[32]; // ordered by param #
-} ParsedCommandStruct;
+};
 
 // Used when generating some advanced commands.
 static ParsedCommandStruct _cur_pcs;
@@ -938,7 +938,7 @@
 
 
 // make a hash of the file to get a unique "version number"
-static void MakeHashOfStrings(void)
+static void MakeHashOfStrings()
 {
 	uint32 hash = 0;
 	uint i;
@@ -1069,7 +1069,7 @@
 	return sum;
 }
 
-static void PutArgidxCommand(void)
+static void PutArgidxCommand()
 {
 	PutUtf8(SCC_ARG_INDEX);
 	PutByte(TranslateArgumentIdx(_cur_argidx));
--- a/src/string.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/string.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -282,7 +282,8 @@
 
 	for (const char *ptr = strchr(s, '\0'); *s != '\0';) {
 		size_t len = Utf8EncodedCharLen(*s);
-		if (len == 0) break; // invalid encoding
+		/* Silently ignore invalid UTF8 sequences, our only concern trimming */
+		if (len == 0) len = 1;
 
 		/* Take care when a hard cutoff was made for the string and
 		 * the last UTF8 sequence is invalid */
--- a/src/string.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/string.h	Mon Mar 19 12:38:16 2007 +0000
@@ -37,11 +37,11 @@
 /**
  * Valid filter types for IsValidChar.
  */
-typedef enum CharSetFilter {
+enum CharSetFilter {
 	CS_ALPHANUMERAL,      //! Both numeric and alphabetic and spaces and stuff
 	CS_NUMERAL,           //! Only numeric ones
 	CS_ALPHA,             //! Only alphabetic values
-} CharSetFilter;
+};
 
 /** Convert the given string to lowercase, only works with ASCII! */
 void strtolower(char *str);
--- a/src/strings.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/strings.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -27,6 +27,7 @@
 /* for opendir/readdir/closedir */
 # include "fios.h"
 
+DynamicLanguages _dynlang;
 char _userstring[128];
 
 static char *StationGetSpecialString(char *buff, int x, const char* last);
@@ -35,7 +36,7 @@
 
 static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei, const char* last);
 
-typedef struct LanguagePack {
+struct LanguagePack {
 	uint32 ident;
 	uint32 version;     // 32-bits of auto generated version info which is basically a hash of strings.h
 	char name[32];      // the international name of this language
@@ -45,7 +46,7 @@
 	byte plural_form;   // how to compute plural forms
 	byte pad[3];        // pad header to be a multiple of 4
 	char data[VARARRAY_SIZE];
-} LanguagePack;
+};
 
 static char **_langpack_offs;
 static LanguagePack *_langpack;
@@ -461,7 +462,7 @@
 	return b + pos;
 }
 
-typedef struct Units {
+struct Units {
 	int s_m;           ///< Multiplier for velocity
 	int s_s;           ///< Shift for velocity
 	StringID velocity; ///< String for velocity
@@ -479,7 +480,7 @@
 	int f_m;           ///< Multiplier for force
 	int f_s;           ///< Shift for force
 	StringID force;    ///< String for force
-} Units;
+};
 
 /* Unit conversions */
 static const Units units[] = {
@@ -1068,16 +1069,12 @@
 bool ReadLanguagePack(int lang_index)
 {
 	int tot_count, i;
-	LanguagePack *lang_pack;
 	size_t len;
 	char **langpack_offs;
 	char *s;
 
-	{
-		char *lang = str_fmt("%s%s", _paths.lang_dir, _dynlang.ent[lang_index].file);
-		lang_pack = (LanguagePack*)ReadFileToMem(lang, &len, 200000);
-		free(lang);
-	}
+	LanguagePack *lang_pack = (LanguagePack*)ReadFileToMem(_dynlang.ent[lang_index].file, &len, 200000);
+
 	if (lang_pack == NULL) return false;
 	if (len < sizeof(LanguagePack) ||
 			lang_pack->ident != TO_LE32(LANGUAGE_PACK_IDENT) ||
@@ -1119,7 +1116,7 @@
 	free(_langpack_offs);
 	_langpack_offs = langpack_offs;
 
-	ttd_strlcpy(_dynlang.curr_file, _dynlang.ent[lang_index].file, sizeof(_dynlang.curr_file));
+	ttd_strlcpy(_dynlang.curr_file, _dynlang.ent[lang_index].file, lengthof(_dynlang.curr_file));
 
 	_dynlang.curr = lang_index;
 	SetCurrentGrfLangID(_langpack->isocode);
@@ -1152,96 +1149,145 @@
 
 static int CDECL LanguageCompareFunc(const void *a, const void *b)
 {
-	return strcmp(*(const char* const *)a, *(const char* const *)b);
+	const Language *cmp1 = (const Language*)a;
+	const Language *cmp2 = (const Language*)b;
+
+	return strcmp(cmp1->file, cmp2->file);
 }
 
-static int GetLanguageList(char **languages, int max)
+/**
+ * Checks whether the given language is already found.
+ * @param langs    languages we've found so fa
+ * @param max      the length of the language list
+ * @param language name of the language to check
+ * @return true if and only if a language file with the same name has not been found
+ */
+static bool UniqueLanguageFile(const Language *langs, uint max, const char *language)
 {
-	DIR *dir;
-	struct dirent *dirent;
-	int num = 0;
+	for (uint i = 0; i < max; i++) {
+		const char *f_name = strrchr(langs[i].file, PATHSEPCHAR);
+		if (strcmp(f_name, language) == 0) return false; // duplicates
+	}
 
-	dir = ttd_opendir(_paths.lang_dir);
+	return true;
+}
+
+/**
+ * Reads the language file header and checks compatability.
+ * @param file the file to read
+ * @param hdr  the place to write the header information to
+ * @return true if and only if the language file is of a compatible version
+ */
+static bool GetLanguageFileHeader(const char *file, LanguagePack *hdr)
+{
+	FILE *f = fopen(file, "rb");
+	if (f == NULL) return false;
+
+	size_t read = fread(hdr, sizeof(*hdr), 1, f);
+	fclose(f);
+
+	return read == 1 &&
+			hdr->ident == TO_LE32(LANGUAGE_PACK_IDENT) &&
+			hdr->version == TO_LE32(LANGUAGE_PACK_VERSION);
+}
+
+/**
+ * Gets a list of languages from the given directory.
+ * @param langs the list to write to
+ * @param start the initial offset in the list
+ * @param max   the length of the language list
+ * @param path  the base directory to search in
+ * @return the number of added languages
+ */
+static int GetLanguageList(Language *langs, int start, int max, const char *path)
+{
+	int i = start;
+
+	DIR *dir = ttd_opendir(path);
 	if (dir != NULL) {
-		while ((dirent = readdir(dir)) != NULL) {
-			const char *d_name = FS2OTTD(dirent->d_name);
-			const char *t = strrchr(d_name, '.');
+		struct dirent *dirent;
+		while ((dirent = readdir(dir)) != NULL && i < max) {
+			const char *d_name    = FS2OTTD(dirent->d_name);
+			const char *extension = strrchr(d_name, '.');
 
-			if (t != NULL && strcmp(t, ".lng") == 0) {
-				languages[num++] = strdup(d_name);
-				if (num == max) break;
+			/* Not a language file */
+			if (extension == NULL || strcmp(extension, ".lng") != 0) continue;
+
+			/* Filter any duplicate language-files, first-come first-serve */
+			if (!UniqueLanguageFile(langs, i, d_name)) continue;
+
+			langs[i].file = str_fmt("%s%s", path, d_name);
+
+			/* Check whether the file is of the correct version */
+			LanguagePack hdr;
+			if (!GetLanguageFileHeader(langs[i].file, &hdr)) {
+				free(langs[i].file);
+				continue;
 			}
+
+			i++;
 		}
 		closedir(dir);
 	}
-
-	qsort(languages, num, sizeof(char*), LanguageCompareFunc);
-	return num;
+	return i - start;
 }
 
-// make a list of the available language packs. put the data in _dynlang struct.
-void InitializeLanguagePacks(void)
+/**
+ * Make a list of the available language packs. put the data in
+ * _dynlang struct.
+ */
+void InitializeLanguagePacks()
 {
-	DynamicLanguages *dl = &_dynlang;
-	int i;
-	int n;
-	int m;
-	int def;
-	int def2;
-	int fallback;
-	LanguagePack hdr;
-	FILE *in;
-	char *files[MAX_LANG];
-	const char* lang;
+	Language files[MAX_LANG];
+	uint language_count = GetLanguageList(files, 0, lengthof(files), _paths.lang_dir);
+	if (language_count == 0) error("No available language packs (invalid versions?)");
 
-	lang = GetCurrentLocale("LC_MESSAGES");
+	/* Sort the language names alphabetically */
+	qsort(files, language_count, sizeof(Language), LanguageCompareFunc);
+
+	/* Acquire the locale of the current system */
+	const char *lang = GetCurrentLocale("LC_MESSAGES");
 	if (lang == NULL) lang = "en_GB";
 
-	n = GetLanguageList(files, lengthof(files));
-
-	def = -1;
-	def2 = -1;
-	fallback = 0;
+	int chosen_language   = -1; ///< Matching the language in the configuartion file or the current locale
+	int language_fallback = -1; ///< Using pt_PT for pt_BR locale when pt_BR is not available
+	int en_GB_fallback    =  0; ///< Fallback when no locale-matching language has been found
 
-	// go through the language files and make sure that they are valid.
-	for (i = m = 0; i != n; i++) {
-		size_t j;
+	DynamicLanguages *dl = &_dynlang;
+	dl->num = 0;
+	/* Fill the dynamic languages structures */
+	for (uint i = 0; i < language_count; i++) {
+		/* File read the language header */
+		LanguagePack hdr;
+		if (!GetLanguageFileHeader(files[i].file, &hdr)) continue;
 
-		char *s = str_fmt("%s%s", _paths.lang_dir, files[i]);
-		in = fopen(s, "rb");
-		free(s);
-		if (in == NULL ||
-				(j = fread(&hdr, sizeof(hdr), 1, in), fclose(in), j) != 1 ||
-				hdr.ident != TO_LE32(LANGUAGE_PACK_IDENT) ||
-				hdr.version != TO_LE32(LANGUAGE_PACK_VERSION)) {
-			free(files[i]);
-			continue;
+		dl->ent[dl->num].file = files[i].file;
+		dl->ent[dl->num].name = strdup(hdr.name);
+		dl->dropdown[dl->num] = SPECSTR_LANGUAGE_START + dl->num;
+
+		/* We are trying to find a default language. The priority is by
+		 * configuration file, local environment and last, if nothing found,
+		 * english. If def equals -1, we have not picked a default language */
+		if (strcmp(dl->ent[dl->num].file, dl->curr_file) == 0) chosen_language = dl->num;
+
+		if (chosen_language == -1) {
+			if (strcmp (hdr.isocode, "en_GB") == 0) en_GB_fallback    = dl->num;
+			if (strncmp(hdr.isocode, lang, 5) == 0) chosen_language   = dl->num;
+			if (strncmp(hdr.isocode, lang, 2) == 0) language_fallback = dl->num;
 		}
 
-		dl->ent[m].file = files[i];
-		dl->ent[m].name = strdup(hdr.name);
-
-		if (strcmp(hdr.isocode, "en_GB")  == 0) fallback = m;
-		if (strncmp(hdr.isocode, lang, 2) == 0) def2 = m;
-		if (strncmp(hdr.isocode, lang, 5) == 0) def = m;
-
-		m++;
+		dl->num++;
 	}
-	if (def == -1) def = (def2 != -1 ? def2 : fallback);
+	/* Terminate the dropdown list */
+	dl->dropdown[dl->num] = INVALID_STRING_ID;
 
-	if (m == 0)
-		error(n == 0 ? "No available language packs" : "Invalid version of language packs");
-
-	dl->num = m;
-	for (i = 0; i != dl->num; i++) dl->dropdown[i] = SPECSTR_LANGUAGE_START + i;
-	dl->dropdown[i] = INVALID_STRING_ID;
+	if (dl->num == 0) error("Invalid version of language packs");
 
-	for (i = 0; i != dl->num; i++)
-		if (strcmp(dl->ent[i].file, dl->curr_file) == 0) {
-			def = i;
-			break;
-		}
+	/* We haven't found the language in the config nor the one in the locale.
+	 * Now we set it to one of the fallback languages */
+	if (chosen_language == -1) {
+		chosen_language = (language_fallback != -1) ? language_fallback : en_GB_fallback;
+	}
 
-	if (!ReadLanguagePack(def))
-		error("can't read language pack '%s'", dl->ent[def].file);
+	if (!ReadLanguagePack(chosen_language)) error("Can't read language pack '%s'", dl->ent[chosen_language].file);
 }
--- a/src/strings.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/strings.h	Mon Mar 19 12:38:16 2007 +0000
@@ -9,6 +9,9 @@
 extern char _userstring[128];
 
 void InjectDParam(int amount);
-int32 GetParamInt32(void);
+int32 GetParamInt32();
+
+bool ReadLanguagePack(int index);
+void InitializeLanguagePacks();
 
 #endif /* STRINGS_H */
--- a/src/subsidy_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/subsidy_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -13,6 +13,7 @@
 #include "economy.h"
 #include "variables.h"
 #include "date.h"
+#include "cargotype.h"
 
 static void HandleSubsidyClick(int y)
 {
@@ -50,22 +51,24 @@
 
 handle_click:
 
+	TownEffect te = GetCargo(s->cargo_type)->town_effect;
+
 	/* determine from coordinate for subsidy and try to scroll to it */
 	offs = s->from;
 	if (s->age >= 12) {
 		xy = GetStation(offs)->xy;
-	} else if (s->cargo_type == CT_PASSENGERS || s->cargo_type == CT_MAIL) {
+	} else if (te == TE_PASSENGERS || te == TE_MAIL) {
 		xy = GetTown(offs)->xy;
 	} else {
 		xy = GetIndustry(offs)->xy;
+	}
 
-	}
 	if (!ScrollMainWindowToTile(xy)) {
 		/* otherwise determine to coordinate for subsidy and scroll to it */
 		offs = s->to;
 		if (s->age >= 12) {
 			xy = GetStation(offs)->xy;
-		} else if (s->cargo_type == CT_PASSENGERS || s->cargo_type == CT_MAIL || s->cargo_type == CT_GOODS || s->cargo_type == CT_FOOD) {
+		} else if (te == TE_PASSENGERS || te == TE_MAIL || te == TE_GOODS || te == TE_FOOD) {
 			xy = GetTown(offs)->xy;
 		} else {
 			xy = GetIndustry(offs)->xy;
@@ -170,7 +173,7 @@
 };
 
 
-void ShowSubsidiesList(void)
+void ShowSubsidiesList()
 {
 	AllocateWindowDescFront(&_subsidies_list_desc, 0);
 }
--- a/src/table/ai_rail.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/ai_rail.h	Mon Mar 19 12:38:16 2007 +0000
@@ -1,24 +1,24 @@
 /* $Id$ */
 
-typedef struct {
+struct AiDefaultBlockData {
 	byte mode;
 	byte attr;
 	TileIndexDiffC tileoffs;
-} AiDefaultBlockData;
+};
 
-typedef struct {
+struct AiDefaultRailBlock {
 	byte p0;
 	byte p1;
 	byte p2;
 	byte p3;
 	byte dir;
 	const AiDefaultBlockData *data;
-} AiDefaultRailBlock;
+};
 
-typedef struct {
+struct AiDefaultRoadBlock {
 	byte dir;
 	const AiDefaultBlockData *data;
-} AiDefaultRoadBlock;
+};
 
 
 #define MKHDR(a,b,c,d,e) a,b,c,d,e,
--- a/src/table/build_industry.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/build_industry.h	Mon Mar 19 12:38:16 2007 +0000
@@ -1,5 +1,7 @@
 /* $Id$ */
 
+/** @file build_industry.h */
+
 #ifndef BUILD_INDUSTRY_H
 #define BUILD_INDUSTRY_H
 
@@ -1068,7 +1070,7 @@
 
 /* Procedures that can be run to check whether an industry may
  * build at location the given to the procedure */
-typedef enum CheckProcs {
+enum CheckProc {
 	CHECK_NOTHING    = 0,
 	CHECK_FOREST     = 1,
 	CHECK_REFINERY   = 2,
@@ -1079,11 +1081,11 @@
 	CHECK_BUBBLEGEN  = 7,
 	CHECK_OIL_RIG    = 8,
 	CHECK_END,
-} CheckProc;
+};
 
-#define MK(tbl, d, c1, c2, c3, proc, p1, r1, p2, r2, m, a1, a2, a3, pr, clim, in, s1, s2, s3) \
+#define MK(tbl, d, c1, c2, c3, proc, p1, r1, p2, r2, m, a1, a2, a3, pr, clim, in, intx, s1, s2, s3) \
 	{tbl, lengthof(tbl), d, {c1, c2, c3}, proc, {p1, p2}, {r1, r2}, m,            \
-	 {a1, a2, a3}, pr, clim, in, s1, s2, s3}
+	 {a1, a2, a3}, pr, clim, in, intx, s1, s2, s3}
 
 static const IndustrySpec _industry_specs[] = {
 	/* Format:
@@ -1092,14 +1094,14 @@
 	   (produced cargo + rate) (twice)         minimum cargo moved to station
 	   3 accepted cargo
 	   industry life                           climate availability
-	   industry name
+	   industry name                           building text
 	   messages : Closure                      production up                      production down   */
 	MK(_tile_table_coal_mine,                  210,
 	   IT_POWER_STATION,  IT_INVALID,          IT_INVALID,       CHECK_NOTHING,
 	   CT_COAL,       15, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_NORMAL | 1 << LT_HILLY,
-	   STR_4802_COAL_MINE,
+	   STR_4802_COAL_MINE,                     STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4836_NEW_COAL_SEAM_FOUND_AT,   STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_power_station,              30,
@@ -1107,7 +1109,7 @@
 	   CT_INVALID,     0, CT_INVALID,       0, 5,
 	   CT_COAL,           CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_NOT_CLOSABLE,              1 << LT_NORMAL | 1 << LT_HILLY,
-	   STR_4803_POWER_STATION,
+	   STR_4803_POWER_STATION,                 STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_sawmill,                    28,
@@ -1115,7 +1117,7 @@
 	   CT_GOODS,       0, CT_INVALID,       0, 5,
 	   CT_WOOD,           CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_NORMAL,
-	   STR_4804_SAWMILL,
+	   STR_4804_SAWMILL,                       STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_forest,                     200,
@@ -1123,7 +1125,7 @@
 	   CT_WOOD,       13, CT_INVALID,       0, 30,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_NORMAL | 1 << LT_HILLY,
-	   STR_4805_FOREST,
+	   STR_4805_FOREST,                        STR_482E_NEW_BEING_PLANTED_NEAR,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_483A_INSECT_INFESTATION_CAUSES),
 
 	MK(_tile_table_oil_refinery,               31,
@@ -1131,7 +1133,7 @@
 	   CT_GOODS,       0, CT_INVALID,       0, 5,
 	   CT_OIL,            CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_NORMAL | 1 << LT_HILLY | 1 << LT_DESERT,
-	   STR_4806_OIL_REFINERY,
+	   STR_4806_OIL_REFINERY,                  STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_oil_rig,                    240,
@@ -1139,7 +1141,7 @@
 	   CT_OIL,        15, CT_PASSENGERS,    2, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_NORMAL,
-	   STR_4807_OIL_RIG,
+	   STR_4807_OIL_RIG,                       STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4837_NEW_OIL_RESERVES_FOUND,   STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_factory,                    26,
@@ -1147,7 +1149,7 @@
 	   CT_GOODS,       0, CT_INVALID,       0, 5,
 	   CT_LIVESTOCK,      CT_GRAIN,            CT_STEEL,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_NORMAL,
-	   STR_4808_FACTORY,
+	   STR_4808_FACTORY,                       STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_printing_works,             26,
@@ -1155,7 +1157,7 @@
 	   CT_GOODS,       0, CT_INVALID,       0, 5,
 	   CT_PAPER,          CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_HILLY,
-	   STR_4809_PRINTING_WORKS,
+	   STR_4809_PRINTING_WORKS,                STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_steel_mill,                 27,
@@ -1163,7 +1165,7 @@
 	   CT_STEEL,       0, CT_INVALID,       0, 5,
 	   CT_IRON_ORE,       CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_NORMAL,
-	   STR_480A_STEEL_MILL,
+	   STR_480A_STEEL_MILL,                    STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_farm,                       250,
@@ -1171,7 +1173,7 @@
 	   CT_GRAIN,      10, CT_LIVESTOCK,    10, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_NORMAL | 1 << LT_HILLY,
-	   STR_480B_FARM,
+	   STR_480B_FARM,                          STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_483A_INSECT_INFESTATION_CAUSES),
 
 	MK(_tile_table_copper_mine,                205,
@@ -1179,7 +1181,7 @@
 	   CT_COPPER_ORE, 10, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_DESERT,
-	   STR_480C_COPPER_ORE_MINE,
+	   STR_480C_COPPER_ORE_MINE,               STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_oil_well,                   220,
@@ -1187,7 +1189,7 @@
 	   CT_OIL,        12, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_NORMAL | 1 << LT_HILLY | 1 << LT_DESERT,
-	   STR_480D_OIL_WELLS,
+	   STR_480D_OIL_WELLS,                     STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4837_NEW_OIL_RESERVES_FOUND,   STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_bank,                       193,
@@ -1195,7 +1197,7 @@
 	   CT_VALUABLES,   6, CT_INVALID,       0, 5,
 	   CT_VALUABLES,      CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_NOT_CLOSABLE,              1 << LT_NORMAL,
-	   STR_480E_BANK,
+	   STR_480E_BANK,                          STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_food_process,               26,
@@ -1203,7 +1205,7 @@
 	   CT_FOOD,        0, CT_INVALID,       0, 5,
 	   CT_FRUIT,          CT_MAIZE,            CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_HILLY | 1 << LT_DESERT,
-	   STR_480F_FOOD_PROCESSING_PLANT,
+	   STR_480F_FOOD_PROCESSING_PLANT,         STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_paper_mill,                 28,
@@ -1211,7 +1213,7 @@
 	   CT_PAPER,       0, CT_INVALID,       0, 5,
 	   CT_WOOD,           CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_HILLY,
-	   STR_4810_PAPER_MILL,
+	   STR_4810_PAPER_MILL,                    STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_gold_mine,                  208,
@@ -1219,7 +1221,7 @@
 	   CT_GOLD,        7, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_DESERT,
-	   STR_4811_GOLD_MINE,
+	   STR_4811_GOLD_MINE,                     STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_bank2,                      19,
@@ -1227,7 +1229,7 @@
 	   CT_INVALID,     0, CT_INVALID,       0, 5,
 	   CT_GOLD,           CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_NOT_CLOSABLE,              1 << LT_HILLY | 1 << LT_DESERT,
-	   STR_4812_BANK,
+	   STR_4812_BANK,                          STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_diamond_mine,               213,
@@ -1235,7 +1237,7 @@
 	   CT_DIAMONDS,    7, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_DESERT,
-	   STR_4813_DIAMOND_MINE,
+	   STR_4813_DIAMOND_MINE,                  STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_iron_mine,                  220,
@@ -1243,7 +1245,7 @@
 	   CT_IRON_ORE,   10, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_NORMAL,
-	   STR_4814_IRON_ORE_MINE,
+	   STR_4814_IRON_ORE_MINE,                 STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_fruit_plantation,           225,
@@ -1251,7 +1253,7 @@
 	   CT_FRUIT,      10, CT_INVALID,       0, 15,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_DESERT,
-	   STR_4815_FRUIT_PLANTATION,
+	   STR_4815_FRUIT_PLANTATION,              STR_482E_NEW_BEING_PLANTED_NEAR,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_483A_INSECT_INFESTATION_CAUSES),
 
 	MK(_tile_table_rubber_plantation,          218,
@@ -1259,7 +1261,7 @@
 	   CT_RUBBER,     10, CT_INVALID,       0, 15,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_DESERT,
-	   STR_4816_RUBBER_PLANTATION,
+	   STR_4816_RUBBER_PLANTATION,             STR_482E_NEW_BEING_PLANTED_NEAR,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_483A_INSECT_INFESTATION_CAUSES),
 
 	MK(_tile_table_water_supply,               199,
@@ -1267,7 +1269,7 @@
 	   CT_WATER,      12, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_DESERT,
-	   STR_4817_WATER_SUPPLY,
+	   STR_4817_WATER_SUPPLY,                  STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_water_tower,                14,
@@ -1275,7 +1277,7 @@
 	   CT_INVALID,     0, CT_INVALID,       0, 5,
 	   CT_WATER,          CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_NOT_CLOSABLE,              1 << LT_DESERT,
-	   STR_4818_WATER_TOWER,
+	   STR_4818_WATER_TOWER,                   STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_factory2,                   26,
@@ -1283,7 +1285,7 @@
 	   CT_GOODS,       0, CT_INVALID,       0, 5,
 	   CT_RUBBER,         CT_COPPER_ORE,       CT_WOOD,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_DESERT,
-	   STR_4819_FACTORY,
+	   STR_4819_FACTORY,                       STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_farm2,                      250,
@@ -1291,7 +1293,7 @@
 	   CT_MAIZE,      11, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_DESERT,
-	   STR_481A_FARM,
+	   STR_481A_FARM,                          STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_483A_INSECT_INFESTATION_CAUSES),
 
 	MK(_tile_table_lumber_mill,                17,
@@ -1299,7 +1301,7 @@
 	   CT_WOOD,        0, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_DESERT,
-	   STR_481B_LUMBER_MILL,
+	   STR_481B_LUMBER_MILL,                   STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4834_LACK_OF_NEARBY_TREES_CAUSES,   STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_cotton_candy,               195,
@@ -1307,7 +1309,7 @@
 	   CT_COTTON_CANDY, 13, CT_INVALID,    0, 30,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_CANDY,
-	   STR_481C_COTTON_CANDY_FOREST,
+	   STR_481C_COTTON_CANDY_FOREST,           STR_482E_NEW_BEING_PLANTED_NEAR,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_candy_factory,              26,
@@ -1315,7 +1317,7 @@
 	   CT_CANDY,       0, CT_INVALID,       0, 5,
 	   CT_SUGAR,          CT_TOFFEE,           CT_COTTON_CANDY,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_CANDY,
-	   STR_481D_CANDY_FACTORY,
+	   STR_481D_CANDY_FACTORY,                 STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_battery_farm,               187,
@@ -1323,7 +1325,7 @@
 	   CT_BATTERIES,  11, CT_INVALID,      0, 30,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_CANDY,
-	   STR_481E_BATTERY_FARM,
+	   STR_481E_BATTERY_FARM,                  STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4838_IMPROVED_FARMING_METHODS, STR_483A_INSECT_INFESTATION_CAUSES),
 
 	MK(_tile_table_cola_wells,                 193,
@@ -1331,7 +1333,7 @@
 	   CT_COLA,       12, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_CANDY,
-	   STR_481F_COLA_WELLS,
+	   STR_481F_COLA_WELLS,                    STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_toy_shop,                   17,
@@ -1339,7 +1341,7 @@
 	   CT_INVALID,     0, CT_INVALID,       0, 5,
 	   CT_TOYS,           CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_NOT_CLOSABLE,              1 << LT_CANDY,
-	   STR_4820_TOY_SHOP,
+	   STR_4820_TOY_SHOP,                      STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_toy_factory,                20,
@@ -1347,7 +1349,7 @@
 	   CT_TOYS,        0, CT_INVALID,       0, 5,
 	   CT_PLASTIC,        CT_BATTERIES,        CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_CANDY,
-	   STR_4821_TOY_FACTORY,
+	   STR_4821_TOY_FACTORY,                   STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_plastic_fountain,           192,
@@ -1355,7 +1357,7 @@
 	   CT_PLASTIC,    14, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_CANDY,
-	   STR_4822_PLASTIC_FOUNTAINS,
+	   STR_4822_PLASTIC_FOUNTAINS,             STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_fizzy_drink,                22,
@@ -1363,7 +1365,7 @@
 	   CT_FIZZY_DRINKS, 0, CT_INVALID,      0, 5,
 	   CT_COLA,           CT_BUBBLES,          CT_INVALID,
 	   INDUSTRYLIFE_CLOSABLE,                  1 << LT_CANDY,
-	   STR_4823_FIZZY_DRINK_FACTORY,
+	   STR_4823_FIZZY_DRINK_FACTORY,           STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4833_SUPPLY_PROBLEMS_CAUSE_TO,      STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_bubble_generator,           203,
@@ -1371,7 +1373,7 @@
 	   CT_BUBBLES,    13, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_CANDY,
-	   STR_4824_BUBBLE_GENERATOR,
+	   STR_4824_BUBBLE_GENERATOR,              STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_toffee_quarry,              213,
@@ -1379,7 +1381,7 @@
 	   CT_TOFFEE,     10, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_CANDY,
-	   STR_4825_TOFFEE_QUARRY,
+	   STR_4825_TOFFEE_QUARRY,                 STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 
 	MK(_tile_table_sugar_mine,                 210,
@@ -1387,7 +1389,7 @@
 	   CT_SUGAR,      11, CT_INVALID,       0, 5,
 	   CT_INVALID,        CT_INVALID,          CT_INVALID,
 	   INDUSTRYLIFE_PRODUCTION,                1 << LT_CANDY,
-	   STR_4826_SUGAR_MINE,
+	   STR_4826_SUGAR_MINE,                    STR_482D_NEW_UNDER_CONSTRUCTION,
 	   STR_4832_ANNOUNCES_IMMINENT_CLOSURE,    STR_4835_INCREASES_PRODUCTION,     STR_4839_PRODUCTION_DOWN_BY_50),
 };
 #undef MK
@@ -1461,256 +1463,263 @@
 	_industry_create_table_3,
 };
 
-#define MK(c1, c2, c3, sl) \
-	{{c1, c2, c3}, sl}
-
+/** Writes the properties of a industry tile into the IndustryTileSpec struct.
+ * @param c1 first type of cargo accepted for this tile
+ * @param c2 second cargo
+ * @param c3 and third cargo. Those three are in an array
+ * @param s1 slope refused upon choosing a place to build
+ * @param a1 animation frame on production
+ * @param a2 next frame of animation
+ * @param a3 chosses between animation of construction state
+ */
+#define MK(c1, c2, c3, sl, a1, a2, a3) {{c1, c2, c3}, sl, a1, a2, a3}
 static const IndustryTileSpec _industry_tile_specs[] = {
 	/* Coal Mine */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  true),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Power Station */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_COAL,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_COAL,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Sawmill */
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_WOOD,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_WOOD,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Forest Artic, temperate */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,               17,  INDUTILE_NOANIM,   false), // Chopping forest
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,               16,   false), // Growing forest
 
 	/* Oil refinery */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_OIL,        SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_OIL,        SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* oil Rig */
-	MK(CT_INVALID,      CT_INVALID,   CT_PASSENGERS, SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_MAIL,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_PASSENGERS, SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_MAIL,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Oil Wells artic, temperate */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  true ),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  true ),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  true ),
 
 	/* Farm tropic, arctic and temperate */
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Factory temperate */
-	MK(CT_GRAIN,        CT_STEEL,     CT_LIVESTOCK,  SLOPE_STEEP),
-	MK(CT_GRAIN,        CT_STEEL,     CT_LIVESTOCK,  SLOPE_STEEP),
-	MK(CT_GRAIN,        CT_STEEL,     CT_LIVESTOCK,  SLOPE_STEEP),
-	MK(CT_GRAIN,        CT_STEEL,     CT_LIVESTOCK,  SLOPE_STEEP),
+	MK(CT_GRAIN,        CT_STEEL,     CT_LIVESTOCK,  SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_GRAIN,        CT_STEEL,     CT_LIVESTOCK,  SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_GRAIN,        CT_STEEL,     CT_LIVESTOCK,  SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_GRAIN,        CT_STEEL,     CT_LIVESTOCK,  SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Printing works */
-	MK(CT_INVALID,      CT_INVALID,   CT_PAPER,      SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_PAPER,      SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_PAPER,      SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_PAPER,      SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_PAPER,      SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_PAPER,      SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_PAPER,      SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_PAPER,      SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Copper ore mine */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  true ),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Steel mill */
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_IRON_ORE,   SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Bank temperate*/
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_VALUABLES,  SLOPE_E),
-	MK(CT_PASSENGERS,   CT_INVALID,   CT_VALUABLES,  SLOPE_S),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_VALUABLES,  SLOPE_E,      INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_PASSENGERS,   CT_INVALID,   CT_VALUABLES,  SLOPE_S,      INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Food processing plant, tropic and arctic. CT_MAIZE or CT_WHEAT, CT_LIVESTOCK or CT_FRUIT*/
-	MK(CT_MAIZE,        CT_INVALID,   CT_LIVESTOCK,  SLOPE_STEEP),
-	MK(CT_MAIZE,        CT_INVALID,   CT_LIVESTOCK,  SLOPE_STEEP),
-	MK(CT_MAIZE,        CT_INVALID,   CT_LIVESTOCK,  SLOPE_STEEP),
-	MK(CT_MAIZE,        CT_INVALID,   CT_LIVESTOCK,  SLOPE_STEEP),
+	MK(CT_MAIZE,        CT_INVALID,   CT_LIVESTOCK,  SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_MAIZE,        CT_INVALID,   CT_LIVESTOCK,  SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_MAIZE,        CT_INVALID,   CT_LIVESTOCK,  SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_MAIZE,        CT_INVALID,   CT_LIVESTOCK,  SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Paper mill */
-	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_WOOD,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Gold mine */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  true ),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Bank Sub Arctic */
-	MK(CT_INVALID,      CT_INVALID,   CT_GOLD,       SLOPE_E),
-	MK(CT_INVALID,      CT_INVALID,   CT_GOLD,       SLOPE_S),
+	MK(CT_INVALID,      CT_INVALID,   CT_GOLD,       SLOPE_E,      INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_GOLD,       SLOPE_S,      INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Diamond mine */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Iron ore Mine */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Fruit plantation */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Rubber plantation */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Water supply */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Water tower */
-	MK(CT_INVALID,      CT_INVALID,   CT_WATER,      SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_WATER,      SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Factory (sub-tropical) */
-	MK(CT_COPPER_ORE,   CT_WOOD,      CT_RUBBER,     SLOPE_STEEP),
-	MK(CT_COPPER_ORE,   CT_WOOD,      CT_RUBBER,     SLOPE_STEEP),
-	MK(CT_COPPER_ORE,   CT_WOOD,      CT_RUBBER,     SLOPE_STEEP),
-	MK(CT_COPPER_ORE,   CT_WOOD,      CT_RUBBER,     SLOPE_STEEP),
+	MK(CT_COPPER_ORE,   CT_WOOD,      CT_RUBBER,     SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_COPPER_ORE,   CT_WOOD,      CT_RUBBER,     SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_COPPER_ORE,   CT_WOOD,      CT_RUBBER,     SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_COPPER_ORE,   CT_WOOD,      CT_RUBBER,     SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Lumber mill */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Candyfloss forest */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,              130,   INDUTILE_NOANIM,  false), // Chopping candyfloss
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,               129,  false), // Growing candyfloss
 
 	/* Sweet factory */
-	MK(CT_COTTON_CANDY, CT_TOFFEE,    CT_SUGAR,      SLOPE_STEEP),
-	MK(CT_COTTON_CANDY, CT_TOFFEE,    CT_SUGAR,      SLOPE_STEEP),
-	MK(CT_COTTON_CANDY, CT_TOFFEE,    CT_SUGAR,      SLOPE_STEEP),
-	MK(CT_COTTON_CANDY, CT_TOFFEE,    CT_SUGAR,      SLOPE_STEEP),
+	MK(CT_COTTON_CANDY, CT_TOFFEE,    CT_SUGAR,      SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_COTTON_CANDY, CT_TOFFEE,    CT_SUGAR,      SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_COTTON_CANDY, CT_TOFFEE,    CT_SUGAR,      SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_COTTON_CANDY, CT_TOFFEE,    CT_SUGAR,      SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Batter farm */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,              136,   INDUTILE_NOANIM,  false), // Reaping batteries
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,               135,  false), // Growing batteries
 
 	/* Cola wells */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Toy shop */
-	MK(CT_INVALID,      CT_INVALID,   CT_TOYS,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_TOYS,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_TOYS,       SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_TOYS,       SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_TOYS,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_TOYS,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_TOYS,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_TOYS,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Toy factory */
-	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP),
-	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP),
-	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP),
-	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP),
-	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP),
-	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP),
+	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_BATTERIES,    CT_INVALID,   CT_PLASTIC,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Plastic Fountain */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Fizzy drink factory */
-	MK(CT_BUBBLES,      CT_INVALID,   CT_COLA,       SLOPE_STEEP),
-	MK(CT_BUBBLES,      CT_INVALID,   CT_COLA,       SLOPE_STEEP),
-	MK(CT_BUBBLES,      CT_INVALID,   CT_COLA,       SLOPE_STEEP),
-	MK(CT_BUBBLES,      CT_INVALID,   CT_COLA,       SLOPE_STEEP),
+	MK(CT_BUBBLES,      CT_INVALID,   CT_COLA,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_BUBBLES,      CT_INVALID,   CT_COLA,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_BUBBLES,      CT_INVALID,   CT_COLA,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_BUBBLES,      CT_INVALID,   CT_COLA,       SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Bubble generator */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Toffee quarry */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 
 	/* Sugar mine */
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
-	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
+	MK(CT_INVALID,      CT_INVALID,   CT_INVALID,    SLOPE_STEEP,  INDUTILE_NOANIM,   INDUTILE_NOANIM,  false),
 };
 #undef MK
 
--- a/src/table/cargo_const.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/cargo_const.h	Mon Mar 19 12:38:16 2007 +0000
@@ -2,130 +2,130 @@
 
 /* Table of all default cargo types */
 
-#define MK(bt, label, c, e, f, g, h, fr, ks1, ks2, ks3, ks4, ks5, l, m) \
-          {bt, label, 0, c, c, e, f, {g, h}, fr, 0, 0, 0, ks1, ks2, ks3, ks4, ks5, l, m}
+#define MK(bt, label, c, e, f, g, h, fr, te, ks1, ks2, ks3, ks4, ks5, l, m) \
+          {bt, label, 0, c, c, e, f, {g, h}, fr, te, 0, 0, ks1, ks2, ks3, ks4, ks5, l, m}
 static const CargoSpec _default_cargo[] = {
-	MK(  0, 'PASS', 152,  1, 3185,  0,  24, false,
+	MK(  0, 'PASS', 152,  1, 3185,  0,  24, false, TE_PASSENGERS,
 		STR_000F_PASSENGERS,     STR_002F_PASSENGER,      STR_PASSENGERS, STR_QUANTITY_PASSENGERS,   STR_ABBREV_PASSENGERS,
 		SPR_CARGO_PASSENGER,     CC_PASSENGERS  ),
 
-	MK(  1, 'COAL',  32, 16, 5916,  7, 255, true,
+	MK(  1, 'COAL',  32, 16, 5916,  7, 255, true,  TE_NONE,
 		STR_0010_COAL,           STR_0030_COAL,           STR_TONS,       STR_QUANTITY_COAL,         STR_ABBREV_COAL,
 		SPR_CARGO_COAL,          CC_BULK        ),
 
-	MK(  2, 'MAIL',  15,  4, 4550, 20,  90, false,
+	MK(  2, 'MAIL',  15,  4, 4550, 20,  90, false, TE_MAIL,
 		STR_0011_MAIL,           STR_0031_MAIL,           STR_BAGS,       STR_QUANTITY_MAIL,         STR_ABBREV_MAIL,
 		SPR_CARGO_MAIL,          CC_MAIL        ),
 
-	MK(  3, 'OIL_', 174, 16, 4437, 25, 255, true,
+	MK(  3, 'OIL_', 174, 16, 4437, 25, 255, true,  TE_NONE,
 		STR_0012_OIL,            STR_0032_OIL,            STR_LITERS,     STR_QUANTITY_OIL,          STR_ABBREV_OIL,
 		SPR_CARGO_OIL,           CC_LIQUID      ),
 
-	MK(  4, 'LVST', 208,  3, 4322,  4,  18, true,
+	MK(  4, 'LVST', 208,  3, 4322,  4,  18, true,  TE_NONE,
 		STR_0013_LIVESTOCK,      STR_0033_LIVESTOCK,      STR_ITEMS,      STR_QUANTITY_LIVESTOCK,    STR_ABBREV_LIVESTOCK,
 		SPR_CARGO_LIVESTOCK,     CC_PIECE_GOODS ),
 
-	MK(  5, 'GOOD', 194,  8, 6144,  5,  28, true,
+	MK(  5, 'GOOD', 194,  8, 6144,  5,  28, true,  TE_GOODS,
 		STR_0014_GOODS,          STR_0034_GOODS,          STR_CRATES,     STR_QUANTITY_GOODS,        STR_ABBREV_GOODS,
 		SPR_CARGO_GOODS,         CC_EXPRESS     ),
 
-	MK(  6, 'GRAI', 191, 16, 4778,  4,  40, true,
+	MK(  6, 'GRAI', 191, 16, 4778,  4,  40, true,  TE_NONE,
 		STR_0015_GRAIN,          STR_0035_GRAIN,          STR_TONS,       STR_QUANTITY_GRAIN,        STR_ABBREV_GRAIN,
 		SPR_CARGO_GRAIN,         CC_BULK        ),
 
-	MK(  6, 'WHEA', 191, 16, 4778,  4,  40, true,
+	MK(  6, 'WHEA', 191, 16, 4778,  4,  40, true,  TE_NONE,
 		STR_0022_WHEAT,          STR_0042_WHEAT,          STR_TONS,       STR_QUANTITY_WHEAT,        STR_ABBREV_WHEAT,
 		SPR_CARGO_GRAIN,         CC_BULK        ),
 
-	MK(  6, 'MAIZ', 191,  6, 4778,  4,  40, true,
+	MK(  6, 'MAIZ', 191,  6, 4778,  4,  40, true,  TE_NONE,
 		STR_001B_MAIZE,          STR_003B_MAIZE,          STR_TONS,       STR_QUANTITY_MAIZE,        STR_ABBREV_MAIZE,
 		SPR_CARGO_GRAIN,         CC_BULK        ),
 
-	MK(  7, 'WOOD',  84, 16, 5005, 15, 255, true,
+	MK(  7, 'WOOD',  84, 16, 5005, 15, 255, true,  TE_NONE,
 		STR_0016_WOOD,           STR_0036_WOOD,           STR_TONS,       STR_QUANTITY_WOOD,         STR_ABBREV_WOOD,
 		SPR_CARGO_WOOD,          CC_PIECE_GOODS ),
 
-	MK(  8, 'IORE', 184, 16, 5120,  9, 255, true,
+	MK(  8, 'IORE', 184, 16, 5120,  9, 255, true,  TE_NONE,
 		STR_0017_IRON_ORE,       STR_0037_IRON_ORE,       STR_TONS,       STR_QUANTITY_IRON_ORE,     STR_ABBREV_IRON_ORE,
 		SPR_CARGO_IRON_ORE,      CC_BULK        ),
 
-	MK(  9, 'STEL',  10, 16, 5688,  7, 255, true,
+	MK(  9, 'STEL',  10, 16, 5688,  7, 255, true,  TE_NONE,
 		STR_0018_STEEL,          STR_0038_STEEL,          STR_TONS,       STR_QUANTITY_STEEL,        STR_ABBREV_STEEL,
 		SPR_CARGO_STEEL,         CC_PIECE_GOODS ),
 
-	MK( 10, 'VALU', 202,  2, 7509,  1,  32, true,
+	MK( 10, 'VALU', 202,  2, 7509,  1,  32, true,  TE_NONE,
 		STR_0019_VALUABLES,      STR_0039_VALUABLES,      STR_BAGS,       STR_QUANTITY_VALUABLES,    STR_ABBREV_VALUABLES,
 		SPR_CARGO_VALUES_GOLD,   CC_ARMOURED    ),
 
-	MK( 10, 'GOLD', 202,  8, 7509, 10,  40, true,
+	MK( 10, 'GOLD', 202,  8, 7509, 10,  40, true,  TE_NONE,
 		STR_0020_GOLD,           STR_0040_GOLD,           STR_BAGS,       STR_QUANTITY_GOLD,         STR_ABBREV_GOLD,
 		SPR_CARGO_VALUES_GOLD,   CC_ARMOURED    ),
 
-	MK( 10, 'DIAM', 202,  2, 7509, 10, 255, true,
+	MK( 10, 'DIAM', 202,  2, 7509, 10, 255, true,  TE_NONE,
 		STR_001D_DIAMONDS,       STR_003D_DIAMOND,        STR_BAGS,       STR_QUANTITY_DIAMONDS,     STR_ABBREV_DIAMONDS,
 		SPR_CARGO_DIAMONDS,      CC_ARMOURED    ),
 
-	MK( 11, 'PAPR',  10, 16, 5688,  7,  60, true,
+	MK( 11, 'PAPR',  10, 16, 5688,  7,  60, true,  TE_NONE,
 		STR_001F_PAPER,          STR_003F_PAPER,          STR_TONS,       STR_QUANTITY_PAPER,        STR_ABBREV_PAPER,
 		SPR_CARGO_PAPER,         CC_PIECE_GOODS ),
 
-	MK( 12, 'FOOD',  48, 16, 5688,  0,  30, true,
+	MK( 12, 'FOOD',  48, 16, 5688,  0,  30, true,  TE_FOOD,
 		STR_001E_FOOD,           STR_003E_FOOD,           STR_TONS,       STR_QUANTITY_FOOD,         STR_ABBREV_FOOD,
 		SPR_CARGO_FOOD,          CC_EXPRESS     | CC_REFRIGERATED),
 
-	MK( 13, 'FRUT', 208,  6, 4322,  0,  15, true,
+	MK( 13, 'FRUT', 208,  6, 4322,  0,  15, true,  TE_NONE,
 		STR_001C_FRUIT,          STR_003C_FRUIT,          STR_TONS,       STR_QUANTITY_FRUIT,        STR_ABBREV_FRUIT,
 		SPR_CARGO_FRUIT,         CC_BULK        | CC_REFRIGERATED),
 
-	MK( 14, 'CORE', 184,  6, 5120, 12, 255, true,
+	MK( 14, 'CORE', 184,  6, 5120, 12, 255, true,  TE_NONE,
 		STR_001A_COPPER_ORE,     STR_003A_COPPER_ORE,     STR_TONS,       STR_QUANTITY_COPPER_ORE,   STR_ABBREV_COPPER_ORE,
 		SPR_CARGO_COPPER_ORE,    CC_BULK        ),
 
-	MK( 15, 'WATR',  10,  6, 5688, 20,  80, true,
+	MK( 15, 'WATR',  10,  6, 5688, 20,  80, true,  TE_WATER,
 		STR_0021_WATER,          STR_0041_WATER,          STR_LITERS,     STR_QUANTITY_WATER,        STR_ABBREV_WATER,
 		SPR_CARGO_WATERCOLA,     CC_LIQUID      ),
 
-	MK( 16, 'RUBR',  32,  6, 5916,  2,  20, true,
+	MK( 16, 'RUBR',  32,  6, 5916,  2,  20, true,  TE_NONE,
 		STR_0023_RUBBER,         STR_0043_RUBBER,         STR_LITERS,     STR_QUANTITY_RUBBER,       STR_ABBREV_RUBBER,
 		SPR_CARGO_RUBBER,        CC_LIQUID      ),
 
-	MK( 17, 'SUGR',  32, 16, 5916, 20, 255, true,
+	MK( 17, 'SUGR',  32, 16, 5916, 20, 255, true,  TE_NONE,
 		STR_0024_SUGAR,          STR_0044_SUGAR,          STR_TONS,       STR_QUANTITY_SUGAR,        STR_ABBREV_SUGAR,
 		SPR_CARGO_SUGAR,         CC_BULK        ),
 
-	MK( 18, 'TOYS', 174,  2, 4437, 25, 255, true,
+	MK( 18, 'TOYS', 174,  2, 4437, 25, 255, true,  TE_NONE,
 		STR_0025_TOYS,           STR_0045_TOY,            STR_NOTHING,    STR_QUANTITY_TOYS,         STR_ABBREV_TOYS,
 		SPR_CARGO_TOYS,          CC_PIECE_GOODS ),
 
-	MK( 19, 'BATT', 208,  4, 4322,  2,  30, true,
+	MK( 19, 'BATT', 208,  4, 4322,  2,  30, true,  TE_NONE,
 		STR_002B_BATTERIES,      STR_004B_BATTERY,        STR_NOTHING,    STR_QUANTITY_BATTERIES,    STR_ABBREV_BATTERIES,
 		SPR_CARGO_BATTERIES,     CC_PIECE_GOODS ),
 
-	MK( 20, 'SWET', 194,  5, 6144,  8,  40, true,
+	MK( 20, 'SWET', 194,  5, 6144,  8,  40, true,  TE_GOODS,
 		STR_0026_CANDY,          STR_0046_CANDY,          STR_TONS,       STR_QUANTITY_SWEETS,       STR_ABBREV_SWEETS,
 		SPR_CARGO_CANDY,         CC_EXPRESS     ),
 
-	MK( 21, 'TOFF', 191, 16, 4778, 14,  60, true,
+	MK( 21, 'TOFF', 191, 16, 4778, 14,  60, true,  TE_NONE,
 		STR_002A_TOFFEE,         STR_004A_TOFFEE,         STR_TONS,       STR_QUANTITY_TOFFEE,       STR_ABBREV_TOFFEE,
 		SPR_CARGO_TOFFEE,        CC_BULK        ),
 
-	MK( 22, 'COLA',  84, 16, 5005,  5,  75, true,
+	MK( 22, 'COLA',  84, 16, 5005,  5,  75, true,  TE_NONE,
 		STR_0027_COLA,           STR_0047_COLA,           STR_LITERS,     STR_QUANTITY_COLA,         STR_ABBREV_COLA,
 		SPR_CARGO_WATERCOLA,     CC_LIQUID      ),
 
-	MK( 23, 'CTCD', 184, 16, 5120, 10,  25, true,
+	MK( 23, 'CTCD', 184, 16, 5120, 10,  25, true,  TE_NONE,
 		STR_0028_COTTON_CANDY,   STR_0048_COTTON_CANDY,   STR_TONS,       STR_QUANTITY_CANDYFLOSS,   STR_ABBREV_CANDYFLOSS,
 		SPR_CARGO_COTTONCANDY,   CC_BULK        ),
 
-	MK( 24, 'BUBL',  10,  1, 5688, 20,  80, true,
+	MK( 24, 'BUBL',  10,  1, 5688, 20,  80, true,  TE_NONE,
 		STR_0029_BUBBLES,        STR_0049_BUBBLE,         STR_NOTHING,    STR_QUANTITY_BUBBLES,      STR_ABBREV_BUBBLES,
 		SPR_CARGO_BUBBLES,       CC_PIECE_GOODS ),
 
-	MK( 25, 'PLST', 202, 16, 7509, 30, 255, true,
+	MK( 25, 'PLST', 202, 16, 7509, 30, 255, true,  TE_NONE,
 		STR_002C_PLASTIC,        STR_004C_PLASTIC,        STR_LITERS,     STR_QUANTITY_PLASTIC,      STR_ABBREV_PLASTIC,
 		SPR_CARGO_PLASTIC,       CC_LIQUID      ),
 
-	MK( 26, 'FZDR',  48,  2, 5688, 30,  50, true,
+	MK( 26, 'FZDR',  48,  2, 5688, 30,  50, true,  TE_FOOD,
 		STR_002D_FIZZY_DRINKS,   STR_004D_FIZZY_DRINK,    STR_NOTHING,    STR_QUANTITY_FIZZY_DRINKS, STR_ABBREV_FIZZY_DRINKS,
 		SPR_CARGO_FIZZYDRINK,    CC_PIECE_GOODS ),
 
--- a/src/table/elrail_data.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/elrail_data.h	Mon Mar 19 12:38:16 2007 +0000
@@ -7,23 +7,23 @@
 
 /** Tile Location group.
  * This defines whether the X and or Y coordinate of a tile is even */
-typedef enum TLG {
+enum TLG {
 	XEVEN_YEVEN = 0,
 	XEVEN_YODD  = 1,
 	XODD_YEVEN  = 2,
 	XODD_YODD   = 3,
 	TLG_END
-} TLG;
+};
 
 /** When determining the pylon configuration on the edge, two tiles are taken
  * into account: the tile being drawn itself (the home tile, the one in
  * ti->tile), and the neighbouring tile */
-typedef enum {
+enum TileSource {
 	TS_HOME      = 0,
 	TS_NEIGHBOUR = 1,
 
 	TS_END
-} TileSource;
+};
 
 enum {
 	NUM_TRACKS_AT_PCP = 6
@@ -253,7 +253,7 @@
 	SPR_PYLON_Y_SW
 };
 
-typedef struct {
+struct SortableSpriteStruct {
 	SpriteID image;
 	int8 x_offset;
 	int8 y_offset;
@@ -261,7 +261,7 @@
 	int8 y_size;
 	int8 z_size;
 	int8 z_offset;
-} SortableSpriteStruct;
+};
 
 enum {
 	/** Distance between wire and rail */
@@ -340,6 +340,14 @@
 	{ SPR_WIRE_DEPOT_NW,      8,  0,  1,  8,  1, ELRAIL_ELEVATION }  //! Wire for NW depot exit
 };
 
+static const SortableSpriteStruct CatenarySpriteData_Tunnel[] = {
+	{ SPR_WIRE_TUNNEL_NE,      0,  8,  8,  1,  1, ELRAIL_ELEVATION }, //! Wire for NE tunnel exit
+	{ SPR_WIRE_TUNNEL_SE,      8,  0,  1,  8,  1, ELRAIL_ELEVATION }, //! Wire for SE tunnel exit
+	{ SPR_WIRE_TUNNEL_SW,      0,  8,  8,  1,  1, ELRAIL_ELEVATION }, //! Wire for SW tunnel exit
+	{ SPR_WIRE_TUNNEL_NW,      8,  0,  1,  8,  1, ELRAIL_ELEVATION }  //! Wire for NW tunnel exit
+};
+
+
 /** Refers to a certain element of the catenary.
  * Identifiers for Wires:
  * <ol><li>Direction of the wire</li>
@@ -351,7 +359,7 @@
  * <li>Position of the Pylon relative to the track</li>
  * <li>Position of the Pylon inside the tile</li></ol>
  */
-typedef enum {
+enum CatenarySprite {
 	WIRE_X_FLAT_SW,
 	WIRE_X_FLAT_NE,
 	WIRE_X_FLAT_BOTH,
@@ -395,7 +403,7 @@
 	WIRE_EW_S_E,
 
 	INVALID_CATENARY = 0xFF
-} CatenarySprite;
+};
 
 /* Selects a Wire (with white and grey ends) depending on whether:
  * a) none (should never happen)
--- a/src/table/engines.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/engines.h	Mon Mar 19 12:38:16 2007 +0000
@@ -553,9 +553,9 @@
 	AVI(  4, 26, 210, J, SND_09_JET,                     40,  74, 20, 220 ), /* 21 */
 	AVI(  6, 16, 125, P, SND_09_JET,                     50,  74, 10,  80 ), /* 22 */
 	AVI(  2, 17, 145, P, SND_09_JET,                     40,  74, 10,  85 ), /* 23 */
-	AVI( 11, 16, 130, J, SND_09_JET,                     40,  74, 10,  75 ), /* 24 */
-	AVI( 10, 16, 149, J, SND_09_JET,                     40,  74, 10,  85 ), /* 25 */
-	AVI( 15, 17, 170, J, SND_09_JET,                     40,  74, 18,  65 ), /* 26 */
+	AVI( 11, 16, 130, P, SND_09_JET,                     40,  74, 10,  75 ), /* 24 */
+	AVI( 10, 16, 149, P, SND_09_JET,                     40,  74, 10,  85 ), /* 25 */
+	AVI( 15, 17, 170, P, SND_09_JET,                     40,  74, 18,  65 ), /* 26 */
 	AVI( 12, 18, 210, J, SND_09_JET,                     40,  74, 25, 110 ), /* 27 */
 	AVI( 13, 20, 230, J, SND_09_JET,                     40,  74, 60, 180 ), /* 28 */
 	AVI( 14, 21, 220, J, SND_09_JET,                     40,  74, 65, 150 ), /* 29 */
--- a/src/table/industry_land.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/industry_land.h	Mon Mar 19 12:38:16 2007 +0000
@@ -1,17 +1,19 @@
 /* $Id$ */
 
-typedef struct DrawIndustrySpec1Struct {
+/** @file industry_land.h */
+
+struct DrawIndustrySpec1Struct {
 	byte x;
 	byte image_1;
 	byte image_2;
 	byte image_3;
-} DrawIndustrySpec1Struct;
+};
 
-typedef struct DrawIndustrySpec4Struct {
+struct DrawIndustrySpec4Struct {
 	byte image_1;
 	byte image_2;
 	byte image_3;
-} DrawIndustrySpec4Struct;
+};
 
 #define M(s1, p1, s2, p2, sx, sy, w, h, dz, p) { { s1, p1 }, { s2, p2 }, sx, sy, w - 1, h - 1, dz, p }
 
@@ -718,6 +720,7 @@
 	M(     0xf8d, PAL_NONE,     0x12a5 | (1 << PALETTE_MODIFIER_COLOR), PAL_NONE,  0,  0, 16, 16,  50, 1),
 };
 
+/* this is ONLY used for Sugar Mine*/
 static const DrawIndustrySpec1Struct _draw_industry_spec1[96] = {
 	{  8,   4,   0,   0},
 	{  6,   0,   1,   0},
@@ -817,14 +820,17 @@
 	{ 10,   4,   0,   4},
 };
 
+/* this is ONLY used for Sugar Mine*/
 static const byte _drawtile_proc1_x[5] = {
 	22, 17, 14, 10, 8
 };
 
+/* this is ONLY used for Sugar Mine*/
 static const byte _drawtile_proc1_y[5] = {
 	73, 70, 69, 66, 41
 };
 
+/* this is ONLY used for Toy Factory*/
 static const DrawIndustrySpec4Struct _industry_anim_offs_3[] = {
 	{255, 255,   0},
 	{  0, 255,   0},
@@ -878,6 +884,7 @@
 	{255, 255,   0},
 };
 
+/* this is ONLY used for Toffee Quarry*/
 static const byte _industry_anim_offs[] = {
 	255,   0,   0,   0,   2,   4,   6,   8,  10,   9,
 	  7,   5,   3,   1, 255,   0,   0,   0,   2,   4,
@@ -888,6 +895,7 @@
 	  2,   4,   6,   8,  10,   9,   7,   5,   3,   1
 };
 
+/* this is ONLY used for the Bubble Generator*/
 static const byte _industry_anim_offs_2[] = {
 	68, 69, 71, 74, 77, 80, 83, 85, 86, 86,
 	86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
@@ -895,100 +903,6 @@
 	77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
 };
 
+/* those are ONLY used for Power Station*/
 static const byte _coal_plant_sparks_x[] = {11, 11, 14, 13, 18, 15};
 static const byte _coal_plant_sparks_y[] = {23, 11,  6,  3,  1,  0};
-
-#define N 255
-/**
- * Next frame in an animation
- * The indices into this table are the ones as described by
- * the enum with GFX_*s in industry_map.h.
- */
-static const byte _industry_section_animation_next[NUM_INDUSTRY_GFXES] = {
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   16,  N,   N,   N,   N,   N,   N, // <- growing forest
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   129, N,   N,   N,   N,   N, // <- growing candyfloss
-135, N,   N,   N,   N,   N,   N,   N, // <- 'growing' batteries
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,
-};
-
-/**
- * Animation to start when goods is produced
- * The indices into this table are the ones as described by
- * the enum with GFX_*s in industry_map.h.
- */
-static const byte _industry_produce_section[NUM_INDUSTRY_GFXES] = {
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-17,  N,   N,   N,   N,   N,   N,   N, // <- chopping forest
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   130, N,   N,   N,   N,   N,   136,  // <- chopping candyfloss and reaping batteries
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,   N,
-N,   N,   N,   N,   N,   N,   N,
-};
-
-#undef N
-
-
-/**
- * When true, the tile has to be drawn using the animation
- * state instead of the construction state.
- * The indices into this table are the ones as described by
- * the enum with GFX_*s in industry_map.h.
- */
-static const bool _industry_section_draw_animation_state[NUM_INDUSTRY_GFXES] = {
-	false, true,  false, false, false, false, false, false, // <- animated wheel tower of coal mine
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, true,  true,  // <- animated oil well
-	true,  false, false, false, false, false, false, false, // <- animated oil well
-	false, false, false, false, false, false, false, false,
-	true,  false, false, false, false, false, false, false, // <- animated wheel tower of copper mine
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	true,  false, false, false, false, false, false, false, // <- animated wheel tower of gold mine
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false, false,
-	false, false, false, false, false, false, false,
-};
--- a/src/table/namegen.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/namegen.h	Mon Mar 19 12:38:16 2007 +0000
@@ -1690,7 +1690,7 @@
  * with cloning this for your own language. */
 
 // Sing., pl.
-typedef enum CzechGender {
+enum CzechGender {
 	CZG_SMASC,
 	CZG_SFEM,
 	CZG_SNEUT,
@@ -1701,12 +1701,14 @@
 	CZG_FREE,
 	// Like CZG_FREE, but disallow CZG_SNEUT.
 	CZG_NFREE
-} CzechGender;
-typedef enum CzechPattern {
+};
+
+enum CzechPattern {
 	CZP_JARNI,
 	CZP_MLADY,
 	CZP_PRIVL
-} CzechPattern;
+};
+
 /* [CzechGender][CzechPattern] - replaces the last character of the adjective
  * by this. */
 // XXX: [CZG_SMASC][CZP_PRIVL] needs special handling: -ovX -> -uv.
@@ -1721,38 +1723,38 @@
 
 // This way the substantives can choose only some adjectives/endings:
 // At least one of these flags must be satisfied:
-typedef enum CzechAllow {
+enum CzechAllow {
 	CZA_SHORT = 1,
 	CZA_MIDDLE = 2,
 	CZA_LONG = 4,
 	CZA_ALL = ~0
-} CzechAllow;
+};
 
 DECLARE_ENUM_AS_BIT_SET(CzechAllow);
 
 // All these flags must be satisfied (in the stem->others direction):
-typedef enum CzechChoose {
+enum CzechChoose {
 	CZC_NONE = 0, // No requirements.
 	CZC_COLOR = 1,
 	CZC_POSTFIX = 2, // Matched if postfix was inserted.
 	CZC_NOPOSTFIX = 4, // Matched if no postfix was inserted.
 	CZC_ANY = ~0
-} CzechChoose;
+};
 
 DECLARE_ENUM_AS_BIT_SET(CzechChoose);
 
-typedef struct CzechNameSubst {
+struct CzechNameSubst {
 	CzechGender gender;
 	CzechAllow allow;
 	CzechChoose choose;
 	const char *name;
-} CzechNameSubst;
+};
 
-typedef struct CzechNameAdj {
+struct CzechNameAdj {
 	CzechPattern pattern;
 	CzechChoose choose;
 	const char *name;
-} CzechNameAdj;
+};
 
 // Some of items which should be common are doubled.
 static const CzechNameAdj name_czech_adj[] = {
--- a/src/table/palettes.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/palettes.h	Mon Mar 19 12:38:16 2007 +0000
@@ -141,7 +141,7 @@
 
 #define GET_PALETTE(x) _palettes[x]
 
-typedef struct {
+struct ExtraPaletteValues {
 	Colour a[15];  // dark blue water
 	Colour ac[15]; // dark blue water Toyland
 	Colour lighthouse[12]; // lighthouse & stadium
@@ -149,7 +149,7 @@
 	Colour e[15];  // ???
 	Colour b[45];  // glittery water
 	Colour bc[45]; // glittery water Toyland
-} ExtraPaletteValues;
+};
 
 static const ExtraPaletteValues _extra_palette_values = {
 	{ M( 32,  68, 112), M( 36,  72, 116), M( 40,  76, 120), M( 44,  80, 124),
@@ -173,10 +173,10 @@
 #undef M
 
 // Color table for colors in lang files (e.g. {BLACK})
-typedef struct StringColor {
+struct StringColor {
 	byte text;
 	byte shadow;
-} StringColor;
+};
 
 static const StringColor _string_colormap[] = {
 	{ 150, 215 }, // BLUE
--- a/src/table/sprites.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/sprites.h	Mon Mar 19 12:38:16 2007 +0000
@@ -291,6 +291,12 @@
 	SPR_WIRE_Y_NW_DOWN = SPR_ELRAIL_BASE + 26,
 
 	/* Tunnel entries */
+	SPR_WIRE_TUNNEL_NE = SPR_ELRAIL_BASE + 27,
+	SPR_WIRE_TUNNEL_SE = SPR_ELRAIL_BASE + 28,
+	SPR_WIRE_TUNNEL_SW = SPR_ELRAIL_BASE + 29,
+	SPR_WIRE_TUNNEL_NW = SPR_ELRAIL_BASE + 30,
+
+	/* Depot entries */
 	SPR_WIRE_DEPOT_SW = SPR_ELRAIL_BASE + 27,
 	SPR_WIRE_DEPOT_NW = SPR_ELRAIL_BASE + 28,
 	SPR_WIRE_DEPOT_NE = SPR_ELRAIL_BASE + 29,
@@ -1191,7 +1197,7 @@
 };
 
 /** Cursor sprite numbers */
-typedef enum CursorSprites {
+enum CursorSprite {
 	/* Terraform */
 	/* Cursors */
 	SPR_CURSOR_MOUSE          = 0,
@@ -1278,7 +1284,7 @@
 	SPR_CURSOR_CLONE_ROADVEH  = SPR_OPENTTD_BASE + 110,
 	SPR_CURSOR_CLONE_SHIP     = SPR_OPENTTD_BASE + 112,
 	SPR_CURSOR_CLONE_AIRPLANE = SPR_OPENTTD_BASE + 114,
-} CursorSprite;
+};
 
 /// Animation macro in table/animcursors.h (_animcursors[])
 enum AnimCursors {
--- a/src/table/town_land.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/town_land.h	Mon Mar 19 12:38:16 2007 +0000
@@ -2017,9 +2017,9 @@
 assert_compile(lengthof(_housetype_remove_ratingmod) == HOUSE_MAX);
 
 
-typedef struct {
+struct HousetypeYear {
 	Year min, max;
-} HousetypeYear;
+};
 
 static const HousetypeYear _housetype_years[] = {
 	{ 1963, MAX_YEAR },
--- a/src/table/tree_land.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/tree_land.h	Mon Mar 19 12:38:16 2007 +0000
@@ -13,10 +13,10 @@
 static const byte _tree_base_by_landscape[4] = {0, 12, 20, 32};
 static const byte _tree_count_by_landscape[4] = {12, 8, 12, 9};
 
-typedef struct TreePos {
+struct TreePos {
 	uint8 x;
 	uint8 y;
-} TreePos;
+};
 
 static const TreePos _tree_layout_xy[][4] = {
 	{ { 9, 3 }, { 1, 8 }, { 0, 0 }, { 8, 9 } },
--- a/src/table/unicode.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/unicode.h	Mon Mar 19 12:38:16 2007 +0000
@@ -1,10 +1,10 @@
 /* $Id$ */
 
 
-typedef struct DefaultUnicodeMapping {
+struct DefaultUnicodeMapping {
 	WChar code; ///< Unicode value
 	byte key;   ///< Character index of sprite
-} DefaultUnicodeMapping;
+};
 
 
 /* Default unicode mapping table for sprite based glyphs.
--- a/src/table/unmovable_land.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/unmovable_land.h	Mon Mar 19 12:38:16 2007 +0000
@@ -1,6 +1,6 @@
 /* $Id$ */
 
-typedef struct DrawTileUnmovableStruct {
+struct DrawTileUnmovableStruct {
 	uint16 image;
 	byte subcoord_x;
 	byte subcoord_y;
@@ -8,7 +8,7 @@
 	byte height;
 	byte z_size;
 	byte unused;
-} DrawTileUnmovableStruct;
+};
 
 #define TILE_SEQ_END() { (byte)0x80, 0, 0, 0, 0, 0, 0, 0 }
 
--- a/src/table/water_land.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/table/water_land.h	Mon Mar 19 12:38:16 2007 +0000
@@ -1,6 +1,6 @@
 /* $Id$ */
 
-typedef struct WaterDrawTileStruct {
+struct WaterDrawTileStruct {
 	byte delta_x;
 	byte delta_y;
 	byte delta_z;
@@ -8,7 +8,7 @@
 	byte height;
 	byte unk;
 	SpriteID image;
-} WaterDrawTileStruct;
+};
 
 #define BEGIN(image) { 0, 0, 0, 0, 0, 0, image }
 #define END(y) { 0x80, y, 0, 0, 0, 0, 0 }
--- a/src/texteff.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/texteff.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -23,7 +23,7 @@
 	MAX_ANIMATED_TILES     = 256,
 };
 
-typedef struct TextEffect {
+struct TextEffect {
 	StringID string_id;
 	int32 x;
 	int32 y;
@@ -32,14 +32,14 @@
 	uint16 duration;
 	uint32 params_1;
 	uint32 params_2;
-} TextEffect;
+};
 
 
-typedef struct TextMessage {
+struct TextMessage {
 	char message[MAX_TEXTMESSAGE_LENGTH];
 	uint16 color;
 	Date end_date;
-} TextMessage;
+};
 
 static TextEffect _text_effect_list[MAX_TEXT_MESSAGES];
 static TextMessage _textmsg_list[MAX_CHAT_MESSAGES];
@@ -55,7 +55,7 @@
 
 extern void memcpy_pitch(void *dst, void *src, int w, int h, int srcpitch, int dstpitch);
 
-static inline uint GetTextMessageCount(void)
+static inline uint GetTextMessageCount()
 {
 	uint i;
 
@@ -112,7 +112,7 @@
 	_textmessage_dirty = true;
 }
 
-void InitTextMessage(void)
+void InitTextMessage()
 {
 	uint i;
 
@@ -122,7 +122,7 @@
 }
 
 /* Hide the textbox */
-void UndrawTextMessage(void)
+void UndrawTextMessage()
 {
 	if (_textmessage_visible) {
 		/* Sometimes we also need to hide the cursor
@@ -160,7 +160,7 @@
 }
 
 /* Check if a message is expired every day */
-void TextMessageDailyLoop(void)
+void TextMessageDailyLoop()
 {
 	uint i;
 
@@ -184,7 +184,7 @@
 }
 
 /* Draw the textmessage-box */
-void DrawTextMessage(void)
+void DrawTextMessage()
 {
 	uint y, count;
 
@@ -277,7 +277,7 @@
 	MarkTextEffectAreaDirty(te);
 }
 
-void MoveAllTextEffects(void)
+void MoveAllTextEffects()
 {
 	TextEffect *te;
 
@@ -286,7 +286,7 @@
 	}
 }
 
-void InitTextEffects(void)
+void InitTextEffects()
 {
 	TextEffect *te;
 
@@ -357,7 +357,7 @@
 	return false;
 }
 
-void AnimateAnimatedTiles(void)
+void AnimateAnimatedTiles()
 {
 	const TileIndex* ti;
 
@@ -366,12 +366,12 @@
 	}
 }
 
-void InitializeAnimatedTiles(void)
+void InitializeAnimatedTiles()
 {
 	memset(_animated_tile_list, 0, sizeof(_animated_tile_list));
 }
 
-static void SaveLoad_ANIT(void)
+static void SaveLoad_ANIT()
 {
 	/* In pre version 6, we has 16bit per tile, now we have 32bit per tile, convert it ;) */
 	if (CheckSavegameVersion(6)) {
--- a/src/tgp.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/tgp.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -165,14 +165,14 @@
 static const int amplitude_decimal_bits = 10;
 
 /** Height map - allocated array of heights (MapSizeX() + 1) x (MapSizeY() + 1) */
-typedef struct HeightMap
+struct HeightMap
 {
 	height_t *h;         //! array of heights
 	uint     dim_x;      //! height map size_x MapSizeX() + 1
 	uint     total_size; //! height map total size
 	uint     size_x;     //! MapSizeX()
 	uint     size_y;     //! MapSizeY()
-} HeightMap;
+};
 
 /** Global height map instance */
 static HeightMap _height_map = {NULL, 0, 0, 0, 0};
@@ -229,7 +229,7 @@
 
 
 /** Allocate array of (MapSizeX()+1)*(MapSizeY()+1) heights and init the _height_map structure members */
-static inline bool AllocHeightMap(void)
+static inline bool AllocHeightMap()
 {
 	height_t *h;
 
@@ -249,7 +249,7 @@
 }
 
 /** Free height map */
-static inline void FreeHeightMap(void)
+static inline void FreeHeightMap()
 {
 	if (_height_map.h == NULL) return;
 	free(_height_map.h);
@@ -321,7 +321,7 @@
 }
 
 /** Base Perlin noise generator - fills height map with raw Perlin noise */
-static void HeightMapGenerate(void)
+static void HeightMapGenerate()
 {
 	uint size_min = min(_height_map.size_x, _height_map.size_y);
 	uint iteration_round = 0;
@@ -524,7 +524,7 @@
  * Please note that all the small numbers; 53, 101, 167, etc. are small primes
  * to help give the perlin noise a bit more of a random feel.
  */
-static void HeightMapCoastLines(void)
+static void HeightMapCoastLines()
 {
 	int smallest_size = min(_patches.map_x, _patches.map_y);
 	const int margin = 4;
@@ -610,7 +610,7 @@
 }
 
 /** Smooth coasts by modulating height of tiles close to map edges with cosine of distance from edge */
-static void HeightMapSmoothCoasts(void)
+static void HeightMapSmoothCoasts()
 {
 	uint x, y;
 	/* First Smooth NW and SE coasts (y close to 0 and y close to size_y) */
@@ -654,7 +654,7 @@
  *  - coast Smoothing
  *  - slope Smoothing
  *  - height histogram redistribution by sine wave transform */
-static void HeightMapNormalize(void)
+static void HeightMapNormalize()
 {
 	const amplitude_t water_percent = _water_percent[_opt.diff.quantity_sea_lakes];
 	const height_t h_max_new = I2H(_max_height[_opt.diff.terrain_type]);
@@ -793,7 +793,7 @@
  * areas wont be high enough, and there will be very little tropic on the map.
  * Thus Tropic works best on Hilly or Mountainous.
  */
-void GenerateTerrainPerlin(void)
+void GenerateTerrainPerlin()
 {
 	uint x, y;
 
--- a/src/tgp.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/tgp.h	Mon Mar 19 12:38:16 2007 +0000
@@ -3,6 +3,6 @@
 #ifndef TGP_H
 #define TGP_H
 
-void GenerateTerrainPerlin(void);
+void GenerateTerrainPerlin();
 
 #endif /* TGP_H */
--- a/src/thread.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/thread.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -8,7 +8,7 @@
 #if defined(__AMIGA__) || defined(__MORPHOS__) || defined(PSP) || defined(NO_THREADS)
 OTTDThread *OTTDCreateThread(OTTDThreadFunc function, void *arg) { return NULL; }
 void *OTTDJoinThread(OTTDThread *t) { return NULL; }
-void OTTDExitThread(void) { NOT_REACHED(); };
+void OTTDExitThread() { NOT_REACHED(); };
 
 #elif defined(__OS2__)
 
@@ -58,7 +58,7 @@
 	return ret;
 }
 
-void OTTDExitThread(void)
+void OTTDExitThread()
 {
 	_endthread();
 }
@@ -96,7 +96,7 @@
 	return ret;
 }
 
-void OTTDExitThread(void)
+void OTTDExitThread()
 {
 	pthread_exit(NULL);
 }
@@ -151,7 +151,7 @@
 	return ret;
 }
 
-void OTTDExitThread(void)
+void OTTDExitThread()
 {
 	ExitThread(0);
 }
--- a/src/thread.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/thread.h	Mon Mar 19 12:38:16 2007 +0000
@@ -3,12 +3,12 @@
 #ifndef THREAD_H
 #define THREAD_H
 
-typedef struct OTTDThread OTTDThread;
+struct OTTDThread;
 
 typedef void* (*OTTDThreadFunc)(void*);
 
 OTTDThread* OTTDCreateThread(OTTDThreadFunc, void*);
 void*       OTTDJoinThread(OTTDThread*);
-void        OTTDExitThread(void);
+void        OTTDExitThread();
 
 #endif /* THREAD_H */
--- a/src/tile.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/tile.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,7 +8,7 @@
 #include "map.h"
 #include "slope.h"
 
-typedef enum TileTypes {
+enum TileType {
 	MP_CLEAR,
 	MP_RAILWAY,
 	MP_STREET,
@@ -20,13 +20,13 @@
 	MP_INDUSTRY,
 	MP_TUNNELBRIDGE,
 	MP_UNMOVABLE,
-} TileType;
+};
 
-typedef enum TropicZones {
+enum TropicZone {
 	TROPICZONE_INVALID    = 0,
 	TROPICZONE_DESERT     = 1,
 	TROPICZONE_RAINFOREST = 2,
-} TropicZone;
+};
 
 Slope GetTileSlope(TileIndex tile, uint *h);
 uint GetTileZ(TileIndex tile);
--- a/src/town.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/town.h	Mon Mar 19 12:38:16 2007 +0000
@@ -138,10 +138,10 @@
 	}
 };
 
-uint32 GetWorldPopulation(void);
+uint32 GetWorldPopulation();
 
 void UpdateTownVirtCoord(Town *t);
-void InitializeTown(void);
+void InitializeTown();
 void ShowTownViewWindow(TownID town);
 void ExpandTown(Town *t);
 Town *CreateRandomTown(uint attempts, uint size_mode);
@@ -231,7 +231,7 @@
 
 VARDEF uint _total_towns;
 
-static inline TownID GetMaxTownIndex(void)
+static inline TownID GetMaxTownIndex()
 {
 	/* TODO - This isn't the real content of the function, but
 	 *  with the new pool-system this will be replaced with one that
@@ -241,7 +241,7 @@
 	return GetTownPoolSize() - 1;
 }
 
-static inline uint GetNumTowns(void)
+static inline uint GetNumTowns()
 {
 	return _total_towns;
 }
@@ -249,7 +249,7 @@
 /**
  * Return a random valid town.
  */
-static inline Town *GetRandomTown(void)
+static inline Town *GetRandomTown()
 {
 	int num = RandomRange(GetNumTowns());
 	TownID index = INVALID_TOWN;
--- a/src/town_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/town_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -252,7 +252,7 @@
 	if (_town_sort_order & 2) _town_sort_dirty = true;
 }
 
-uint32 GetWorldPopulation(void)
+uint32 GetWorldPopulation()
 {
 	uint32 pop;
 	const Town* t;
@@ -437,7 +437,7 @@
 	UpdateTownRadius(t);
 }
 
-void OnTick_Town(void)
+void OnTick_Town()
 {
 	if (_game_mode == GM_EDITOR) return;
 
@@ -755,7 +755,7 @@
 // Generate a random road block
 // The probability of a straight road
 // is somewhat higher than a curved.
-static RoadBits GenRandomRoadBits(void)
+static RoadBits GenRandomRoadBits()
 {
 	uint32 r = Random();
 	uint a = GB(r, 0, 2);
@@ -998,7 +998,7 @@
 	UpdateTownMaxPass(t);
 }
 
-static Town *AllocateTown(void)
+static Town *AllocateTown()
 {
 	Town *t;
 
@@ -1101,7 +1101,7 @@
 
 static const byte _num_initial_towns[3] = {11, 23, 46};
 
-bool GenerateTowns(void)
+bool GenerateTowns()
 {
 	uint num = 0;
 	uint n = ScaleByMapSize(_num_initial_towns[_opt.diff.number_towns] + (Random() & 7));
@@ -1477,7 +1477,7 @@
 		NEWS_FLAGS(NM_NORMAL, NF_TILE, NT_GENERAL, 0), t->xy, 0);
 }
 
-static bool DoBuildStatueOfCompany(TileIndex tile)
+static bool DoBuildStatueOfCompany(TileIndex tile, TownID town_id)
 {
 	PlayerID old;
 	int32 r;
@@ -1497,7 +1497,7 @@
 
 	if (CmdFailed(r)) return false;
 
-	MakeStatue(tile, _current_player);
+	MakeStatue(tile, _current_player, town_id);
 	MarkTileDirtyByTile(tile);
 
 	return true;
@@ -1505,12 +1505,12 @@
 
 /**
  * Search callback function for TownActionBuildStatue
- * @param data that is passed by the caller.  In this case, nothing
+ * @param town_id The town_id for which we want a statue
  * @return the result of the test
  */
-static bool SearchTileForStatue(TileIndex tile, uint32 data)
+static bool SearchTileForStatue(TileIndex tile, uint32 town_id)
 {
-	return DoBuildStatueOfCompany(tile);
+	return DoBuildStatueOfCompany(tile, town_id);
 }
 
 /**
@@ -1522,7 +1522,7 @@
 {
 	TileIndex tile = t->xy;
 
-	if (CircularTileSearch(tile, 9, SearchTileForStatue, 0))
+	if (CircularTileSearch(tile, 9, SearchTileForStatue, t->index))
 		SETBIT(t->statues, _current_player); ///< Once found and built, "inform" the Town
 }
 
@@ -1819,7 +1819,7 @@
 	return true;
 }
 
-void TownsMonthlyLoop(void)
+void TownsMonthlyLoop()
 {
 	Town *t;
 
@@ -1836,7 +1836,7 @@
 	}
 }
 
-void InitializeTowns(void)
+void InitializeTowns()
 {
 	Subsidy *s;
 
@@ -1935,7 +1935,7 @@
 	SLE_END()
 };
 
-static void Save_TOWN(void)
+static void Save_TOWN()
 {
 	Town *t;
 
@@ -1945,7 +1945,7 @@
 	}
 }
 
-static void Load_TOWN(void)
+static void Load_TOWN()
 {
 	int index;
 
@@ -1969,7 +1969,7 @@
 		_cur_town_ctr = 0;
 }
 
-void AfterLoadTown(void)
+void AfterLoadTown()
 {
 	Town *t;
 	FOR_ALL_TOWNS(t) {
--- a/src/town_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/town_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -432,7 +432,7 @@
 	return r;
 }
 
-static void MakeSortedTownList(void)
+static void MakeSortedTownList()
 {
 	const Town* t;
 	int (*townsortproc[])(const void *a, const void *b) = {
@@ -543,7 +543,7 @@
 };
 
 
-void ShowTownDirectory(void)
+void ShowTownDirectory()
 {
 	Window *w = AllocateWindowDescFront(&_town_directory_desc, 0);
 
--- a/src/train.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/train.h	Mon Mar 19 12:38:16 2007 +0000
@@ -13,14 +13,14 @@
  * This is an enum to tell what bit to access as it is a bitmask
  */
 
-typedef enum TrainSubtypes {
+enum TrainSubtype {
 	Train_Front             = 0, // Leading engine of a train
 	Train_Articulated_Part  = 1, // Articulated part of an engine
 	Train_Wagon             = 2, // Wagon
 	Train_Engine            = 3, // Engine, that can be front engines, but might be placed behind another engine
 	Train_Free_Wagon        = 4, // First in a wagon chain (in depot)
 	Train_Multiheaded       = 5, // Engine is a multiheaded
-} TrainSubtype;
+};
 
 
 /** Check if a vehicle is front engine
@@ -215,8 +215,8 @@
 	return v->next;
 }
 
-void ConvertOldMultiheadToNew(void);
-void ConnectMultiheadedTrains(void);
+void ConvertOldMultiheadToNew();
+void ConnectMultiheadedTrains();
 uint CountArticulatedParts(EngineID engine_type);
 
 int CheckTrainInDepot(const Vehicle *v, bool needs_to_be_stopped);
--- a/src/train_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/train_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -140,7 +140,7 @@
 {
 	uint16 max_speed = 0xFFFF;
 
-	assert(v->type == VEH_Train);
+	assert(v->type == VEH_TRAIN);
 	assert(IsFrontEngine(v) || IsFreeWagon(v));
 
 	const RailVehicleInfo *rvi_v = RailVehInfo(v->engine_type);
@@ -262,7 +262,7 @@
 	const Order* o = &v->current_order;
 	StationID sid = GetStationIndex(tile);
 
-	assert(v->type == VEH_Train);
+	assert(v->type == VEH_TRAIN);
 	//When does a train drive through a station
 	//first we deal with the "new nonstop handling"
 	if (_patches.new_nonstop && o->flags & OF_NON_STOP && sid == o->dest) {
@@ -545,7 +545,7 @@
 		u->max_age = 0;
 		u->engine_type = engine_type;
 		u->value = 0;
-		u->type = VEH_Train;
+		u->type = VEH_TRAIN;
 		u->subtype = 0;
 		SetArticulatedPart(u);
 		u->cur_image = 0xAC2;
@@ -580,7 +580,7 @@
 
 			Vehicle *w;
 			FOR_ALL_VEHICLES(w) {
-				if (w->type == VEH_Train && w->tile == tile &&
+				if (w->type == VEH_TRAIN && w->tile == tile &&
 				    IsFreeWagon(w) && w->engine_type == engine) {
 					u = GetLastVehicleInChain(w);
 					break;
@@ -623,7 +623,7 @@
 			v->u.rail.railtype = rvi->railtype;
 
 			v->build_year = _cur_year;
-			v->type = VEH_Train;
+			v->type = VEH_TRAIN;
 			v->cur_image = 0xAC2;
 			v->random_bits = VehicleRandomBits();
 
@@ -636,7 +636,7 @@
 
 			InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
 			if (IsLocalPlayer()) {
-				InvalidateAutoreplaceWindow(VEH_Train); // updates the replace Train window
+				InvalidateAutoreplaceWindow(VEH_TRAIN); // updates the replace Train window
 			}
 			GetPlayer(_current_player)->num_engines[engine]++;
 		}
@@ -651,7 +651,7 @@
 	const Vehicle* v;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Train && IsFreeWagon(v) &&
+		if (v->type == VEH_TRAIN && IsFreeWagon(v) &&
 				v->tile == u->tile &&
 				v->u.rail.track == TRACK_BIT_DEPOT) {
 			if (CmdFailed(DoCommand(0, v->index | (u->index << 16), 1, DC_EXEC,
@@ -689,7 +689,7 @@
 	u->build_year = v->build_year;
 	if (building) v->value >>= 1;
 	u->value = v->value;
-	u->type = VEH_Train;
+	u->type = VEH_TRAIN;
 	u->cur_image = 0xAC2;
 	u->random_bits = VehicleRandomBits();
 	VehiclePositionChanged(u);
@@ -704,7 +704,7 @@
 int32 CmdBuildRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
 	/* Check if the engine-type is valid (for the player) */
-	if (!IsEngineBuildable(p1, VEH_Train, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
+	if (!IsEngineBuildable(p1, VEH_TRAIN, _current_player)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE);
 
 	/* Check if the train is actually being built in a depot belonging
 	 * to the player. Doesn't matter if only the cost is queried */
@@ -739,7 +739,7 @@
 
 		Vehicle *v = vl[0];
 
-		UnitID unit_num = HASBIT(p2, 0) ? 0 : GetFreeUnitNumber(VEH_Train);
+		UnitID unit_num = HASBIT(p2, 0) ? 0 : GetFreeUnitNumber(VEH_TRAIN);
 		if (unit_num > _patches.max_trains)
 			return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 
@@ -781,7 +781,7 @@
 			v->service_interval = _patches.servint_trains;
 			v->date_of_last_service = _date;
 			v->build_year = _cur_year;
-			v->type = VEH_Train;
+			v->type = VEH_TRAIN;
 			v->cur_image = 0xAC2;
 			v->random_bits = VehicleRandomBits();
 
@@ -818,7 +818,7 @@
 			RebuildVehicleLists();
 			InvalidateWindow(WC_COMPANY, v->owner);
 			if (IsLocalPlayer())
-				InvalidateAutoreplaceWindow(VEH_Train); // updates the replace Train window
+				InvalidateAutoreplaceWindow(VEH_TRAIN); // updates the replace Train window
 
 			GetPlayer(_current_player)->num_engines[p1]++;
 		}
@@ -897,7 +897,7 @@
 	TileIndex tile = src->tile;
 
 	FOR_ALL_VEHICLES(dst) {
-		if (dst->type == VEH_Train && IsFreeWagon(dst) && dst->tile == tile) {
+		if (dst->type == VEH_TRAIN && IsFreeWagon(dst) && dst->tile == tile) {
 			// check so all vehicles in the line have the same engine.
 			Vehicle *v = dst;
 
@@ -964,7 +964,7 @@
 
 	Vehicle *src = GetVehicle(s);
 
-	if (src->type != VEH_Train || !CheckOwnership(src->owner)) return CMD_ERROR;
+	if (src->type != VEH_TRAIN || !CheckOwnership(src->owner)) return CMD_ERROR;
 
 	// if nothing is selected as destination, try and find a matching vehicle to drag to.
 	Vehicle *dst;
@@ -973,7 +973,7 @@
 	} else {
 		if (!IsValidVehicleID(d)) return CMD_ERROR;
 		dst = GetVehicle(d);
-		if (dst->type != VEH_Train || !CheckOwnership(dst->owner)) return CMD_ERROR;
+		if (dst->type != VEH_TRAIN || !CheckOwnership(dst->owner)) return CMD_ERROR;
 	}
 
 	// if an articulated part is being handled, deal with its parent vehicle
@@ -1078,7 +1078,7 @@
 
 	// moving a loco to a new line?, then we need to assign a unitnumber.
 	if (dst == NULL && !IsFrontEngine(src) && IsTrainEngine(src)) {
-		UnitID unit_num = GetFreeUnitNumber(VEH_Train);
+		UnitID unit_num = GetFreeUnitNumber(VEH_TRAIN);
 		if (unit_num > _patches.max_trains)
 			return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 
@@ -1242,7 +1242,7 @@
 
 	Vehicle *v = GetVehicle(p1);
 
-	if (v->type != VEH_Train || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_TRAIN || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	/* Check if this train can be started/stopped. The callback will fail or
 	 * return 0xFF if it can. */
@@ -1283,7 +1283,7 @@
 
 	Vehicle *v = GetVehicle(p1);
 
-	if (v->type != VEH_Train || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_TRAIN || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 
@@ -1334,30 +1334,37 @@
 				for (Vehicle *tmp = first; tmp != NULL; tmp = tmp->next) tmp->first = NULL;
 
 				/* 2.2 If there are wagons present after the deleted front engine, check
-         * if the second wagon (which will be first) is an engine. If it is one,
-         * promote it as a new train, retaining the unitnumber, orders */
-				if (new_f != NULL) {
-					if (IsTrainEngine(new_f)) {
-						switch_engine = true;
-						/* Copy important data from the front engine */
-						new_f->unitnumber = first->unitnumber;
-						new_f->current_order = first->current_order;
-						new_f->cur_order_index = first->cur_order_index;
-						new_f->orders = first->orders;
-						if (first->prev_shared != NULL) {
-							first->prev_shared->next_shared = new_f;
-							new_f->prev_shared = first->prev_shared;
-						}
-
-						if (first->next_shared != NULL) {
-							first->next_shared->prev_shared = new_f;
-							new_f->next_shared = first->next_shared;
-						}
-
-						new_f->num_orders = first->num_orders;
-						first->orders = NULL; // XXX - to not to delete the orders */
-						if (IsLocalPlayer()) ShowTrainViewWindow(new_f);
+				 * if the second wagon (which will be first) is an engine. If it is one,
+				 * promote it as a new train, retaining the unitnumber, orders */
+				if (new_f != NULL && IsTrainEngine(new_f)) {
+					switch_engine = true;
+					/* Copy important data from the front engine */
+					new_f->unitnumber      = first->unitnumber;
+					new_f->current_order   = first->current_order;
+					new_f->cur_order_index = first->cur_order_index;
+					new_f->orders          = first->orders;
+					new_f->num_orders      = first->num_orders;
+
+					if (first->prev_shared != NULL) {
+						first->prev_shared->next_shared = new_f;
+						new_f->prev_shared = first->prev_shared;
 					}
+
+					if (first->next_shared != NULL) {
+						first->next_shared->prev_shared = new_f;
+						new_f->next_shared = first->next_shared;
+					}
+
+					/*
+					 * Remove all order information from the front train, to
+					 * prevent the order and the shared order list to be
+					 * destroyed by Destroy/DeleteVehicle.
+					 */
+					first->orders      = NULL;
+					first->prev_shared = NULL;
+					first->next_shared = NULL;
+
+					if (IsLocalPlayer()) ShowTrainViewWindow(new_f);
 				}
 			}
 
@@ -1562,7 +1569,7 @@
 /* Check if the vehicle is a train and is on the tile we are testing */
 static void *TestTrainOnCrossing(Vehicle *v, void *data)
 {
-	if (v->tile != *(const TileIndex*)data || v->type != VEH_Train) return NULL;
+	if (v->tile != *(const TileIndex*)data || v->type != VEH_TRAIN) return NULL;
 	return v;
 }
 
@@ -1669,7 +1676,7 @@
 
 	Vehicle *v = GetVehicle(p1);
 
-	if (v->type != VEH_Train || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_TRAIN || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	if (p2) {
 		// turn a single unit around
@@ -1717,7 +1724,7 @@
 
 	Vehicle *v = GetVehicle(p1);
 
-	if (v->type != VEH_Train || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_TRAIN || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	if (flags & DC_EXEC) v->u.rail.force_proceed = 0x50;
 
@@ -1740,11 +1747,11 @@
 
 	Vehicle *v = GetVehicle(p1);
 
-	if (v->type != VEH_Train || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_TRAIN || !CheckOwnership(v->owner)) return CMD_ERROR;
 	if (CheckTrainStoppedInDepot(v) < 0) return_cmd_error(STR_TRAIN_MUST_BE_STOPPED);
 
 	/* Check cargo */
-	if (new_cid > NUM_CARGO) return CMD_ERROR;
+	if (new_cid >= NUM_CARGO) return CMD_ERROR;
 
 	SET_EXPENSES_TYPE(EXPENSES_TRAIN_RUN);
 
@@ -1822,7 +1829,7 @@
 	return cost;
 }
 
-typedef struct TrainFindDepotData {
+struct TrainFindDepotData {
 	uint best_length;
 	TileIndex tile;
 	PlayerID owner;
@@ -1831,7 +1838,7 @@
 	 * This value is unused when new depot finding and NPF are both disabled
 	 */
 	bool reverse;
-} TrainFindDepotData;
+};
 
 static bool NtpCallbFindDepot(TileIndex tile, TrainFindDepotData *tfdd, int track, uint length)
 {
@@ -1918,14 +1925,14 @@
 	if (p2 & DEPOT_MASS_SEND) {
 		/* Mass goto depot requested */
 		if (!ValidVLWFlags(p2 & VLW_MASK)) return CMD_ERROR;
-		return SendAllVehiclesToDepot(VEH_Train, flags, p2 & DEPOT_SERVICE, _current_player, (p2 & VLW_MASK), p1);
+		return SendAllVehiclesToDepot(VEH_TRAIN, flags, p2 & DEPOT_SERVICE, _current_player, (p2 & VLW_MASK), p1);
 	}
 
 	if (!IsValidVehicleID(p1)) return CMD_ERROR;
 
 	Vehicle *v = GetVehicle(p1);
 
-	if (v->type != VEH_Train || !CheckOwnership(v->owner)) return CMD_ERROR;
+	if (v->type != VEH_TRAIN || !CheckOwnership(v->owner)) return CMD_ERROR;
 
 	if (v->vehstatus & VS_CRASHED) return CMD_ERROR;
 
@@ -1979,7 +1986,7 @@
 }
 
 
-void OnTick_Train(void)
+void OnTick_Train()
 {
 	_age_cargo_skip_counter = (_age_cargo_skip_counter == 0) ? 184 : (_age_cargo_skip_counter - 1);
 }
@@ -2134,13 +2141,13 @@
 }
 
 /* Check for station tiles */
-typedef struct TrainTrackFollowerData {
+struct TrainTrackFollowerData {
 	TileIndex dest_coords;
 	StationID station_index; // station index we're heading for
 	uint best_bird_dist;
 	uint best_track_dist;
 	TrackdirByte best_track;
-} TrainTrackFollowerData;
+};
 
 static bool NtpCallbFindStation(TileIndex tile, TrainTrackFollowerData *ttfd, Trackdir track, uint length)
 {
@@ -2158,6 +2165,7 @@
 		 * approximation of where the station is */
 		// found station
 		ttfd->best_track = track;
+		ttfd->best_bird_dist = 0;
 		return true;
 	} else {
 		// didn't find station, keep track of the best path so far.
@@ -2454,8 +2462,7 @@
 
 	// If no order, do nothing.
 	if (order == NULL) {
-		v->current_order.type = OT_NOTHING;
-		v->current_order.flags = 0;
+		v->current_order.Free();
 		v->dest_tile = 0;
 		return false;
 	}
@@ -2712,11 +2719,11 @@
 		);
 }
 
-typedef struct {
+struct RailtypeSlowdownParams {
 	byte small_turn, large_turn;
 	byte z_up; // fraction to remove when moving up
 	byte z_down; // fraction to remove when moving down
-} RailtypeSlowdownParams;
+};
 
 static const RailtypeSlowdownParams _railtype_slowdown[] = {
 	// normal accel
@@ -2768,10 +2775,10 @@
 }
 
 
-typedef struct TrainCollideChecker {
+struct TrainCollideChecker {
 	const Vehicle *v;
 	const Vehicle *v_skip;
-} TrainCollideChecker;
+};
 
 static void *FindTrainCollideEnum(Vehicle *v, void *data)
 {
@@ -2779,7 +2786,7 @@
 
 	if (v != tcc->v &&
 			v != tcc->v_skip &&
-			v->type == VEH_Train &&
+			v->type == VEH_TRAIN &&
 			v->u.rail.track != TRACK_BIT_DEPOT &&
 			myabs(v->z_pos - tcc->v->z_pos) <= 6 &&
 			myabs(v->x_pos - tcc->v->x_pos) < 6 &&
@@ -2861,16 +2868,16 @@
 	SndPlayVehicleFx(SND_13_BIG_CRASH, v);
 }
 
-typedef struct VehicleAtSignalData {
+struct VehicleAtSignalData {
 	TileIndex tile;
 	Direction direction;
-} VehicleAtSignalData;
+};
 
 static void *CheckVehicleAtSignal(Vehicle *v, void *data)
 {
 	const VehicleAtSignalData* vasd = (VehicleAtSignalData*)data;
 
-	if (v->type == VEH_Train && IsFrontEngine(v) && v->tile == vasd->tile) {
+	if (v->type == VEH_TRAIN && IsFrontEngine(v) && v->tile == vasd->tile) {
 		DirDiff diff = ChangeDirDiff(DirDifference(v->direction, vasd->direction), DIRDIFF_90RIGHT);
 
 		if (diff == DIRDIFF_90RIGHT || (v->cur_speed <= 5 && diff <= DIRDIFF_REVERSE)) return v;
@@ -2910,8 +2917,7 @@
 					}
 
 					if (v->current_order.type == OT_LEAVESTATION) {
-						v->current_order.type = OT_NOTHING;
-						v->current_order.flags = 0;
+						v->current_order.Free();
 						InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
 					}
 				}
@@ -3391,7 +3397,7 @@
 		TrainLocoHandler(v, false);
 
 		// make sure vehicle wasn't deleted.
-		if (v->type == VEH_Train && IsFrontEngine(v))
+		if (v->type == VEH_TRAIN && IsFrontEngine(v))
 			TrainLocoHandler(v, true);
 	} else if (IsFreeWagon(v) && HASBITS(v->vehstatus, VS_CRASHED)) {
 		// Delete flooded standalone wagon
@@ -3495,12 +3501,12 @@
 	}
 }
 
-void TrainsYearlyLoop(void)
+void TrainsYearlyLoop()
 {
 	Vehicle *v;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Train && IsFrontEngine(v)) {
+		if (v->type == VEH_TRAIN && IsFrontEngine(v)) {
 			// show warning if train is not generating enough income last 2 years (corresponds to a red icon in the vehicle list)
 			if (_patches.train_income_warn && v->owner == _local_player && v->age >= 730 && v->profit_this_year < 0) {
 				SetDParam(1, v->profit_this_year);
@@ -3520,7 +3526,7 @@
 }
 
 
-void InitializeTrains(void)
+void InitializeTrains()
 {
 	_age_cargo_skip_counter = 1;
 }
@@ -3529,18 +3535,18 @@
  * Link front and rear multiheaded engines to each other
  * This is done when loading a savegame
  */
-void ConnectMultiheadedTrains(void)
+void ConnectMultiheadedTrains()
 {
 	Vehicle *v;
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Train) {
+		if (v->type == VEH_TRAIN) {
 			v->u.rail.other_multiheaded_part = NULL;
 		}
 	}
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Train && IsFrontEngine(v)) {
+		if (v->type == VEH_TRAIN && IsFrontEngine(v)) {
 			Vehicle *u = v;
 
 			BEGIN_ENUM_WAGONS(u) {
@@ -3577,17 +3583,17 @@
  *  Converts all trains to the new subtype format introduced in savegame 16.2
  *  It also links multiheaded engines or make them forget they are multiheaded if no suitable partner is found
  */
-void ConvertOldMultiheadToNew(void)
+void ConvertOldMultiheadToNew()
 {
 	Vehicle *v;
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Train) {
+		if (v->type == VEH_TRAIN) {
 			SETBIT(v->subtype, 7); // indicates that it's the old format and needs to be converted in the next loop
 		}
 	}
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Train) {
+		if (v->type == VEH_TRAIN) {
 			if (HASBIT(v->subtype, 7) && ((v->subtype & ~0x80) == 0 || (v->subtype & ~0x80) == 4)) {
 				Vehicle *u = v;
 
--- a/src/train_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/train_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -25,7 +25,7 @@
 	// find a locomotive in the depot.
 	found = NULL;
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Train && IsFrontEngine(v) &&
+		if (v->type == VEH_TRAIN && IsFrontEngine(v) &&
 				v->tile == tile &&
 				v->u.rail.track == TRACK_BIT_DEPOT) {
 			if (found != NULL) return; // must be exactly one.
--- a/src/tree_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/tree_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -84,7 +84,7 @@
 	}
 }
 
-static void PlaceMoreTrees(void)
+static void PlaceMoreTrees()
 {
 	uint i = ScaleByMapSize(GB(Random(), 0, 5) + 25);
 	do {
@@ -124,7 +124,7 @@
 	}
 }
 
-void PlaceTreesRandomly(void)
+void PlaceTreesRandomly()
 {
 	uint i, j, ht;
 
@@ -180,7 +180,7 @@
 	}
 }
 
-void GenerateTrees(void)
+void GenerateTrees()
 {
 	uint i, total;
 
@@ -310,11 +310,11 @@
 	}
 }
 
-typedef struct TreeListEnt {
+struct TreeListEnt {
 	SpriteID image;
 	SpriteID pal;
 	byte x,y;
-} TreeListEnt;
+};
 
 static void DrawTile_Trees(TileInfo *ti)
 {
@@ -604,7 +604,7 @@
 	MarkTileDirtyByTile(tile);
 }
 
-void OnTick_Trees(void)
+void OnTick_Trees()
 {
 	uint32 r;
 	TileIndex tile;
@@ -654,7 +654,7 @@
 	/* not used */
 }
 
-void InitializeTrees(void)
+void InitializeTrees()
 {
 	_trees_tick_ctr = 0;
 }
--- a/src/tree_map.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/tree_map.h	Mon Mar 19 12:38:16 2007 +0000
@@ -5,7 +5,7 @@
 
 #include "macros.h"
 
-typedef enum TreeType {
+enum TreeType {
 	TREE_INVALID      = -1,
 	TREE_TEMPERATE    = 0,
 	TREE_SUB_ARCTIC   = 12,
@@ -13,7 +13,7 @@
 	TREE_CACTUS       = 27,
 	TREE_SUB_TROPICAL = 28,
 	TREE_TOYLAND      = 32
-} TreeType;
+};
 
 enum {
 	TREE_COUNT_TEMPERATE    = TREE_SUB_ARCTIC   - TREE_TEMPERATE,
@@ -25,11 +25,11 @@
 
 /* ground type, m2 bits 4...5
  * valid densities (bits 6...7) in comments after the enum */
-typedef enum TreeGround {
+enum TreeGround {
 	TREE_GROUND_GRASS       = 0, // 0
 	TREE_GROUND_ROUGH       = 1, // 0
 	TREE_GROUND_SNOW_DESERT = 2  // 0-3 for snow, 3 for desert
-} TreeGround;
+};
 
 
 static inline TreeType GetTreeType(TileIndex t)
--- a/src/tunnelbridge_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/tunnelbridge_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -77,7 +77,7 @@
 }
 
 #define M(x) (1 << (x))
-typedef enum BridgeFoundations{
+enum BridgeFoundation {
 	// foundation, whole tile is leveled up --> 3 corners raised
 	BRIDGE_FULL_LEVELED_FOUNDATION = M(SLOPE_WSE) | M(SLOPE_NWS) | M(SLOPE_ENW) | M(SLOPE_SEN),
 	// foundation, tile is partly leveled up --> 1 corner raised
@@ -85,7 +85,7 @@
 	// no foundations (X,Y direction)
 	BRIDGE_NO_FOUNDATION = M(SLOPE_FLAT) | M(SLOPE_SW) | M(SLOPE_SE) | M(SLOPE_NW) | M(SLOPE_NE),
 	BRIDGE_HORZ_RAMP = (BRIDGE_PARTLY_LEVELED_FOUNDATION | BRIDGE_NO_FOUNDATION) & ~M(SLOPE_FLAT)
-} BridgeFoundataion;
+};
 #undef M
 
 static inline const PalSpriteID *GetBridgeSpriteTable(int index, byte table)
@@ -543,7 +543,7 @@
 
 	v = FindVehicleBetween(starttile, tile, z);
 	if (v != NULL) {
-		_error_message = v->type == VEH_Train ?
+		_error_message = v->type == VEH_TRAIN ?
 			STR_5000_TRAIN_IN_TUNNEL : STR_5001_ROAD_VEHICLE_IN_TUNNEL;
 		return INVALID_TILE;
 	}
@@ -1257,7 +1257,7 @@
 		DiagDirection dir;
 		DiagDirection vdir;
 
-		if (v->type == VEH_Train) {
+		if (v->type == VEH_TRAIN) {
 			fc = (x & 0xF) + (y << 4);
 
 			dir = GetTunnelDirection(tile);
@@ -1286,7 +1286,7 @@
 				v->vehstatus &= ~VS_HIDDEN;
 				return VETSB_ENTERED_WORMHOLE;
 			}
-		} else if (v->type == VEH_Road) {
+		} else if (v->type == VEH_ROAD) {
 			fc = (x & 0xF) + (y << 4);
 			dir = GetTunnelDirection(tile);
 			vdir = DirToDiagDir(v->direction);
@@ -1320,11 +1320,11 @@
 	} else if (IsBridge(tile)) { // XXX is this necessary?
 		DiagDirection dir;
 
-		if (v->type == VEH_Road || (v->type == VEH_Train && IsFrontEngine(v))) {
+		if (v->type == VEH_ROAD || (v->type == VEH_TRAIN && IsFrontEngine(v))) {
 			/* modify speed of vehicle */
 			uint16 spd = _bridge[GetBridgeType(tile)].speed;
 
-			if (v->type == VEH_Road) spd *= 2;
+			if (v->type == VEH_ROAD) spd *= 2;
 			if (v->cur_speed > spd) v->cur_speed = spd;
 		}
 
@@ -1337,7 +1337,7 @@
 				case DIAGDIR_SW: if ((x & 0xF) != TILE_SIZE - 1) return VETSB_CONTINUE; break;
 				case DIAGDIR_NW: if ((y & 0xF) != 0)             return VETSB_CONTINUE; break;
 			}
-			if (v->type == VEH_Train) {
+			if (v->type == VEH_TRAIN) {
 				v->u.rail.track = TRACK_BIT_WORMHOLE;
 				CLRBIT(v->u.rail.flags, VRF_GOINGUP);
 				CLRBIT(v->u.rail.flags, VRF_GOINGDOWN);
@@ -1347,7 +1347,7 @@
 			return VETSB_ENTERED_WORMHOLE;
 		} else if (DirToDiagDir(v->direction) == ReverseDiagDir(dir)) {
 			v->tile = tile;
-			if (v->type == VEH_Train) {
+			if (v->type == VEH_TRAIN) {
 				if (v->u.rail.track == TRACK_BIT_WORMHOLE) {
 					v->u.rail.track = (DiagDirToAxis(dir) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y);
 					return VETSB_ENTERED_WORMHOLE;
--- a/src/unix.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/unix.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -14,10 +14,6 @@
 #include <time.h>
 #include <signal.h>
 
-#ifdef USE_HOMEDIR
-#include <pwd.h>
-#endif
-
 #if (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) || defined(__GLIBC__)
 	#define HAS_STATVFS
 #endif
@@ -59,7 +55,7 @@
 #endif
 }
 
-void FiosGetDrives(void)
+void FiosGetDrives()
 {
 	return;
 }
@@ -92,22 +88,13 @@
 #endif
 	snprintf(filename, lengthof(filename), "%s" PATHSEP "%s", path, ent->d_name);
 
-	if (stat(filename, sb) != 0) return false;
-
-	return (ent->d_name[0] != '.'); // hidden file
+	return stat(filename, sb) == 0;
 }
 
-#if defined(__BEOS__) || defined(__linux__)
-static void ChangeWorkingDirectory(char *exe)
+bool FiosIsHiddenFile(const struct dirent *ent)
 {
-	char *s = strrchr(exe, '/');
-	if (s != NULL) {
-		*s = '\0';
-		chdir(exe);
-		*s = '/';
-	}
+	return ent->d_name[0] == '.';
 }
-#endif
 
 void ShowInfo(const char *str)
 {
@@ -127,9 +114,8 @@
 }
 
 #ifdef WITH_COCOA
-void cocoaSetWorkingDirectory(void);
-void cocoaSetupAutoreleasePool(void);
-void cocoaReleaseAutoreleasePool(void);
+void cocoaSetupAutoreleasePool();
+void cocoaReleaseAutoreleasePool();
 #endif
 
 int CDECL main(int argc, char* argv[])
@@ -142,15 +128,9 @@
 	if (argc >= 2 && strncmp(argv[1], "-psn", 4) == 0) {
 		argv[1] = NULL;
 		argc = 1;
-		cocoaSetWorkingDirectory();
 	}
 #endif
 
-	// change the working directory to enable doubleclicking in UIs
-#if defined(__BEOS__) || defined(__linux__)
-	ChangeWorkingDirectory(argv[0]);
-#endif
-
 	_random_seeds[1][1] = _random_seeds[1][0] = _random_seeds[0][1] = _random_seeds[0][0] = time(NULL);
 	SeedMT(_random_seeds[0][1]);
 
@@ -165,81 +145,6 @@
 	return ret;
 }
 
-void DeterminePaths(void)
-{
-	char *s;
-
-	_paths.game_data_dir = MallocT<char>(MAX_PATH);
-	ttd_strlcpy(_paths.game_data_dir, GAME_DATA_DIR, MAX_PATH);
-	#if defined SECOND_DATA_DIR
-	_paths.second_data_dir = MallocT<char>(MAX_PATH);
-	ttd_strlcpy(_paths.second_data_dir, SECOND_DATA_DIR, MAX_PATH);
-	#endif
-
-#if defined(USE_HOMEDIR)
-	{
-		const char *homedir = getenv("HOME");
-
-		if (homedir == NULL) {
-			const struct passwd *pw = getpwuid(getuid());
-			if (pw != NULL) homedir = pw->pw_dir;
-		}
-
-		_paths.personal_dir = str_fmt("%s" PATHSEP "%s", homedir, PERSONAL_DIR);
-	}
-
-#else /* not defined(USE_HOMEDIR) */
-
-	_paths.personal_dir = MallocT<char>(MAX_PATH);
-	ttd_strlcpy(_paths.personal_dir, PERSONAL_DIR, MAX_PATH);
-
-	// check if absolute or relative path
-	s = strchr(_paths.personal_dir, '/');
-
-	// add absolute path
-	if (s == NULL || _paths.personal_dir != s) {
-		getcwd(_paths.personal_dir, MAX_PATH);
-		s = strchr(_paths.personal_dir, 0);
-		*s++ = '/';
-		ttd_strlcpy(s, PERSONAL_DIR, MAX_PATH);
-	}
-
-#endif /* defined(USE_HOMEDIR) */
-
-	s = strchr(_paths.personal_dir, 0);
-
-	// append a / ?
-	if (s[-1] != '/') strcpy(s, "/");
-
-	_paths.save_dir = str_fmt("%ssave", _paths.personal_dir);
-	_paths.autosave_dir = str_fmt("%s/autosave", _paths.save_dir);
-	_paths.scenario_dir = str_fmt("%sscenario", _paths.personal_dir);
-	_paths.heightmap_dir = str_fmt("%sscenario/heightmap", _paths.personal_dir);
-	_paths.gm_dir = str_fmt("%sgm/", _paths.game_data_dir);
-	_paths.data_dir = str_fmt("%sdata/", _paths.game_data_dir);
-
-	if (_config_file == NULL)
-		_config_file = str_fmt("%sopenttd.cfg", _paths.personal_dir);
-
-	_highscore_file = str_fmt("%shs.dat", _paths.personal_dir);
-	_log_file = str_fmt("%sopenttd.log", _paths.personal_dir);
-
-#if defined CUSTOM_LANG_DIR
-	// sets the search path for lng files to the custom one
-	_paths.lang_dir = MallocT<char>(MAX_PATH);
-	ttd_strlcpy( _paths.lang_dir, CUSTOM_LANG_DIR, MAX_PATH);
-#else
-	_paths.lang_dir = str_fmt("%slang/", _paths.game_data_dir);
-#endif
-
-	// create necessary folders
-	mkdir(_paths.personal_dir, 0755);
-	mkdir(_paths.save_dir, 0755);
-	mkdir(_paths.autosave_dir, 0755);
-	mkdir(_paths.scenario_dir, 0755);
-	mkdir(_paths.heightmap_dir, 0755);
-}
-
 bool InsertTextBufferClipboard(Textbuf *tb)
 {
 	return false;
@@ -296,7 +201,7 @@
 /** Try and try to decipher the current locale from environmental
  * variables. MacOSX is hardcoded, other OS's are dynamic. If no suitable
  * locale can be found, don't do any conversion "" */
-static const char *GetLocalCode(void)
+static const char *GetLocalCode()
 {
 #if defined(__APPLE__)
 	return "UTF-8-MAC";
--- a/src/unmovable_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/unmovable_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -152,12 +152,7 @@
 			DrawClearLandTile(ti, 0);
 
 			image = SPR_BOUGHT_LAND;
-			if (_display_opt & DO_TRANS_BUILDINGS) {
-				SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
-				pal = PALETTE_TO_TRANSPARENT;
-			} else {
-				pal = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile));
-			}
+			pal = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile));
 			AddSortableSpriteToDraw(
 				image, pal,
 				ti->x + TILE_SIZE / 2, ti->y + TILE_SIZE / 2, 1, 1, 10, GetSlopeZ(ti->x + TILE_SIZE / 2, ti->y + TILE_SIZE / 2)
@@ -233,6 +228,12 @@
 	if (_game_mode != GM_EDITOR && _current_player != OWNER_WATER && ((flags & DC_AUTO || !_cheats.magic_bulldozer.value)) )
 		return_cmd_error(STR_5800_OBJECT_IN_THE_WAY);
 
+	if (IsStatue(tile)) {
+		TownID town = GetStatueTownID(tile);
+		CLRBIT(GetTown(town)->statues, _current_player);
+		InvalidateWindow(WC_TOWN_AUTHORITY, town);
+	}
+
 	if (flags & DC_EXEC) {
 		DoClearSquare(tile);
 	}
@@ -335,7 +336,7 @@
 	return false;
 }
 
-void GenerateUnmovables(void)
+void GenerateUnmovables()
 {
 	int i, li, j, loop_count;
 	TileIndex tile;
--- a/src/unmovable_map.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/unmovable_map.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,7 +8,7 @@
 	HQ_NUM_SIZE = 5
 };
 
-typedef enum UnmovableType {
+enum UnmovableType {
 	UNMOVABLE_TRANSMITTER = 0,
 	UNMOVABLE_LIGHTHOUSE  = 1,
 	UNMOVABLE_STATUE      = 2,
@@ -19,7 +19,7 @@
 	UNMOVABLE_HQ_SOUTH    = 0x83,
 
 	UNMOVABLE_HQ_END      = UNMOVABLE_HQ_NORTH + HQ_NUM_SIZE * HQ_NUM_TILE
-} UnmovableType;
+};
 
 
 
@@ -54,6 +54,23 @@
 	return IS_INT_INSIDE(GetUnmovableType(t), UNMOVABLE_HQ_NORTH, UNMOVABLE_HQ_END);
 }
 
+static inline bool IsStatue(TileIndex t)
+{
+	assert(IsTileType(t, MP_UNMOVABLE));
+	return GetUnmovableType(t) == UNMOVABLE_STATUE;
+}
+
+static inline bool IsStatueTile(TileIndex t)
+{
+	return IsTileType(t, MP_UNMOVABLE) && IsStatue(t);
+}
+
+static inline TownID GetStatueTownID(TileIndex t)
+{
+	assert(IsStatue(t));
+	return _m[t].m2;
+}
+
 static inline byte GetCompanyHQSize(TileIndex t)
 {
 	assert(IsTileType(t, MP_UNMOVABLE) && IsCompanyHQ(t));
@@ -100,9 +117,10 @@
 	MakeUnmovable(t, UNMOVABLE_LIGHTHOUSE, OWNER_NONE);
 }
 
-static inline void MakeStatue(TileIndex t, Owner o)
+static inline void MakeStatue(TileIndex t, Owner o, TownID town_id)
 {
 	MakeUnmovable(t, UNMOVABLE_STATUE, o);
+	_m[t].m2 = town_id;
 }
 
 static inline void MakeOwnedLand(TileIndex t, Owner o)
--- a/src/variables.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/variables.h	Mon Mar 19 12:38:16 2007 +0000
@@ -19,7 +19,7 @@
 VARDEF uint32 _cargo_payment_rates[NUM_CARGO];
 VARDEF uint16 _cargo_payment_rates_frac[NUM_CARGO];
 
-typedef struct {
+struct GameOptions {
 	GameDifficulty diff;
 	byte diff_level;
 	byte currency;
@@ -29,7 +29,7 @@
 	byte snow_line;
 	byte autosave;
 	byte road_side;
-} GameOptions;
+};
 
 /* These are the options for the current game
  * either ingame, or loaded. Also used for networking games */
@@ -80,7 +80,7 @@
 
 // ********* END OF SAVE REGION
 
-typedef struct Patches {
+struct Patches {
 	bool modified_catchment;            // different-size catchment areas
 	bool vehicle_speed;                 // show vehicle speed
 	bool build_on_slopes;               // allow building on slopes
@@ -221,22 +221,24 @@
 	/** YAPF settings */
 	YapfSettings  yapf;
 
-} Patches;
+	uint8 scrollwheel_scrolling;
+	uint8 scrollwheel_multiplier;
+};
 
 VARDEF Patches _patches;
 
 
-typedef struct Cheat {
+struct Cheat {
 	bool been_used; // has this cheat been used before?
 	bool value;     // tells if the bool cheat is active or not
-} Cheat;
+};
 
 
 // WARNING! Do _not_ remove entries in Cheats struct or change the order
 // of the existing ones! Would break downward compatibility.
 // Only add new entries at the end of the struct!
 
-typedef struct Cheats {
+struct Cheats {
 	Cheat magic_bulldozer;  // dynamite industries, unmovables
 	Cheat switch_player;    // change to another player
 	Cheat money;            // get rich
@@ -247,11 +249,11 @@
 	Cheat change_date;      // changes date ingame
 	Cheat setup_prod;       // setup raw-material production in game
 	Cheat dummy;            // empty cheat (enable running el-engines on normal rail)
-} Cheats;
+};
 
 VARDEF Cheats _cheats;
 
-typedef struct Paths {
+struct Paths {
 	char *personal_dir;  // includes cfg file and save folder
 	char *game_data_dir; // includes data, gm, lang
 	char *data_dir;
@@ -262,7 +264,7 @@
 	char *scenario_dir;
 	char *heightmap_dir;
 	char *second_data_dir;
-} Paths;
+};
 
 VARDEF Paths _paths;
 
@@ -296,11 +298,11 @@
 VARDEF bool _generating_world;
 
 // Deals with the type of the savegame, independent of extension
-typedef struct {
+struct SmallFiosItem {
 	int mode;             // savegame/scenario type (old, new)
 	char name[MAX_PATH];  // name
 	char title[255];      // internal name of the game
-} SmallFiosItem;
+};
 
 // Used when switching from the intro menu.
 VARDEF byte _switch_mode;
@@ -313,19 +315,22 @@
 
 VARDEF char _ini_videodriver[32], _ini_musicdriver[32], _ini_sounddriver[32];
 
-// Used for dynamic language support
-typedef struct {
-	int num; // number of languages
-	int curr; // currently selected language index
-	char curr_file[MAX_LANG]; // currently selected language file
-	StringID dropdown[MAX_LANG + 1]; // used in settings dialog
-	struct {
-		char *name;
-		char *file;
-	} ent[MAX_LANG];
-} DynamicLanguages;
+/** Information about a language */
+struct Language {
+	char *name; ///< The internal name of the language
+	char *file; ///< The name of the language as it appears on disk
+};
 
-VARDEF DynamicLanguages _dynlang;
+/** Used for dynamic language support */
+struct DynamicLanguages {
+	int num;                         ///< Number of languages
+	int curr;                        ///< Currently selected language index
+	char curr_file[MAX_PATH];        ///< Currently selected language file (needed for saving the filename of the loaded language
+	StringID dropdown[MAX_LANG + 1]; ///< List of languages in the settings gui
+	Language ent[MAX_LANG];          ///< Information about the languages
+};
+
+extern DynamicLanguages _dynlang; // defined in strings.cpp
 
 VARDEF int _num_resolutions;
 VARDEF uint16 _resolutions[32][2];
--- a/src/vehicle.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/vehicle.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -37,7 +37,6 @@
 #include "newgrf_engine.h"
 #include "newgrf_sound.h"
 #include "helpers.hpp"
-#include "cargotype.h"
 
 #define INVALID_COORD (-0x8000)
 #define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6))
@@ -87,7 +86,7 @@
 	 * TODO - This is just a temporary stage, this will be removed. */
 	for (v = GetVehicle(start_item); v != NULL; v = (v->index + 1U < GetVehiclePoolSize()) ? GetVehicle(v->index + 1) : NULL) {
 		v->index = start_item++;
-		v->type  = VEH_Invalid;
+		v->type  = VEH_INVALID;
 	}
 }
 
@@ -119,16 +118,16 @@
 StringID VehicleInTheWayErrMsg(const Vehicle* v)
 {
 	switch (v->type) {
-		case VEH_Train:    return STR_8803_TRAIN_IN_THE_WAY;
-		case VEH_Road:     return STR_9000_ROAD_VEHICLE_IN_THE_WAY;
-		case VEH_Aircraft: return STR_A015_AIRCRAFT_IN_THE_WAY;
+		case VEH_TRAIN:    return STR_8803_TRAIN_IN_THE_WAY;
+		case VEH_ROAD:     return STR_9000_ROAD_VEHICLE_IN_THE_WAY;
+		case VEH_AIRCRAFT: return STR_A015_AIRCRAFT_IN_THE_WAY;
 		default:           return STR_980E_SHIP_IN_THE_WAY;
 	}
 }
 
 static void *EnsureNoVehicleProc(Vehicle *v, void *data)
 {
-	if (v->tile != *(const TileIndex*)data || v->type == VEH_Disaster)
+	if (v->tile != *(const TileIndex*)data || v->type == VEH_DISASTER)
 		return NULL;
 
 	_error_message = VehicleInTheWayErrMsg(v);
@@ -144,7 +143,7 @@
 {
 	const TileInfo *ti = (const TileInfo*)data;
 
-	if (v->tile != ti->tile || v->type == VEH_Disaster) return NULL;
+	if (v->tile != ti->tile || v->type == VEH_DISASTER) return NULL;
 	if (v->z_pos > ti->z) return NULL;
 
 	_error_message = VehicleInTheWayErrMsg(v);
@@ -186,7 +185,7 @@
 	}
 	FOR_ALL_VEHICLES(veh) {
 		if (without_crashed && (veh->vehstatus & VS_CRASHED) != 0) continue;
-		if ((veh->type == VEH_Train || veh->type == VEH_Road) && (z==0xFF || veh->z_pos == z)) {
+		if ((veh->type == VEH_TRAIN || veh->type == VEH_ROAD) && (z==0xFF || veh->z_pos == z)) {
 			if ((veh->x_pos>>4) >= x1 && (veh->x_pos>>4) <= x2 &&
 					(veh->y_pos>>4) >= y1 && (veh->y_pos>>4) <= y2) {
 				return veh;
@@ -217,26 +216,26 @@
 }
 
 // Called after load to update coordinates
-void AfterLoadVehicles(void)
+void AfterLoadVehicles()
 {
 	Vehicle *v;
 
 	FOR_ALL_VEHICLES(v) {
 		v->first = NULL;
-		if (v->type == VEH_Train) v->u.rail.first_engine = INVALID_ENGINE;
+		if (v->type == VEH_TRAIN) v->u.rail.first_engine = INVALID_ENGINE;
 	}
 
 	FOR_ALL_VEHICLES(v) {
-		if (v->type == VEH_Train && (IsFrontEngine(v) || IsFreeWagon(v)))
+		if (v->type == VEH_TRAIN && (IsFrontEngine(v) || IsFreeWagon(v)))
 			TrainConsistChanged(v);
 	}
 
 	FOR_ALL_VEHICLES(v) {
 		switch (v->type) {
-			case VEH_Train: v->cur_image = GetTrainImage(v, v->direction); break;
-			case VEH_Road: v->cur_image = GetRoadVehImage(v, v->direction); break;
-			case VEH_Ship: v->cur_image = GetShipImage(v, v->direction); break;
-			case VEH_Aircraft:
+			case VEH_TRAIN: v->cur_image = GetTrainImage(v, v->direction); break;
+			case VEH_ROAD: v->cur_image = GetRoadVehImage(v, v->direction); break;
+			case VEH_SHIP: v->cur_image = GetShipImage(v, v->direction); break;
+			case VEH_AIRCRAFT:
 				if (IsNormalAircraft(v)) {
 					v->cur_image = GetAircraftImage(v, v->direction);
 
@@ -267,7 +266,7 @@
 
 	assert(v->orders == NULL);
 
-	v->type = VEH_Invalid;
+	v->type = VEH_INVALID;
 	v->left_coord = INVALID_COORD;
 	v->first = NULL;
 	v->next = NULL;
@@ -284,12 +283,12 @@
  * Get a value for a vehicle's random_bits.
  * @return A random value from 0 to 255.
  */
-byte VehicleRandomBits(void)
+byte VehicleRandomBits()
 {
 	return GB(Random(), 0, 8);
 }
 
-Vehicle *ForceAllocateSpecialVehicle(void)
+Vehicle *ForceAllocateSpecialVehicle()
 {
 	/* This stays a strange story.. there should always be room for special
 	 * vehicles (special effects all over the map), but with 65k of vehicles
@@ -344,7 +343,7 @@
 }
 
 
-Vehicle *AllocateVehicle(void)
+Vehicle *AllocateVehicle()
 {
 	VehicleID counter = 0;
 	return AllocateSingleVehicle(&counter);
@@ -446,12 +445,12 @@
 	}
 }
 
-void ResetVehiclePosHash(void)
+void ResetVehiclePosHash()
 {
 	memset(_vehicle_position_hash, 0, sizeof(_vehicle_position_hash));
 }
 
-void InitializeVehicles(void)
+void InitializeVehicles()
 {
 	uint i;
 
@@ -483,7 +482,7 @@
 {
 	Vehicle *u;
 
-	FOR_ALL_VEHICLES(u) if (u->type == VEH_Train && u->next == v) return u;
+	FOR_ALL_VEHICLES(u) if (u->type == VEH_TRAIN && u->next == v) return u;
 
 	return NULL;
 }
@@ -516,7 +515,7 @@
 	Vehicle* u;
 
 	assert(v != NULL);
-	assert(v->type == VEH_Train);
+	assert(v->type == VEH_TRAIN);
 
 	if (v->first != NULL) {
 		if (IsFrontEngine(v->first) || IsFreeWagon(v->first)) return v->first;
@@ -553,12 +552,12 @@
 bool IsEngineCountable(const Vehicle *v)
 {
 	switch (v->type) {
-		case VEH_Aircraft: return IsNormalAircraft(v); // don't count plane shadows and helicopter rotors
-		case VEH_Train:
+		case VEH_AIRCRAFT: return IsNormalAircraft(v); // don't count plane shadows and helicopter rotors
+		case VEH_TRAIN:
 			return !IsArticulatedPart(v) && // tenders and other articulated parts
 			(!IsMultiheaded(v) || IsTrainEngine(v)); // rear parts of multiheaded engines
-		case VEH_Road:
-		case VEH_Ship:
+		case VEH_ROAD:
+		case VEH_SHIP:
 			return true;
 		default: return false; // Only count player buildable vehicles
 	}
@@ -574,9 +573,9 @@
 	DeleteVehicleNews(v->index, INVALID_STRING_ID);
 
 	DeleteName(v->string_id);
-	if (v->type == VEH_Road) ClearSlot(v);
-
-	if (v->type != VEH_Train || (v->type == VEH_Train && (IsFrontEngine(v) || IsFreeWagon(v)))) {
+	if (v->type == VEH_ROAD) ClearSlot(v);
+
+	if (v->type != VEH_TRAIN || (v->type == VEH_TRAIN && (IsFrontEngine(v) || IsFreeWagon(v)))) {
 		InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
 	}
 
@@ -606,7 +605,6 @@
 void Train_Tick(Vehicle *v);
 static void EffectVehicle_Tick(Vehicle *v);
 void DisasterVehicle_Tick(Vehicle *v);
-static int32 MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs);
 
 // head of the linked list to tell what vehicles that visited a depot in a tick
 static Vehicle* _first_veh_in_depot_list;
@@ -647,7 +645,7 @@
 	DisasterVehicle_Tick,
 };
 
-void CallVehicleTicks(void)
+void CallVehicleTicks()
 {
 	Vehicle *v;
 
@@ -665,12 +663,12 @@
 		_vehicle_tick_procs[v->type](v);
 
 		switch (v->type) {
-			case VEH_Train:
-			case VEH_Road:
-			case VEH_Aircraft:
-			case VEH_Ship:
-				if (v->type == VEH_Train && IsTrainWagon(v)) continue;
-				if (v->type == VEH_Aircraft && v->subtype != AIR_HELICOPTER) continue;
+			case VEH_TRAIN:
+			case VEH_ROAD:
+			case VEH_AIRCRAFT:
+			case VEH_SHIP:
+				if (v->type == VEH_TRAIN && IsTrainWagon(v)) continue;
+				if (v->type == VEH_AIRCRAFT && v->subtype != AIR_HELICOPTER) continue;
 
 				v->motion_counter += (v->direction & 1) ? (v->cur_speed * 3) / 4 : v->cur_speed;
 				/* Play a running sound if the motion counter passes 256 (Do we not skip sounds?) */
@@ -701,8 +699,8 @@
 
 	//if the aircraft carries passengers and is NOT full, then
 	//continue loading, no matter how much mail is in
-	if (v->type == VEH_Aircraft &&
-			v->cargo_type == CT_PASSENGERS &&
+	if (v->type == VEH_AIRCRAFT &&
+			IsCargoInClass(v->cargo_type, CC_PASSENGERS) &&
 			v->cargo_cap != v->cargo_count) {
 		return true;
 	}
@@ -737,7 +735,7 @@
 	TileIndex tile = v->tile;
 
 	if (IsTileType(tile, MP_STATION) ||
-			(v->type == VEH_Ship && (
+			(v->type == VEH_SHIP && (
 				IsTileType(TILE_ADDXY(tile,  1,  0), MP_STATION) ||
 				IsTileType(TILE_ADDXY(tile, -1,  0), MP_STATION) ||
 				IsTileType(TILE_ADDXY(tile,  0,  1), MP_STATION) ||
@@ -791,10 +789,10 @@
 	int32 base_cost = 0;
 
 	switch (GetEngine(engine_type)->type) {
-		case VEH_Ship: base_cost = _price.ship_base; break;
-		case VEH_Road: base_cost = _price.roadveh_base; break;
-		case VEH_Aircraft: base_cost = _price.aircraft_base; break;
-		case VEH_Train:
+		case VEH_SHIP: base_cost = _price.ship_base; break;
+		case VEH_ROAD: base_cost = _price.roadveh_base; break;
+		case VEH_AIRCRAFT: base_cost = _price.aircraft_base; break;
+		case VEH_TRAIN:
 			base_cost = 2 * ((RailVehInfo(engine_type)->railveh_type == RAILVEH_WAGON) ?
 							 _price.build_railwagon : _price.build_railvehicle);
 			break;
@@ -1098,11 +1096,11 @@
 	v->u.special.unk2 = 0;
 }
 
-typedef struct BulldozerMovement {
+struct BulldozerMovement {
 	byte direction:2;
 	byte image:2;
 	byte duration:3;
-} BulldozerMovement;
+};
 
 static const BulldozerMovement _bulldozer_movement[] = {
 	{ 0, 0, 4 },
@@ -1172,12 +1170,12 @@
 	v->progress = 0;
 }
 
-typedef struct BubbleMovement {
+struct BubbleMovement {
 	int8 x:4;
 	int8 y:4;
 	int8 z:4;
 	byte image:4;
-} BubbleMovement;
+};
 
 #define MK(x, y, z, i) { x, y, z, i }
 #define ME(i) { i, 4, 0, 0 }
@@ -1431,7 +1429,7 @@
 
 	v = ForceAllocateSpecialVehicle();
 	if (v != NULL) {
-		v->type = VEH_Special;
+		v->type = VEH_SPECIAL;
 		v->subtype = type;
 		v->x_pos = x;
 		v->y_pos = y;
@@ -1542,7 +1540,7 @@
 
 	/* calculate reliability value to use in comparison */
 	rel = v->reliability;
-	if (v->type == VEH_Ship) rel += 0x6666;
+	if (v->type == VEH_SHIP) rel += 0x6666;
 
 	/* disabled breakdowns? */
 	if (_opt.diff.vehicle_breakdowns < 1) return;
@@ -1621,10 +1619,10 @@
 	bool vehicle_list_window = HASBIT(p2, 6);
 
 	switch (vehicle_type) {
-		case VEH_Train:    stop_command = CMD_START_STOP_TRAIN;    break;
-		case VEH_Road:     stop_command = CMD_START_STOP_ROADVEH;  break;
-		case VEH_Ship:     stop_command = CMD_START_STOP_SHIP;     break;
-		case VEH_Aircraft: stop_command = CMD_START_STOP_AIRCRAFT; break;
+		case VEH_TRAIN:    stop_command = CMD_START_STOP_TRAIN;    break;
+		case VEH_ROAD:     stop_command = CMD_START_STOP_ROADVEH;  break;
+		case VEH_SHIP:     stop_command = CMD_START_STOP_SHIP;     break;
+		case VEH_AIRCRAFT: stop_command = CMD_START_STOP_AIRCRAFT; break;
 		default: return CMD_ERROR;
 	}
 
@@ -1645,7 +1643,7 @@
 		if (!!(v->vehstatus & VS_STOPPED) != start_stop) continue;
 
 		if (!vehicle_list_window) {
-			if (vehicle_type == VEH_Train) {
+			if (vehicle_type == VEH_TRAIN) {
 				if (CheckTrainInDepot(v, false) == -1) continue;
 			} else {
 				if (!(v->vehstatus & VS_HIDDEN)) continue;
@@ -1685,10 +1683,10 @@
 	byte vehicle_type = GB(p1, 0, 8);
 
 	switch (vehicle_type) {
-		case VEH_Train:    sell_command = CMD_SELL_RAIL_WAGON; break;
-		case VEH_Road:     sell_command = CMD_SELL_ROAD_VEH;   break;
-		case VEH_Ship:     sell_command = CMD_SELL_SHIP;       break;
-		case VEH_Aircraft: sell_command = CMD_SELL_AIRCRAFT;   break;
+		case VEH_TRAIN:    sell_command = CMD_SELL_RAIL_WAGON; break;
+		case VEH_ROAD:     sell_command = CMD_SELL_ROAD_VEH;   break;
+		case VEH_SHIP:     sell_command = CMD_SELL_SHIP;       break;
+		case VEH_AIRCRAFT: sell_command = CMD_SELL_AIRCRAFT;   break;
 		default: return CMD_ERROR;
 	}
 
@@ -1814,7 +1812,7 @@
 
 	if (!CheckOwnership(v->owner)) return CMD_ERROR;
 
-	if (v->type == VEH_Train && (!IsFrontEngine(v) || v->u.rail.crash_anim_pos >= 4400)) return CMD_ERROR;
+	if (v->type == VEH_TRAIN && (!IsFrontEngine(v) || v->u.rail.crash_anim_pos >= 4400)) return CMD_ERROR;
 
 	// check that we can allocate enough vehicles
 	if (!(flags & DC_EXEC)) {
@@ -1857,13 +1855,13 @@
 					DoCommand(0, w->index, v2->cargo_type | (v2->cargo_subtype << 8), flags, GetCmdRefitVeh(v));
 					break; // We learned that the engine in question needed a refit. No need to check anymore
 				}
-			} while (v->type == VEH_Train && (w2 = w2->next) != NULL && (v2 = v2->next) != NULL);
-
-			if (v->type == VEH_Train && HASBIT(v->u.rail.flags, VRF_REVERSE_DIRECTION)) {
+			} while (v->type == VEH_TRAIN && (w2 = w2->next) != NULL && (v2 = v2->next) != NULL);
+
+			if (v->type == VEH_TRAIN && HASBIT(v->u.rail.flags, VRF_REVERSE_DIRECTION)) {
 				SETBIT(w->u.rail.flags, VRF_REVERSE_DIRECTION);
 			}
 
-			if (v->type == VEH_Train && !IsFrontEngine(v)) {
+			if (v->type == VEH_TRAIN && !IsFrontEngine(v)) {
 				// this s a train car
 				// add this unit to the end of the train
 				DoCommand(0, (w_rear->index << 16) | w->index, 1, flags, CMD_MOVE_RAIL_VEHICLE);
@@ -1875,9 +1873,9 @@
 			}
 			w_rear = w; // trains needs to know the last car in the train, so they can add more in next loop
 		}
-	} while (v->type == VEH_Train && (v = GetNextVehicle(v)) != NULL);
-
-	if (flags & DC_EXEC && v_front->type == VEH_Train) {
+	} while (v->type == VEH_TRAIN && (v = GetNextVehicle(v)) != NULL);
+
+	if (flags & DC_EXEC && v_front->type == VEH_TRAIN) {
 		// for trains this needs to be the front engine due to the callback function
 		_new_vehicle_id = w_front->index;
 	}
@@ -1888,400 +1886,6 @@
 	return total_cost;
 }
 
-/*
- * move the cargo from one engine to another if possible
- */
-static void MoveVehicleCargo(Vehicle *dest, Vehicle *source)
-{
-	Vehicle *v = dest;
-	int units_moved;
-
-	do {
-		do {
-			if (source->cargo_type != dest->cargo_type)
-				continue; // cargo not compatible
-
-			if (dest->cargo_count == dest->cargo_cap)
-				continue; // the destination vehicle is already full
-
-			units_moved = min(source->cargo_count, dest->cargo_cap - dest->cargo_count);
-			source->cargo_count -= units_moved;
-			dest->cargo_count   += units_moved;
-			dest->cargo_source   = source->cargo_source;
-
-			// copy the age of the cargo
-			dest->cargo_days   = source->cargo_days;
-			dest->day_counter  = source->day_counter;
-			dest->tick_counter = source->tick_counter;
-
-		} while (source->cargo_count > 0 && (dest = dest->next) != NULL);
-		dest = v;
-	} while ((source = source->next) != NULL);
-
-	/*
-	 * The of the train will be incorrect at this moment. This is due
-	 * to the fact that removing the old wagon updates the weight of
-	 * the complete train, which is without the weight of cargo we just
-	 * moved back into some (of the) new wagon(s).
-	 */
-	if (dest->type == VEH_Train) TrainConsistChanged(dest->first);
-}
-
-static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, const EngineID engine_type)
-{
-	const Order *o;
-	const Vehicle *u;
-
-	if (v->type == VEH_Train) {
-		u = GetFirstVehicleInChain(v);
-	} else {
-		u = v;
-	}
-
-	FOR_VEHICLE_ORDERS(u, o) {
-		if (!(o->refit_cargo < NUM_CARGO)) continue;
-		if (!CanRefitTo(v->engine_type, o->refit_cargo)) continue;
-		if (!CanRefitTo(engine_type, o->refit_cargo)) return false;
-	}
-
-	return true;
-}
-
-/**
- * Function to find what type of cargo to refit to when autoreplacing
- * @param *v Original vehicle, that is being replaced
- * @param engine_type The EngineID of the vehicle that is being replaced to
- * @return The cargo type to replace to
- *    CT_NO_REFIT is returned if no refit is needed
- *    CT_INVALID is returned when both old and new vehicle got cargo capacity and refitting the new one to the old one's cargo type isn't possible
- */
-static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type)
-{
-	bool new_cargo_capacity = true;
-	CargoID new_cargo_type = CT_INVALID;
-
-	switch (v->type) {
-		case VEH_Train:
-			new_cargo_capacity = (RailVehInfo(engine_type)->capacity > 0);
-			new_cargo_type     = RailVehInfo(engine_type)->cargo_type;
-			break;
-
-		case VEH_Road:
-			new_cargo_capacity = (RoadVehInfo(engine_type)->capacity > 0);
-			new_cargo_type     = RoadVehInfo(engine_type)->cargo_type;
-			break;
-		case VEH_Ship:
-			new_cargo_capacity = (ShipVehInfo(engine_type)->capacity > 0);
-			new_cargo_type     = ShipVehInfo(engine_type)->cargo_type;
-			break;
-
-		case VEH_Aircraft:
-			/* all aircraft starts as passenger planes with cargo capacity
-			 * new_cargo_capacity is always true for aircraft, which is the init value. No need to set it here */
-			new_cargo_type     = CT_PASSENGERS;
-			break;
-
-		default: NOT_REACHED(); break;
-	}
-
-	if (!new_cargo_capacity) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity
-
-	if (v->cargo_type == new_cargo_type || CanRefitTo(engine_type, v->cargo_type)) {
-		if (VerifyAutoreplaceRefitForOrders(v, engine_type)) {
-			return v->cargo_type == new_cargo_type ? (CargoID)CT_NO_REFIT : v->cargo_type;
-		} else {
-			return CT_INVALID;
-		}
-	}
-	if (v->type != VEH_Train) return CT_INVALID; // We can't refit the vehicle to carry the cargo we want
-
-	/* Below this line it's safe to assume that the vehicle in question is a train */
-
-	if (v->cargo_cap != 0) return CT_INVALID; // trying to replace a vehicle with cargo capacity into another one with incompatible cargo type
-
-	/* the old engine didn't have cargo capacity, but the new one does
-	 * now we will figure out what cargo the train is carrying and refit to fit this */
-	v = GetFirstVehicleInChain(v);
-	do {
-		if (v->cargo_cap == 0) continue;
-		/* Now we found a cargo type being carried on the train and we will see if it is possible to carry to this one */
-		if (v->cargo_type == new_cargo_type) return CT_NO_REFIT;
-		if (CanRefitTo(engine_type, v->cargo_type)) return v->cargo_type;
-	} while ((v=v->next) != NULL);
-	return CT_NO_REFIT; // We failed to find a cargo type on the old vehicle and we will not refit the new one
-}
-
-/* Replaces a vehicle (used to be called autorenew)
- * This function is only called from MaybeReplaceVehicle()
- * Must be called with _current_player set to the owner of the vehicle
- * @param w Vehicle to replace
- * @param flags is the flags to use when calling DoCommand(). Mainly DC_EXEC counts
- * @return value is cost of the replacement or CMD_ERROR
- */
-static int32 ReplaceVehicle(Vehicle **w, byte flags, int32 total_cost)
-{
-	int32 cost;
-	int32 sell_value;
-	Vehicle *old_v = *w;
-	const Player *p = GetPlayer(old_v->owner);
-	EngineID new_engine_type;
-	const UnitID cached_unitnumber = old_v->unitnumber;
-	bool new_front = false;
-	Vehicle *new_v = NULL;
-	char vehicle_name[32];
-	CargoID replacement_cargo_type;
-
-	new_engine_type = EngineReplacementForPlayer(p, old_v->engine_type);
-	if (new_engine_type == INVALID_ENGINE) new_engine_type = old_v->engine_type;
-
-	replacement_cargo_type = GetNewCargoTypeForReplace(old_v, new_engine_type);
-
-	/* check if we can't refit to the needed type, so no replace takes place to prevent the vehicle from altering cargo type */
-	if (replacement_cargo_type == CT_INVALID) return 0;
-
-	sell_value = DoCommand(0, old_v->index, 0, DC_QUERY_COST, GetCmdSellVeh(old_v));
-
-	/* We give the player a loan of the same amount as the sell value.
-	 * This is needed in case he needs the income from the sale to build the new vehicle.
-	 * We take it back if building fails or when we really sell the old engine */
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-	SubtractMoneyFromPlayer(sell_value);
-
-	cost = DoCommand(old_v->tile, new_engine_type, 3, flags, GetCmdBuildVeh(old_v));
-	if (CmdFailed(cost)) {
-		SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-		SubtractMoneyFromPlayer(-sell_value); // Take back the money we just gave the player
-		return cost;
-	}
-
-	if (replacement_cargo_type != CT_NO_REFIT) cost += GetRefitCost(new_engine_type); // add refit cost
-
-	if (flags & DC_EXEC) {
-		new_v = GetVehicle(_new_vehicle_id);
-		*w = new_v; //we changed the vehicle, so MaybeReplaceVehicle needs to work on the new one. Now we tell it what the new one is
-
-		/* refit if needed */
-		if (replacement_cargo_type != CT_NO_REFIT) {
-			if (CmdFailed(DoCommand(0, new_v->index, replacement_cargo_type, DC_EXEC, GetCmdRefitVeh(new_v)))) {
-				/* Being here shows a failure, which most likely is in GetNewCargoTypeForReplace() or incorrect estimation costs */
-				error("Autoreplace failed to refit. Replace engine %d to %d and refit to cargo %d", old_v->engine_type, new_v->engine_type, replacement_cargo_type);
-			}
-		}
-
-		if (new_v->type == VEH_Train && HASBIT(old_v->u.rail.flags, VRF_REVERSE_DIRECTION) && !IsMultiheaded(new_v) && !(new_v->next != NULL && IsArticulatedPart(new_v->next))) {
-			// we are autorenewing to a single engine, so we will turn it as the old one was turned as well
-			SETBIT(new_v->u.rail.flags, VRF_REVERSE_DIRECTION);
-		}
-
-		if (old_v->type == VEH_Train && !IsFrontEngine(old_v)) {
-			/* this is a railcar. We need to move the car into the train
-			 * We add the new engine after the old one instead of replacing it. It will give the same result anyway when we
-			 * sell the old engine in a moment
-			 */
-			DoCommand(0, (GetPrevVehicleInChain(old_v)->index << 16) | new_v->index, 1, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
-			/* Now we move the old one out of the train */
-			DoCommand(0, (INVALID_VEHICLE << 16) | old_v->index, 0, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
-		} else {
-			// copy/clone the orders
-			DoCommand(0, (old_v->index << 16) | new_v->index, IsOrderListShared(old_v) ? CO_SHARE : CO_COPY, DC_EXEC, CMD_CLONE_ORDER);
-			new_v->cur_order_index = old_v->cur_order_index;
-			ChangeVehicleViewWindow(old_v, new_v);
-			new_v->profit_this_year = old_v->profit_this_year;
-			new_v->profit_last_year = old_v->profit_last_year;
-			new_v->service_interval = old_v->service_interval;
-			new_front = true;
-			new_v->unitnumber = old_v->unitnumber; // use the same unit number
-
-			new_v->current_order = old_v->current_order;
-			if (old_v->type == VEH_Train && GetNextVehicle(old_v) != NULL){
-				Vehicle *temp_v = GetNextVehicle(old_v);
-
-				// move the entire train to the new engine, excluding the old engine
-				if (IsMultiheaded(old_v) && temp_v == old_v->u.rail.other_multiheaded_part) {
-					// we got front and rear of a multiheaded engine right after each other. We should work with the next in line instead
-					temp_v = GetNextVehicle(temp_v);
-				}
-
-				if (temp_v != NULL) {
-					DoCommand(0, (new_v->index << 16) | temp_v->index, 1, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
-				}
-			}
-		}
-		/* We are done setting up the new vehicle. Now we move the cargo from the old one to the new one */
-		MoveVehicleCargo(new_v->type == VEH_Train ? GetFirstVehicleInChain(new_v) : new_v, old_v);
-
-		// Get the name of the old vehicle if it has a custom name.
-		if (!IsCustomName(old_v->string_id)) {
-			vehicle_name[0] = '\0';
-		} else {
-			GetName(vehicle_name, old_v->string_id & 0x7FF, lastof(vehicle_name));
-		}
-	} else { // flags & DC_EXEC not set
-		/* Ensure that the player will not end up having negative money while autoreplacing
-		 * This is needed because the only other check is done after the income from selling the old vehicle is substracted from the cost */
-		if (p->money64 < (cost + total_cost)) {
-			SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-			SubtractMoneyFromPlayer(-sell_value); // Pay back the loan
-			return CMD_ERROR;
-		}
-	}
-
-	/* Take back the money we just gave the player just before building the vehicle
-	 * The player will get the same amount now that the sale actually takes place */
-	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
-	SubtractMoneyFromPlayer(-sell_value);
-
-	/* sell the engine/ find out how much you get for the old engine (income is returned as negative cost) */
-	cost += DoCommand(0, old_v->index, 0, flags, GetCmdSellVeh(old_v));
-
-	if (new_front) {
-		/* now we assign the old unitnumber to the new vehicle */
-		new_v->unitnumber = cached_unitnumber;
-	}
-
-	/* Transfer the name of the old vehicle */
-	if ((flags & DC_EXEC) && vehicle_name[0] != '\0') {
-		_cmd_text = vehicle_name;
-		DoCommand(0, new_v->index, 0, DC_EXEC, CMD_NAME_VEHICLE);
-	}
-
-	return cost;
-}
-
-/** replaces a vehicle if it's set for autoreplace or is too old
- * (used to be called autorenew)
- * @param v The vehicle to replace
- * if the vehicle is a train, v needs to be the front engine
- * @param check Checks if the replace is valid. No action is done at all
- * @param display_costs If set, a cost animation is shown (only if check is false)
- * @return CMD_ERROR if something went wrong. Otherwise the price of the replace
- */
-static int32 MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs)
-{
-	Vehicle *w;
-	const Player *p = GetPlayer(v->owner);
-	byte flags = 0;
-	int32 cost, temp_cost = 0;
-	bool stopped;
-
-	/* Remember the length in case we need to trim train later on
-	 * If it's not a train, the value is unused
-	 * round up to the length of the tiles used for the train instead of the train length instead
-	 * Useful when newGRF uses custom length */
-	uint16 old_total_length = (v->type == VEH_Train ?
-		(v->u.rail.cached_total_length + TILE_SIZE - 1) / TILE_SIZE * TILE_SIZE :
-		-1
-	);
-
-
-	_current_player = v->owner;
-
-	assert(IsPlayerBuildableVehicleType(v));
-
-	assert(v->vehstatus & VS_STOPPED); // the vehicle should have been stopped in VehicleEnteredDepotThisTick() if needed
-
-	/* Remember the flag v->leave_depot_instantly because if we replace the vehicle, the vehicle holding this flag will be sold
-	 * If it is set, then we only stopped the vehicle to replace it (if needed) and we will need to start it again.
-	 * We also need to reset the flag since it should remain false except from when the vehicle enters a depot until autoreplace is handled in the same tick */
-	stopped = v->leave_depot_instantly;
-	v->leave_depot_instantly = false;
-
-	for (;;) {
-		cost = 0;
-		w = v;
-		do {
-			if (w->type == VEH_Train && IsMultiheaded(w) && !IsTrainEngine(w)) {
-				/* we build the rear ends of multiheaded trains with the front ones */
-				continue;
-			}
-
-			// check if the vehicle should be replaced
-			if (!p->engine_renew ||
-					w->age - w->max_age < (p->engine_renew_months * 30) || // replace if engine is too old
-					w->max_age == 0) { // rail cars got a max age of 0
-				if (!EngineHasReplacementForPlayer(p, w->engine_type)) // updates to a new model
-					continue;
-			}
-
-			/* Now replace the vehicle */
-			temp_cost = ReplaceVehicle(&w, flags, cost);
-
-			if (flags & DC_EXEC &&
-					(w->type != VEH_Train || w->u.rail.first_engine == INVALID_ENGINE)) {
-				/* now we bought a new engine and sold the old one. We need to fix the
-				 * pointers in order to avoid pointing to the old one for trains: these
-				 * pointers should point to the front engine and not the cars
-				 */
-				v = w;
-			}
-
-			if (!CmdFailed(temp_cost)) {
-				cost += temp_cost;
-			}
-		} while (w->type == VEH_Train && (w = GetNextVehicle(w)) != NULL);
-
-		if (!(flags & DC_EXEC) && (p->money64 < (int32)(cost + p->engine_renew_money) || cost == 0)) {
-			if (!check && p->money64 < (int32)(cost + p->engine_renew_money) && ( _local_player == v->owner ) && cost != 0) {
-				StringID message;
-				SetDParam(0, v->unitnumber);
-				switch (v->type) {
-					case VEH_Train:    message = STR_TRAIN_AUTORENEW_FAILED;       break;
-					case VEH_Road:     message = STR_ROADVEHICLE_AUTORENEW_FAILED; break;
-					case VEH_Ship:     message = STR_SHIP_AUTORENEW_FAILED;        break;
-					case VEH_Aircraft: message = STR_AIRCRAFT_AUTORENEW_FAILED;    break;
-						// This should never happen
-					default: NOT_REACHED(); message = 0; break;
-				}
-
-				AddNewsItem(message, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0), v->index, 0);
-			}
-			if (stopped) v->vehstatus &= ~VS_STOPPED;
-			if (display_costs) _current_player = OWNER_NONE;
-			return CMD_ERROR;
-		}
-
-		if (flags & DC_EXEC) {
-			break; // we are done replacing since the loop ran once with DC_EXEC
-		} else if (check) {
-			/* It's a test only and we know that we can do this
-			 * NOTE: payment for wagon removal is NOT included in this price */
-			return cost;
-		}
-		// now we redo the loop, but this time we actually do stuff since we know that we can do it
-		flags |= DC_EXEC;
-	}
-
-	/* If setting is on to try not to exceed the old length of the train with the replacement */
-	if (v->type == VEH_Train && p->renew_keep_length) {
-		Vehicle *temp;
-		w = v;
-
-		while (v->u.rail.cached_total_length > old_total_length) {
-			// the train is too long. We will remove cars one by one from the start of the train until it's short enough
-			while (w != NULL && RailVehInfo(w->engine_type)->railveh_type != RAILVEH_WAGON) {
-				w = GetNextVehicle(w);
-			}
-			if (w == NULL) {
-				// we failed to make the train short enough
-				SetDParam(0, v->unitnumber);
-				AddNewsItem(STR_TRAIN_TOO_LONG_AFTER_REPLACEMENT, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0), v->index, 0);
-				break;
-			}
-			temp = w;
-			w = GetNextVehicle(w);
-			DoCommand(0, (INVALID_VEHICLE << 16) | temp->index, 0, DC_EXEC, CMD_MOVE_RAIL_VEHICLE);
-			MoveVehicleCargo(v, temp);
-			cost += DoCommand(0, temp->index, 0, DC_EXEC, CMD_SELL_RAIL_WAGON);
-		}
-	}
-
-	if (stopped) v->vehstatus &= ~VS_STOPPED;
-	if (display_costs) {
-		if (IsLocalPlayer()) ShowCostOrIncomeAnimation(v->x_pos, v->y_pos, v->z_pos, cost);
-		_current_player = OWNER_NONE;
-	}
-	return cost;
-}
 
 /* Extend the list size for BuildDepotVehicleList() */
 static inline void ExtendVehicleListSize(const Vehicle ***engine_list, uint16 *engine_list_length, uint16 step_size)
@@ -2307,8 +1911,8 @@
 	Vehicle *v;
 
 	/* This function should never be called without an array to store results */
-	assert(!(engine_list == NULL && type != VEH_Train));
-	assert(!(type == VEH_Train && engine_list == NULL && wagon_list == NULL));
+	assert(!(engine_list == NULL && type != VEH_TRAIN));
+	assert(!(type == VEH_TRAIN && engine_list == NULL && wagon_list == NULL));
 
 	/* Both array and the length should either be NULL to disable the list or both should not be NULL */
 	assert((engine_list == NULL && engine_list_length == NULL) || (engine_list != NULL && engine_list_length != NULL));
@@ -2321,9 +1925,9 @@
 	if (wagon_count != NULL) *wagon_count = 0;
 
 	switch (type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			FOR_ALL_VEHICLES(v) {
-				if (v->tile == tile && v->type == VEH_Train && v->u.rail.track == TRACK_BIT_DEPOT) {
+				if (v->tile == tile && v->type == VEH_TRAIN && v->u.rail.track == TRACK_BIT_DEPOT) {
 					if (IsFrontEngine(v)) {
 						if (engine_list == NULL) continue;
 						if (*engine_count == *engine_list_length) ExtendVehicleListSize((const Vehicle***)engine_list, engine_list_length, 25);
@@ -2337,28 +1941,28 @@
 			}
 			break;
 
-		case VEH_Road:
+		case VEH_ROAD:
 			FOR_ALL_VEHICLES(v) {
-				if (v->tile == tile && v->type == VEH_Road && IsRoadVehInDepot(v)) {
+				if (v->tile == tile && v->type == VEH_ROAD && IsRoadVehInDepot(v)) {
 					if (*engine_count == *engine_list_length) ExtendVehicleListSize((const Vehicle***)engine_list, engine_list_length, 25);
 					(*engine_list)[(*engine_count)++] = v;
 				}
 			}
 			break;
 
-		case VEH_Ship:
+		case VEH_SHIP:
 			FOR_ALL_VEHICLES(v) {
-				if (v->tile == tile && v->type == VEH_Ship && IsShipInDepot(v)) {
+				if (v->tile == tile && v->type == VEH_SHIP && IsShipInDepot(v)) {
 					if (*engine_count == *engine_list_length) ExtendVehicleListSize((const Vehicle***)engine_list, engine_list_length, 25);
 					(*engine_list)[(*engine_count)++] = v;
 				}
 			}
 			break;
 
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			FOR_ALL_VEHICLES(v) {
 				if (v->tile == tile &&
-						v->type == VEH_Aircraft && IsNormalAircraft(v) &&
+						v->type == VEH_AIRCRAFT && IsNormalAircraft(v) &&
 						v->vehstatus & VS_HIDDEN) {
 					if (*engine_count == *engine_list_length) ExtendVehicleListSize((const Vehicle***)engine_list, engine_list_length, 25);
 					(*engine_list)[(*engine_count)++] = v;
@@ -2385,7 +1989,7 @@
 */
 uint GenerateVehicleSortList(const Vehicle ***sort_list, uint16 *length_of_array, byte type, PlayerID owner, uint32 index, uint16 window_type)
 {
-	const byte subtype = (type != VEH_Aircraft) ? (byte)Train_Front : (byte)AIR_AIRCRAFT;
+	const byte subtype = (type != VEH_AIRCRAFT) ? (byte)Train_Front : (byte)AIR_AIRCRAFT;
 	uint n = 0;
 	const Vehicle *v;
 
@@ -2393,8 +1997,8 @@
 		case VLW_STATION_LIST: {
 			FOR_ALL_VEHICLES(v) {
 				if (v->type == type && (
-					(type == VEH_Train && IsFrontEngine(v)) ||
-					(type != VEH_Train && v->subtype <= subtype))) {
+					(type == VEH_TRAIN && IsFrontEngine(v)) ||
+					(type != VEH_TRAIN && v->subtype <= subtype))) {
 					const Order *order;
 
 					FOR_VEHICLE_ORDERS(v, order) {
@@ -2428,8 +2032,8 @@
 		case VLW_STANDARD: {
 			FOR_ALL_VEHICLES(v) {
 				if (v->type == type && v->owner == owner && (
-					(type == VEH_Train && IsFrontEngine(v)) ||
-					(type != VEH_Train && v->subtype <= subtype))) {
+					(type == VEH_TRAIN && IsFrontEngine(v)) ||
+					(type != VEH_TRAIN && v->subtype <= subtype))) {
 					/* TODO find a better estimate on the total number of vehicles for current player */
 					if (n == *length_of_array) ExtendVehicleListSize(sort_list, length_of_array, GetNumVehicles()/4);
 					(*sort_list)[n++] = v;
@@ -2441,8 +2045,8 @@
 		case VLW_DEPOT_LIST: {
 			FOR_ALL_VEHICLES(v) {
 				if (v->type == type && (
-					(type == VEH_Train && IsFrontEngine(v)) ||
-					(type != VEH_Train && v->subtype <= subtype))) {
+					(type == VEH_TRAIN && IsFrontEngine(v)) ||
+					(type != VEH_TRAIN && v->subtype <= subtype))) {
 					const Order *order;
 
 					FOR_VEHICLE_ORDERS(v, order) {
@@ -2510,10 +2114,10 @@
 bool IsVehicleInDepot(const Vehicle *v)
 {
 	switch (v->type) {
-		case VEH_Train:    return CheckTrainInDepot(v, false) != -1;
-		case VEH_Road:     return IsRoadVehInDepot(v);
-		case VEH_Ship:     return IsShipInDepot(v);
-		case VEH_Aircraft: return IsAircraftInHangar(v);
+		case VEH_TRAIN:    return CheckTrainInDepot(v, false) != -1;
+		case VEH_ROAD:     return IsRoadVehInDepot(v);
+		case VEH_SHIP:     return IsShipInDepot(v);
+		case VEH_AIRCRAFT: return IsAircraftInHangar(v);
 		default: NOT_REACHED();
 	}
 	return false;
@@ -2522,32 +2126,32 @@
 void VehicleEnterDepot(Vehicle *v)
 {
 	switch (v->type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			InvalidateWindowClasses(WC_TRAINS_LIST);
 			if (!IsFrontEngine(v)) v = GetFirstVehicleInChain(v);
 			UpdateSignalsOnSegment(v->tile, GetRailDepotDirection(v->tile));
 			v->load_unload_time_rem = 0;
 			break;
 
-		case VEH_Road:
+		case VEH_ROAD:
 			InvalidateWindowClasses(WC_ROADVEH_LIST);
 			v->u.road.state = RVSB_IN_DEPOT;
 			break;
 
-		case VEH_Ship:
+		case VEH_SHIP:
 			InvalidateWindowClasses(WC_SHIPS_LIST);
 			v->u.ship.state = TRACK_BIT_DEPOT;
 			RecalcShipStuff(v);
 			break;
 
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			InvalidateWindowClasses(WC_AIRCRAFT_LIST);
 			HandleAircraftEnterHangar(v);
 			break;
 		default: NOT_REACHED();
 	}
 
-	if (v->type != VEH_Train) {
+	if (v->type != VEH_TRAIN) {
 		/* Trains update the vehicle list when the first unit enters the depot and calls VehicleEnterDepot() when the last unit enters.
 		 * We only increase the number of vehicles when the first one enters, so we will not need to search for more vehicles in the depot */
 		InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
@@ -2591,7 +2195,7 @@
 
 		if (HASBIT(t.flags, OFB_PART_OF_ORDERS)) {
 			/* Part of orders */
-			if (v->type == VEH_Train) v->u.rail.days_since_order_progr = 0;
+			if (v->type == VEH_TRAIN) v->u.rail.days_since_order_progr = 0;
 			v->cur_order_index++;
 		} else if (HASBIT(t.flags, OFB_HALT_IN_DEPOT)) {
 			/* Force depot visit */
@@ -2600,10 +2204,10 @@
 				StringID string;
 
 				switch (v->type) {
-					case VEH_Train:    string = STR_8814_TRAIN_IS_WAITING_IN_DEPOT; break;
-					case VEH_Road:     string = STR_9016_ROAD_VEHICLE_IS_WAITING;   break;
-					case VEH_Ship:     string = STR_981C_SHIP_IS_WAITING_IN_DEPOT;  break;
-					case VEH_Aircraft: string = STR_A014_AIRCRAFT_IS_WAITING_IN;    break;
+					case VEH_TRAIN:    string = STR_8814_TRAIN_IS_WAITING_IN_DEPOT; break;
+					case VEH_ROAD:     string = STR_9016_ROAD_VEHICLE_IS_WAITING;   break;
+					case VEH_SHIP:     string = STR_981C_SHIP_IS_WAITING_IN_DEPOT;  break;
+					case VEH_AIRCRAFT: string = STR_A014_AIRCRAFT_IS_WAITING_IN;    break;
 					default: NOT_REACHED(); string = STR_EMPTY; // Set the string to something to avoid a compiler warning
 				}
 
@@ -2744,7 +2348,7 @@
 	if (v->vehstatus & VS_CRASHED) return INVALID_TRACKDIR;
 
 	switch (v->type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			if (v->u.rail.track == TRACK_BIT_DEPOT) /* We'll assume the train is facing outwards */
 				return DiagdirToDiagTrackdir(GetRailDepotDirection(v->tile)); /* Train in depot */
 
@@ -2753,14 +2357,14 @@
 
 			return TrackDirectionToTrackdir(FindFirstTrack(v->u.rail.track), v->direction);
 
-		case VEH_Ship:
+		case VEH_SHIP:
 			if (IsShipInDepot(v))
 				/* We'll assume the ship is facing outwards */
 				return DiagdirToDiagTrackdir(GetShipDepotDirection(v->tile));
 
 			return TrackDirectionToTrackdir(FindFirstTrack(v->u.ship.state), v->direction);
 
-		case VEH_Road:
+		case VEH_ROAD:
 			if (IsRoadVehInDepot(v)) /* We'll assume the road vehicle is facing outwards */
 				return DiagdirToDiagTrackdir(GetRoadDepotDirection(v->tile));
 
@@ -2775,7 +2379,7 @@
 			/* Vehicle is turning around, get the direction from vehicle's direction */
 			return DiagdirToDiagTrackdir(DirToDiagDir(v->direction));
 
-		/* case VEH_Aircraft: case VEH_Special: case VEH_Disaster: */
+		/* case VEH_AIRCRAFT: case VEH_SPECIAL: case VEH_DISASTER: */
 		default: return INVALID_TRACKDIR;
 	}
 }
@@ -2797,10 +2401,10 @@
 	static UnitID gmax = 0;
 
 	switch (type) {
-		case VEH_Train:    max = _patches.max_trains; break;
-		case VEH_Road:     max = _patches.max_roadveh; break;
-		case VEH_Ship:     max = _patches.max_ships; break;
-		case VEH_Aircraft: max = _patches.max_aircraft; break;
+		case VEH_TRAIN:    max = _patches.max_trains; break;
+		case VEH_ROAD:     max = _patches.max_roadveh; break;
+		case VEH_SHIP:     max = _patches.max_ships; break;
+		case VEH_AIRCRAFT: max = _patches.max_aircraft; break;
 		default: NOT_REACHED();
 	}
 
@@ -2860,7 +2464,7 @@
 	if (p->livery[LS_DEFAULT].in_use && (_patches.liveries == 2 || (_patches.liveries == 1 && player == _local_player))) {
 		/* Determine the livery scheme to use */
 		switch (GetEngine(engine_type)->type) {
-			case VEH_Train: {
+			case VEH_TRAIN: {
 				const RailVehicleInfo *rvi = RailVehInfo(engine_type);
 
 				switch (rvi->railtype) {
@@ -2901,21 +2505,21 @@
 				break;
 			}
 
-			case VEH_Road: {
+			case VEH_ROAD: {
 				const RoadVehicleInfo *rvi = RoadVehInfo(engine_type);
 				if (cargo_type == CT_INVALID) cargo_type = rvi->cargo_type;
-				scheme = (cargo_type == CT_PASSENGERS) ? LS_BUS : LS_TRUCK;
+				scheme = IsCargoInClass(cargo_type, CC_PASSENGERS) ? LS_BUS : LS_TRUCK;
 				break;
 			}
 
-			case VEH_Ship: {
+			case VEH_SHIP: {
 				const ShipVehicleInfo *svi = ShipVehInfo(engine_type);
 				if (cargo_type == CT_INVALID) cargo_type = svi->cargo_type;
-				scheme = (cargo_type == CT_PASSENGERS) ? LS_PASSENGER_SHIP : LS_FREIGHT_SHIP;
+				scheme = IsCargoInClass(cargo_type, CC_PASSENGERS) ? LS_PASSENGER_SHIP : LS_FREIGHT_SHIP;
 				break;
 			}
 
-			case VEH_Aircraft: {
+			case VEH_AIRCRAFT: {
 				const AircraftVehicleInfo *avi = AircraftVehInfo(engine_type);
 				if (cargo_type == CT_INVALID) cargo_type = CT_PASSENGERS;
 				switch (avi->subtype) {
@@ -2948,7 +2552,7 @@
 
 SpriteID GetVehiclePalette(const Vehicle *v)
 {
-	if (v->type == VEH_Train) {
+	if (v->type == VEH_TRAIN) {
 		return GetEngineColourMap(
 			(v->u.rail.first_engine != INVALID_ENGINE && (IsArticulatedPart(v) || UsesWagonOverride(v))) ?
 				v->u.rail.first_engine : v->engine_type,
@@ -3071,7 +2675,7 @@
 
 
 static const SaveLoad _train_desc[] = {
-	SLE_WRITEBYTE(Vehicle, type, VEH_Train, 0), // Train type. VEH_Train in mem, 0 in file.
+	SLE_WRITEBYTE(Vehicle, type, VEH_TRAIN, 0), // Train type. VEH_TRAIN in mem, 0 in file.
 	SLE_INCLUDEX(0, INC_VEHICLE_COMMON),
 	    SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleRail, crash_anim_pos),         SLE_UINT16),
 	    SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleRail, force_proceed),          SLE_UINT8),
@@ -3089,7 +2693,7 @@
 };
 
 static const SaveLoad _roadveh_desc[] = {
-	SLE_WRITEBYTE(Vehicle, type, VEH_Road, 1), // Road type. VEH_Road in mem, 1 in file.
+	SLE_WRITEBYTE(Vehicle, type, VEH_ROAD, 1), // Road type. VEH_ROAD in mem, 1 in file.
 	SLE_INCLUDEX(0, INC_VEHICLE_COMMON),
 	    SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleRoad, state),          SLE_UINT8),
 	    SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleRoad, frame),          SLE_UINT8),
@@ -3109,7 +2713,7 @@
 };
 
 static const SaveLoad _ship_desc[] = {
-	SLE_WRITEBYTE(Vehicle, type, VEH_Ship, 2), // Ship type. VEH_Ship in mem, 2 in file.
+	SLE_WRITEBYTE(Vehicle, type, VEH_SHIP, 2), // Ship type. VEH_SHIP in mem, 2 in file.
 	SLE_INCLUDEX(0, INC_VEHICLE_COMMON),
 	SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleShip, state), SLE_UINT8),
 
@@ -3120,7 +2724,7 @@
 };
 
 static const SaveLoad _aircraft_desc[] = {
-	SLE_WRITEBYTE(Vehicle, type, VEH_Aircraft, 3), // Aircraft type. VEH_Aircraft in mem, 3 in file.
+	SLE_WRITEBYTE(Vehicle, type, VEH_AIRCRAFT, 3), // Aircraft type. VEH_AIRCRAFT in mem, 3 in file.
 	SLE_INCLUDEX(0, INC_VEHICLE_COMMON),
 	    SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleAir, crashed_counter), SLE_UINT16),
 	    SLE_VARX(offsetof(Vehicle, u) + offsetof(VehicleAir, pos),             SLE_UINT8),
@@ -3139,7 +2743,7 @@
 };
 
 static const SaveLoad _special_desc[] = {
-	SLE_WRITEBYTE(Vehicle,type,VEH_Special, 4),
+	SLE_WRITEBYTE(Vehicle,type,VEH_SPECIAL, 4),
 
 	    SLE_VAR(Vehicle, subtype,       SLE_UINT8),
 
@@ -3171,7 +2775,7 @@
 };
 
 static const SaveLoad _disaster_desc[] = {
-	SLE_WRITEBYTE(Vehicle, type, VEH_Disaster, 5),
+	SLE_WRITEBYTE(Vehicle, type, VEH_DISASTER, 5),
 
 	    SLE_REF(Vehicle, next,          REF_VEHICLE_OLD),
 
@@ -3223,7 +2827,7 @@
 };
 
 // Will be called when the vehicles need to be saved.
-static void Save_VEHS(void)
+static void Save_VEHS()
 {
 	Vehicle *v;
 	// Write the vehicles
@@ -3234,7 +2838,7 @@
 }
 
 // Will be called when vehicles need to be loaded.
-static void Load_VEHS(void)
+static void Load_VEHS()
 {
 	int index;
 	Vehicle *v;
@@ -3284,13 +2888,13 @@
 
 void Vehicle::BeginLoading()
 {
-	assert(IsTileType(tile, MP_STATION) || type == VEH_Ship);
+	assert(IsTileType(tile, MP_STATION) || type == VEH_SHIP);
 	current_order.type = OT_LOADING;
 }
 
 void Vehicle::LeaveStation()
 {
-	assert(IsTileType(tile, MP_STATION) || type == VEH_Ship);
+	assert(IsTileType(tile, MP_STATION) || type == VEH_SHIP);
 	assert(current_order.type == OT_LOADING);
 	current_order.type = OT_LEAVESTATION;
 	current_order.flags = 0;
--- a/src/vehicle.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/vehicle.h	Mon Mar 19 12:38:16 2007 +0000
@@ -63,13 +63,13 @@
 };
 
 enum {
-	VEH_Train,
-	VEH_Road,
-	VEH_Ship,
-	VEH_Aircraft,
-	VEH_Special,
-	VEH_Disaster,
-	VEH_Invalid = 0xFF,
+	VEH_TRAIN,
+	VEH_ROAD,
+	VEH_SHIP,
+	VEH_AIRCRAFT,
+	VEH_SPECIAL,
+	VEH_DISASTER,
+	VEH_INVALID = 0xFF,
 } ;
 
 enum VehStatus {
@@ -90,7 +90,7 @@
 };
 
 /* Effect vehicle types */
-typedef enum EffectVehicle {
+enum EffectVehicle {
 	EV_CHIMNEY_SMOKE   = 0,
 	EV_STEAM_SMOKE     = 1,
 	EV_DIESEL_SMOKE    = 2,
@@ -101,9 +101,9 @@
 	EV_EXPLOSION_SMALL = 7,
 	EV_BULLDOZER       = 8,
 	EV_BUBBLE          = 9
-} EffectVehicle;
+};
 
-typedef struct VehicleRail {
+struct VehicleRail {
 	uint16 last_speed; // NOSAVE: only used in UI
 	uint16 crash_anim_pos;
 	uint16 days_since_order_progr;
@@ -140,7 +140,7 @@
 
 	// Link between the two ends of a multiheaded engine
 	Vehicle *other_multiheaded_part;
-} VehicleRail;
+};
 
 enum {
 	VRF_REVERSING         = 0,
@@ -162,15 +162,15 @@
 	VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL = 6,
 };
 
-typedef struct VehicleAir {
+struct VehicleAir {
 	uint16 crashed_counter;
 	byte pos;
 	byte previous_pos;
 	StationID targetairport;
 	byte state;
-} VehicleAir;
+};
 
-typedef struct VehicleRoad {
+struct VehicleRoad {
 	byte state;             /// @see RoadVehicleStates
 	byte frame;
 	uint16 blocked_ctr;
@@ -180,21 +180,21 @@
 	byte reverse_ctr;
 	struct RoadStop *slot;
 	byte slot_age;
-} VehicleRoad;
+};
 
-typedef struct VehicleSpecial {
+struct VehicleSpecial {
 	uint16 unk0;
 	byte unk2;
-} VehicleSpecial;
+};
 
-typedef struct VehicleDisaster {
+struct VehicleDisaster {
 	uint16 image_override;
 	uint16 unk2;
-} VehicleDisaster;
+};
 
-typedef struct VehicleShip {
+struct VehicleShip {
 	TrackBitsByte state;
-} VehicleShip;
+};
 
 
 struct Vehicle {
@@ -322,12 +322,12 @@
 typedef void *VehicleFromPosProc(Vehicle *v, void *data);
 
 void VehicleServiceInDepot(Vehicle *v);
-Vehicle *AllocateVehicle(void);
+Vehicle *AllocateVehicle();
 bool AllocateVehicles(Vehicle **vl, int num);
-Vehicle *ForceAllocateVehicle(void);
-Vehicle *ForceAllocateSpecialVehicle(void);
+Vehicle *ForceAllocateVehicle();
+Vehicle *ForceAllocateSpecialVehicle();
 void VehiclePositionChanged(Vehicle *v);
-void AfterLoadVehicles(void);
+void AfterLoadVehicles();
 Vehicle *GetLastVehicleInChain(Vehicle *v);
 Vehicle *GetPrevVehicleInChain(const Vehicle *v);
 Vehicle *GetFirstVehicleInChain(const Vehicle *v);
@@ -335,12 +335,12 @@
 bool IsEngineCountable(const Vehicle *v);
 void DeleteVehicleChain(Vehicle *v);
 void *VehicleFromPos(TileIndex tile, void *data, VehicleFromPosProc *proc);
-void CallVehicleTicks(void);
+void CallVehicleTicks();
 Vehicle *FindVehicleOnTileZ(TileIndex tile, byte z);
 
-void InitializeTrains(void);
-byte VehicleRandomBits(void);
-void ResetVehiclePosHash(void);
+void InitializeTrains();
+byte VehicleRandomBits();
+void ResetVehiclePosHash();
 
 bool CanFillVehicle(Vehicle *v);
 bool CanRefitTo(EngineID engine_type, CargoID cid_to);
@@ -400,6 +400,8 @@
 
 void InvalidateAutoreplaceWindow(EngineID e);
 
+int32 MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs);
+
 /* Flags to add to p2 for goto depot commands */
 /* Note: bits 8-10 are used for VLW flags */
 enum {
@@ -409,11 +411,11 @@
 	DEPOT_LOCATE_HANGAR = (1 << 3), // Find another airport if the target one lacks a hangar
 };
 
-typedef struct GetNewVehiclePosResult {
+struct GetNewVehiclePosResult {
 	int x,y;
 	TileIndex old_tile;
 	TileIndex new_tile;
-} GetNewVehiclePosResult;
+};
 
 /**
  * Returns the Trackdir on which the vehicle is currently located.
@@ -437,7 +439,7 @@
 
 DECLARE_OLD_POOL(Vehicle, Vehicle, 9, 125)
 
-static inline VehicleID GetMaxVehicleIndex(void)
+static inline VehicleID GetMaxVehicleIndex()
 {
 	/* TODO - This isn't the real content of the function, but
 	 *  with the new pool-system this will be replaced with one that
@@ -447,7 +449,7 @@
 	return GetVehiclePoolSize() - 1;
 }
 
-static inline uint GetNumVehicles(void)
+static inline uint GetNumVehicles()
 {
 	return GetVehiclePoolSize();
 }
@@ -457,7 +459,7 @@
  */
 static inline bool IsValidVehicle(const Vehicle *v)
 {
-	return v->type != VEH_Invalid;
+	return v->type != VEH_INVALID;
 }
 
 void DestroyVehicle(Vehicle *v);
@@ -465,16 +467,16 @@
 static inline void DeleteVehicle(Vehicle *v)
 {
 	DestroyVehicle(v);
-	v->type = VEH_Invalid;
+	v->type = VEH_INVALID;
 }
 
 static inline bool IsPlayerBuildableVehicleType(byte type)
 {
 	switch (type) {
-		case VEH_Train:
-		case VEH_Road:
-		case VEH_Ship:
-		case VEH_Aircraft:
+		case VEH_TRAIN:
+		case VEH_ROAD:
+		case VEH_SHIP:
+		case VEH_AIRCRAFT:
 			return true;
 	}
 	return false;
--- a/src/vehicle_gui.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/vehicle_gui.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -30,22 +30,22 @@
 #include "helpers.hpp"
 #include "cargotype.h"
 
-typedef struct Sorting {
+struct Sorting {
 	Listing aircraft;
 	Listing roadveh;
 	Listing ship;
 	Listing train;
-} Sorting;
+};
 
 static Sorting _sorting;
 
-typedef struct vehiclelist_d {
+struct vehiclelist_d {
 	const Vehicle** sort_list;  // List of vehicles (sorted)
 	Listing *_sorting;          // pointer to the appropiate subcategory of _sorting
 	uint16 length_of_sort_list; // Keeps track of how many vehicle pointers sort list got space for
 	byte vehicle_type;          // The vehicle type that is sorted
 	list_d l;                   // General list struct
-} vehiclelist_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vehiclelist_d));
 
 static bool   _internal_sort_order;     // descending/ascending
@@ -90,7 +90,7 @@
 	INVALID_STRING_ID
 };
 
-void RebuildVehicleLists(void)
+void RebuildVehicleLists()
 {
 	Window* const *wz;
 
@@ -111,7 +111,7 @@
 	}
 }
 
-void ResortVehicleLists(void)
+void ResortVehicleLists()
 {
 	Window* const *wz;
 
@@ -180,17 +180,17 @@
 	DrawSprite(SPR_BLOT, pal, x, y);
 }
 
-typedef struct RefitOption {
+struct RefitOption {
 	CargoID cargo;
 	byte subtype;
 	uint16 value;
 	EngineID engine;
-} RefitOption;
+};
 
-typedef struct RefitList {
+struct RefitList {
 	uint num_lines;
 	RefitOption *items;
-} RefitList;
+};
 
 static RefitList *BuildRefitList(const Vehicle *v)
 {
@@ -267,7 +267,7 @@
 				}
 			}
 		}
-	} while (v->type == VEH_Train && (u = u->next) != NULL && num_lines < max_lines);
+	} while (v->type == VEH_TRAIN && (u = u->next) != NULL && num_lines < max_lines);
 
 	list->num_lines = num_lines;
 	list->items = refit;
@@ -320,7 +320,7 @@
 		case WE_PAINT: {
 			Vehicle *v = GetVehicle(w->window_number);
 
-			if (v->type == VEH_Train) {
+			if (v->type == VEH_TRAIN) {
 				uint length = CountVehiclesInChain(v);
 
 				if (length != WP(w, refit_d).length) {
@@ -372,10 +372,10 @@
 							int command = 0;
 
 							switch (v->type) {
-								case VEH_Train:    command = CMD_REFIT_RAIL_VEHICLE | CMD_MSG(STR_RAIL_CAN_T_REFIT_VEHICLE);  break;
-								case VEH_Road:     command = CMD_REFIT_ROAD_VEH     | CMD_MSG(STR_REFIT_ROAD_VEHICLE_CAN_T);  break;
-								case VEH_Ship:     command = CMD_REFIT_SHIP         | CMD_MSG(STR_9841_CAN_T_REFIT_SHIP);     break;
-								case VEH_Aircraft: command = CMD_REFIT_AIRCRAFT     | CMD_MSG(STR_A042_CAN_T_REFIT_AIRCRAFT); break;
+								case VEH_TRAIN:    command = CMD_REFIT_RAIL_VEHICLE | CMD_MSG(STR_RAIL_CAN_T_REFIT_VEHICLE);  break;
+								case VEH_ROAD:     command = CMD_REFIT_ROAD_VEH     | CMD_MSG(STR_REFIT_ROAD_VEHICLE_CAN_T);  break;
+								case VEH_SHIP:     command = CMD_REFIT_SHIP         | CMD_MSG(STR_9841_CAN_T_REFIT_SHIP);     break;
+								case VEH_AIRCRAFT: command = CMD_REFIT_AIRCRAFT     | CMD_MSG(STR_A042_CAN_T_REFIT_AIRCRAFT); break;
 							}
 							if (DoCommandP(v->tile, v->index, WP(w,refit_d).cargo->cargo | WP(w,refit_d).cargo->subtype << 8, NULL, command)) DeleteWindow(w);
 						} else {
@@ -437,26 +437,26 @@
 		w->resize.step_height = 14;
 		WP(w, refit_d).sel  = -1;
 		WP(w, refit_d).list = BuildRefitList(v);
-		if (v->type == VEH_Train) WP(w, refit_d).length = CountVehiclesInChain(v);
+		if (v->type == VEH_TRAIN) WP(w, refit_d).length = CountVehiclesInChain(v);
 		SetVScrollCount(w, WP(w, refit_d).list->num_lines);
 
 		switch (v->type) {
-			case VEH_Train:
+			case VEH_TRAIN:
 				w->widget[3].tooltips = STR_RAIL_SELECT_TYPE_OF_CARGO_FOR;
 				w->widget[6].data     = STR_RAIL_REFIT_VEHICLE;
 				w->widget[6].tooltips = STR_RAIL_REFIT_TO_CARRY_HIGHLIGHTED;
 				break;
-			case VEH_Road:
+			case VEH_ROAD:
 				w->widget[3].tooltips = STR_ROAD_SELECT_TYPE_OF_CARGO_FOR;
 				w->widget[6].data     = STR_REFIT_ROAD_VEHICLE;
 				w->widget[6].tooltips = STR_REFIT_ROAD_VEHICLE_TO_CARRY_HIGHLIGHTED;
 				break;
-			case VEH_Ship:
+			case VEH_SHIP:
 				w->widget[3].tooltips = STR_983D_SELECT_TYPE_OF_CARGO_FOR;
 				w->widget[6].data     = STR_983C_REFIT_SHIP;
 				w->widget[6].tooltips = STR_983E_REFIT_SHIP_TO_CARRY_HIGHLIGHTED;
 				break;
-			case VEH_Aircraft:
+			case VEH_AIRCRAFT:
 				w->widget[3].tooltips = STR_A03E_SELECT_TYPE_OF_CARGO_FOR;
 				w->widget[6].data     = STR_A03D_REFIT_AIRCRAFT;
 				w->widget[6].tooltips = STR_A03F_REFIT_AIRCRAFT_TO_CARRY;
@@ -652,7 +652,7 @@
 	int r;
 	const Vehicle *ua = va, *ub = vb;
 
-	if (va->type == VEH_Train && vb->type == VEH_Train) {
+	if (va->type == VEH_TRAIN && vb->type == VEH_TRAIN) {
 		do {
 			if (RailVehInfo(ua->engine_type)->max_speed != 0)
 				max_speed_a = min(max_speed_a, RailVehInfo(ua->engine_type)->max_speed);
@@ -702,7 +702,7 @@
 	return (_internal_sort_order & 1) ? -r : r;
 }
 
-void InitializeGUI(void)
+void InitializeGUI()
 {
 	memset(&_sorting, 0, sizeof(_sorting));
 }
@@ -826,22 +826,22 @@
 
 	/* Set up the window widgets */
 	switch (vl->vehicle_type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			w->widget[VLW_WIDGET_LIST].tooltips          = STR_883D_TRAINS_CLICK_ON_TRAIN_FOR;
 			w->widget[VLW_WIDGET_AVAILABLE_VEHICLES].data = STR_AVAILABLE_TRAINS;
 			break;
 
-		case VEH_Road:
+		case VEH_ROAD:
 			w->widget[VLW_WIDGET_LIST].tooltips          = STR_901A_ROAD_VEHICLES_CLICK_ON;
 			w->widget[VLW_WIDGET_AVAILABLE_VEHICLES].data = STR_AVAILABLE_ROAD_VEHICLES;
 			break;
 
-		case VEH_Ship:
+		case VEH_SHIP:
 			w->widget[VLW_WIDGET_LIST].tooltips          = STR_9823_SHIPS_CLICK_ON_SHIP_FOR;
 			w->widget[VLW_WIDGET_AVAILABLE_VEHICLES].data = STR_AVAILABLE_SHIPS;
 			break;
 
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			w->widget[VLW_WIDGET_LIST].tooltips          = STR_A01F_AIRCRAFT_CLICK_ON_AIRCRAFT;
 			w->widget[VLW_WIDGET_AVAILABLE_VEHICLES].data = STR_AVAILABLE_AIRCRAFT;
 			break;
@@ -855,29 +855,29 @@
 			break;
 		case VLW_STANDARD: /* Company Name - standard widget setup */
 			switch (vl->vehicle_type) {
-				case VEH_Train:    w->widget[VLW_WIDGET_CAPTION].data = STR_881B_TRAINS;        break;
-				case VEH_Road:     w->widget[VLW_WIDGET_CAPTION].data = STR_9001_ROAD_VEHICLES; break;
-				case VEH_Ship:     w->widget[VLW_WIDGET_CAPTION].data = STR_9805_SHIPS;         break;
-				case VEH_Aircraft: w->widget[VLW_WIDGET_CAPTION].data = STR_A009_AIRCRAFT;      break;
+				case VEH_TRAIN:    w->widget[VLW_WIDGET_CAPTION].data = STR_881B_TRAINS;        break;
+				case VEH_ROAD:     w->widget[VLW_WIDGET_CAPTION].data = STR_9001_ROAD_VEHICLES; break;
+				case VEH_SHIP:     w->widget[VLW_WIDGET_CAPTION].data = STR_9805_SHIPS;         break;
+				case VEH_AIRCRAFT: w->widget[VLW_WIDGET_CAPTION].data = STR_A009_AIRCRAFT;      break;
 				default: NOT_REACHED(); break;
 			}
 			break;
 		case VLW_STATION_LIST: /* Station Name */
 			switch (vl->vehicle_type) {
-				case VEH_Train:    w->widget[VLW_WIDGET_CAPTION].data = STR_SCHEDULED_TRAINS;        break;
-				case VEH_Road:     w->widget[VLW_WIDGET_CAPTION].data = STR_SCHEDULED_ROAD_VEHICLES; break;
-				case VEH_Ship:     w->widget[VLW_WIDGET_CAPTION].data = STR_SCHEDULED_SHIPS;         break;
-				case VEH_Aircraft: w->widget[VLW_WIDGET_CAPTION].data = STR_SCHEDULED_AIRCRAFT;      break;
+				case VEH_TRAIN:    w->widget[VLW_WIDGET_CAPTION].data = STR_SCHEDULED_TRAINS;        break;
+				case VEH_ROAD:     w->widget[VLW_WIDGET_CAPTION].data = STR_SCHEDULED_ROAD_VEHICLES; break;
+				case VEH_SHIP:     w->widget[VLW_WIDGET_CAPTION].data = STR_SCHEDULED_SHIPS;         break;
+				case VEH_AIRCRAFT: w->widget[VLW_WIDGET_CAPTION].data = STR_SCHEDULED_AIRCRAFT;      break;
 				default: NOT_REACHED(); break;
 			}
 			break;
 
 		case VLW_DEPOT_LIST:
 			switch (vl->vehicle_type) {
-				case VEH_Train:    w->widget[VLW_WIDGET_CAPTION].data = STR_VEHICLE_LIST_TRAIN_DEPOT;    break;
-				case VEH_Road:     w->widget[VLW_WIDGET_CAPTION].data = STR_VEHICLE_LIST_ROADVEH_DEPOT;  break;
-				case VEH_Ship:     w->widget[VLW_WIDGET_CAPTION].data = STR_VEHICLE_LIST_SHIP_DEPOT;     break;
-				case VEH_Aircraft: w->widget[VLW_WIDGET_CAPTION].data = STR_VEHICLE_LIST_AIRCRAFT_DEPOT; break;
+				case VEH_TRAIN:    w->widget[VLW_WIDGET_CAPTION].data = STR_VEHICLE_LIST_TRAIN_DEPOT;    break;
+				case VEH_ROAD:     w->widget[VLW_WIDGET_CAPTION].data = STR_VEHICLE_LIST_ROADVEH_DEPOT;  break;
+				case VEH_SHIP:     w->widget[VLW_WIDGET_CAPTION].data = STR_VEHICLE_LIST_SHIP_DEPOT;     break;
+				case VEH_AIRCRAFT: w->widget[VLW_WIDGET_CAPTION].data = STR_VEHICLE_LIST_AIRCRAFT_DEPOT; break;
 				default: NOT_REACHED(); break;
 			}
 			break;
@@ -885,16 +885,16 @@
 	}
 
 	switch (vl->vehicle_type) {
-		case VEH_Train:
+		case VEH_TRAIN:
 			w->resize.step_width = 1;
 			/* Fallthrough */
-		case VEH_Road:
+		case VEH_ROAD:
 			w->vscroll.cap = 7;
 			w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_SMALL;
 			w->resize.height = 220 - (PLY_WND_PRC__SIZE_OF_ROW_SMALL * 3); // Minimum of 4 vehicles
 			break;
-		case VEH_Ship:
-		case VEH_Aircraft:
+		case VEH_SHIP:
+		case VEH_AIRCRAFT:
 			w->vscroll.cap = 4;
 			w->resize.step_height = PLY_WND_PRC__SIZE_OF_ROW_BIG;
 			break;
@@ -907,10 +907,10 @@
 		* point to the correct global _sorting struct so we are freed
 		* from having conditionals during window operation */
 	switch (vl->vehicle_type) {
-		case VEH_Train:    vl->_sorting = &_sorting.train; break;
-		case VEH_Road:     vl->_sorting = &_sorting.roadveh; break;
-		case VEH_Ship:     vl->_sorting = &_sorting.ship; break;
-		case VEH_Aircraft: vl->_sorting = &_sorting.aircraft; break;
+		case VEH_TRAIN:    vl->_sorting = &_sorting.train; break;
+		case VEH_ROAD:     vl->_sorting = &_sorting.roadveh; break;
+		case VEH_SHIP:     vl->_sorting = &_sorting.ship; break;
+		case VEH_AIRCRAFT: vl->_sorting = &_sorting.aircraft; break;
 		default: NOT_REACHED(); break;
 	}
 
@@ -932,7 +932,7 @@
 		sel--;
 
 		if (order->type == OT_GOTO_STATION) {
-			if (v->type == VEH_Ship && GetStation(order->dest)->IsBuoy()) continue;
+			if (v->type == VEH_SHIP && GetStation(order->dest)->IsBuoy()) continue;
 
 			SetDParam(0, order->dest);
 			DrawString(x, y, STR_A036, 0);
@@ -983,13 +983,13 @@
 
 		case VLW_DEPOT_LIST:
 			switch (vl->vehicle_type) {
-				case VEH_Train:    SetDParam(0, STR_8800_TRAIN_DEPOT);        break;
-				case VEH_Road:     SetDParam(0, STR_9003_ROAD_VEHICLE_DEPOT); break;
-				case VEH_Ship:     SetDParam(0, STR_9803_SHIP_DEPOT);         break;
-				case VEH_Aircraft: SetDParam(0, STR_A002_AIRCRAFT_HANGAR);    break;
+				case VEH_TRAIN:    SetDParam(0, STR_8800_TRAIN_DEPOT);        break;
+				case VEH_ROAD:     SetDParam(0, STR_9003_ROAD_VEHICLE_DEPOT); break;
+				case VEH_SHIP:     SetDParam(0, STR_9803_SHIP_DEPOT);         break;
+				case VEH_AIRCRAFT: SetDParam(0, STR_A002_AIRCRAFT_HANGAR);    break;
 				default: NOT_REACHED(); break;
 			}
-			if (vl->vehicle_type == VEH_Aircraft) {
+			if (vl->vehicle_type == VEH_AIRCRAFT) {
 				SetDParam(1, index); // Airport name
 			} else {
 				SetDParam(1, GetDepot(index)->town_index);
@@ -1024,10 +1024,10 @@
 		DrawVehicleImage(v, x + 19, y + 6, w->widget[VLW_WIDGET_LIST].right - w->widget[VLW_WIDGET_LIST].left - 20, 0, INVALID_VEHICLE);
 		DrawString(x + 19, y + w->resize.step_height - 8, STR_0198_PROFIT_THIS_YEAR_LAST_YEAR, 0);
 
-		if ((v->type == VEH_Train    && v->string_id != STR_SV_TRAIN_NAME)   ||
-			(v->type == VEH_Road     && v->string_id != STR_SV_ROADVEH_NAME) ||
-			(v->type == VEH_Ship     && v->string_id != STR_SV_SHIP_NAME)    ||
-			(v->type == VEH_Aircraft && v->string_id != STR_SV_AIRCRAFT_NAME)) {
+		if ((v->type == VEH_TRAIN    && v->string_id != STR_SV_TRAIN_NAME)   ||
+			(v->type == VEH_ROAD     && v->string_id != STR_SV_ROADVEH_NAME) ||
+			(v->type == VEH_SHIP     && v->string_id != STR_SV_SHIP_NAME)    ||
+			(v->type == VEH_AIRCRAFT && v->string_id != STR_SV_AIRCRAFT_NAME)) {
 
 			/* The vehicle got a name so we will print it */
 			SetDParam(0, v->string_id);
@@ -1096,10 +1096,10 @@
 					v = vl->sort_list[id_v];
 
 					switch (vl->vehicle_type) {
-						case VEH_Train: ShowTrainViewWindow(v); break;
-						case VEH_Road: ShowRoadVehViewWindow(v); break;
-						case VEH_Ship: ShowShipViewWindow(v); break;
-						case VEH_Aircraft: ShowAircraftViewWindow(v); break;
+						case VEH_TRAIN: ShowTrainViewWindow(v); break;
+						case VEH_ROAD: ShowRoadVehViewWindow(v); break;
+						case VEH_SHIP: ShowShipViewWindow(v); break;
+						case VEH_AIRCRAFT: ShowAircraftViewWindow(v); break;
 						default: NOT_REACHED(); break;
 					}
 				} break;
@@ -1244,18 +1244,18 @@
 	 * some of the windows to the correct size */
 	switch (vehicle_type) {
 		default: NOT_REACHED();
-		case VEH_Train:
+		case VEH_TRAIN:
 			w = AllocateWindowDescFront(&_player_vehicle_list_train_desc, num);
 			if (w != NULL) ResizeWindow(w, 65, 38);
 			break;
-		case VEH_Road:
+		case VEH_ROAD:
 			w = AllocateWindowDescFront(&_player_vehicle_list_road_veh_desc, num);
 			if (w != NULL) ResizeWindow(w, 0, 38);
 			break;
-		case VEH_Ship:
+		case VEH_SHIP:
 			w = AllocateWindowDescFront(&_player_vehicle_list_ship_desc, num);
 			break;
-		case VEH_Aircraft:
+		case VEH_AIRCRAFT:
 			w = AllocateWindowDescFront(&_player_vehicle_list_aircraft_desc, num);
 			break;
 	}
@@ -1287,7 +1287,7 @@
 {
 	uint16 depot_airport_index;
 
-	if (vehicle_type == VEH_Aircraft) {
+	if (vehicle_type == VEH_AIRCRAFT) {
 		depot_airport_index = GetStationIndex(depot_tile);
 	} else {
 		Depot *depot = GetDepotByTile(depot_tile);
--- a/src/vehicle_gui.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/vehicle_gui.h	Mon Mar 19 12:38:16 2007 +0000
@@ -8,11 +8,11 @@
 
 void DrawVehicleProfitButton(const Vehicle *v, int x, int y);
 void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order);
-void InitializeVehiclesGuiList(void);
+void InitializeVehiclesGuiList();
 
 /* sorter stuff */
-void RebuildVehicleLists(void);
-void ResortVehicleLists(void);
+void RebuildVehicleLists();
+void ResortVehicleLists();
 
 #define PERIODIC_RESORT_DAYS 10
 
@@ -56,17 +56,17 @@
 static inline void DrawVehicleImage(const Vehicle *v, int x, int y, int count, int skip, VehicleID selection)
 {
 	switch (v->type) {
-		case VEH_Train:    DrawTrainImage(v, x, y, count, skip, selection); break;
-		case VEH_Road:     DrawRoadVehImage(v, x, y, selection);            break;
-		case VEH_Ship:     DrawShipImage(v, x, y, selection);               break;
-		case VEH_Aircraft: DrawAircraftImage(v, x, y, selection);           break;
+		case VEH_TRAIN:    DrawTrainImage(v, x, y, count, skip, selection); break;
+		case VEH_ROAD:     DrawRoadVehImage(v, x, y, selection);            break;
+		case VEH_SHIP:     DrawShipImage(v, x, y, selection);               break;
+		case VEH_AIRCRAFT: DrawAircraftImage(v, x, y, selection);           break;
 		default: NOT_REACHED();
 	}
 }
 
 static inline uint GetVehicleListHeight(byte type)
 {
-	return (type == VEH_Train || type == VEH_Road) ? 14 : 24;
+	return (type == VEH_TRAIN || type == VEH_ROAD) ? 14 : 24;
 }
 
 #endif /* VEHICLE_GUI_H */
--- a/src/video/cocoa_v.mm	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/video/cocoa_v.mm	Mon Mar 19 12:38:16 2007 +0000
@@ -31,18 +31,18 @@
 
 
 /* Portions of CPS.h */
-typedef struct CPSProcessSerNum {
+struct CPSProcessSerNum {
 	UInt32 lo;
 	UInt32 hi;
-} CPSProcessSerNum;
+};
 
 extern "C" OSErr CPSGetCurrentProcess(CPSProcessSerNum* psn);
 extern "C" OSErr CPSEnableForegroundOperation(CPSProcessSerNum* psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
 extern "C" OSErr CPSSetFrontProcess(CPSProcessSerNum* psn);
 
 /* From Menus.h (according to Xcode Developer Documentation) */
-extern "C" void ShowMenuBar(void);
-extern "C" void HideMenuBar(void);
+extern "C" void ShowMenuBar();
+extern "C" void HideMenuBar();
 
 /* Disables a warning. This is needed since the method exists but has been dropped from the header, supposedly as of 10.4. */
 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
@@ -68,6 +68,7 @@
 #include "../debug.h"
 #include "../macros.h"
 #include "../os/macosx/splash.h"
+#include "../variables.h"
 #include "cocoa_v.h"
 #include "cocoa_keys.h"
 
@@ -103,11 +104,11 @@
  */
 #define QZ_GAMMA_TABLE_SIZE 256
 
-typedef struct {
+struct OTTD_QuartzGammaTable {
 	CGGammaValue red[QZ_GAMMA_TABLE_SIZE];
 	CGGammaValue green[QZ_GAMMA_TABLE_SIZE];
 	CGGammaValue blue[QZ_GAMMA_TABLE_SIZE];
-} OTTD_QuartzGammaTable;
+};
 
 /* Add methods to get at private members of NSScreen.
  * Since there is a bug in Apple's screen switching code that does not update
@@ -126,12 +127,12 @@
 @end
 
 
-static void QZ_Draw(void);
-static void QZ_UnsetVideoMode(void);
+static void QZ_Draw();
+static void QZ_UnsetVideoMode();
 static void QZ_UpdatePalette(uint start, uint count);
 static void QZ_WarpCursor(int x, int y);
-static void QZ_ShowMouse(void);
-static void QZ_HideMouse(void);
+static void QZ_ShowMouse();
+static void QZ_HideMouse();
 static void CocoaVideoFullScreen(bool full_screen);
 
 
@@ -192,7 +193,7 @@
  *                             Game loop and accessories                      *
  ******************************************************************************/
 
-static uint32 GetTick(void)
+static uint32 GetTick()
 {
 	struct timeval tim;
 
@@ -200,7 +201,7 @@
 	return tim.tv_usec / 1000 + tim.tv_sec * 1000;
 }
 
-static void QZ_CheckPaletteAnim(void)
+static void QZ_CheckPaletteAnim()
 {
 	if (_pal_last_dirty != -1) {
 		QZ_UpdatePalette(_pal_first_dirty, _pal_last_dirty - _pal_first_dirty + 1);
@@ -210,10 +211,10 @@
 
 
 
-typedef struct VkMapping {
+struct VkMapping {
 	unsigned short vk_from;
 	byte map_to;
-} VkMapping;
+};
 
 #define AS(x, z) {x, z}
 
@@ -469,7 +470,7 @@
 }
 
 
-static bool QZ_PollEvent(void)
+static bool QZ_PollEvent()
 {
 	NSEvent *event;
 	NSPoint pt;
@@ -653,6 +654,10 @@
 			} else if ([ event deltaY ] < 0.0) { /* Scroll down */
 				_cursor.wheel++;
 			} /* else: deltaY was 0.0 and we don't want to do anything */
+
+			/* Set the scroll count for scrollwheel scrolling */
+			_cursor.h_wheel -= (int)([ event deltaX ]* 5 * _patches.scrollwheel_multiplier);
+			_cursor.v_wheel -= (int)([ event deltaY ]* 5 * _patches.scrollwheel_multiplier);
 			break;
 
 		default:
@@ -663,7 +668,7 @@
 }
 
 
-static void QZ_GameLoop(void)
+static void QZ_GameLoop()
 {
 	uint32 cur_ticks = GetTick();
 	uint32 next_tick = cur_ticks + 30;
@@ -712,7 +717,7 @@
 		}
 
 		cur_ticks = GetTick();
-		if (cur_ticks >= next_tick || (_fast_forward && !_pause) || cur_ticks < prev_cur_ticks) {
+		if (cur_ticks >= next_tick || (_fast_forward && !_pause_game) || cur_ticks < prev_cur_ticks) {
 			next_tick = cur_ticks + 30;
 
 			_ctrl_pressed = !!(_cocoa_video_data.current_mods & NSControlKeyMask);
@@ -764,7 +769,7 @@
  * The genie effect uses the alpha component. Otherwise,
  * it doesn't seem to matter what value it has.
  */
-static void QZ_SetPortAlphaOpaque(void)
+static void QZ_SetPortAlphaOpaque()
 {
 	if (_cocoa_video_data.device_bpp == 32) {
 		uint32* pixels = (uint32*)_cocoa_video_data.realpixels;
@@ -1032,7 +1037,7 @@
 	1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0
 };
 
-static void QZ_DrawResizeIcon(void)
+static void QZ_DrawResizeIcon()
 {
 	int xoff = _cocoa_video_data.width - 16;
 	int yoff = _cocoa_video_data.height - 16;
@@ -1054,7 +1059,7 @@
 	}
 }
 
-static void QZ_DrawWindow(void)
+static void QZ_DrawWindow()
 {
 	int i;
 	RgnHandle dirty, temp;
@@ -1421,7 +1426,7 @@
 }
 
 /* Wait for the VBL to occur (estimated since we don't have a hardware interrupt) */
-static void QZ_WaitForVerticalBlank(void)
+static void QZ_WaitForVerticalBlank()
 {
 	/* The VBL delay is based on Ian Ollmann's RezLib <iano@cco.caltech.edu> */
 	double refreshRate;
@@ -1452,7 +1457,7 @@
 }
 
 
-static void QZ_DrawScreen(void)
+static void QZ_DrawScreen()
 {
 	const uint8* src = _cocoa_video_data.pixels;
 	uint8* dst       = (uint8*)_cocoa_video_data.realpixels;
@@ -1579,12 +1584,12 @@
 	}
 }
 
-static void QZ_InitPalette(void)
+static void QZ_InitPalette()
 {
 	QZ_UpdatePalette(0, 256);
 }
 
-static void QZ_Draw(void)
+static void QZ_Draw()
 {
 	if (_cocoa_video_data.fullscreen) {
 		QZ_DrawScreen();
@@ -1608,7 +1613,7 @@
 	{1920, 1200}
 };
 
-static void QZ_UpdateVideoModes(void)
+static void QZ_UpdateVideoModes()
 {
 	uint i, j, count;
 	OTTDPoint modes[32];
@@ -1636,7 +1641,7 @@
 	_num_resolutions = j;
 }
 
-static void QZ_UnsetVideoMode(void)
+static void QZ_UnsetVideoMode()
 {
 	if (_cocoa_video_data.fullscreen) {
 		/* Release fullscreen resources */
@@ -1719,7 +1724,7 @@
 	return ret;
 }
 
-static void QZ_VideoInit(void)
+static void QZ_VideoInit()
 {
 	memset(&_cocoa_video_data, 0, sizeof(_cocoa_video_data));
 
@@ -1789,7 +1794,7 @@
 	/* Generate the mouse moved event */
 }
 
-static void QZ_ShowMouse(void)
+static void QZ_ShowMouse()
 {
 	if (!_cocoa_video_data.cursor_visible) {
 		[ NSCursor unhide ];
@@ -1802,7 +1807,7 @@
 	}
 }
 
-static void QZ_HideMouse(void)
+static void QZ_HideMouse()
 {
 	if (_cocoa_video_data.cursor_visible) {
 #ifndef _DEBUG
@@ -1842,7 +1847,7 @@
 }
 @end
 
-static void setApplicationMenu(void)
+static void setApplicationMenu()
 {
 	/* warning: this code is very odd */
 	NSMenu *appleMenu;
@@ -1887,7 +1892,7 @@
 }
 
 /* Create a window menu */
-static void setupWindowMenu(void)
+static void setupWindowMenu()
 {
 	NSMenu* windowMenu;
 	NSMenuItem* windowMenuItem;
@@ -1913,7 +1918,7 @@
 	[windowMenuItem release];
 }
 
-static void setupApplication(void)
+static void setupApplication()
 {
 	CPSProcessSerNum PSN;
 
@@ -1942,7 +1947,7 @@
  *                             Video driver interface                         *
  ******************************************************************************/
 
-static void CocoaVideoStop(void)
+static void CocoaVideoStop()
 {
 	if (!_cocoa_video_started) return;
 
@@ -1986,7 +1991,7 @@
 	_cocoa_video_data.num_dirty_rects++;
 }
 
-static void CocoaVideoMainLoop(void)
+static void CocoaVideoMainLoop()
 {
 	/* Start the main event loop */
 	[NSApp run];
@@ -2042,31 +2047,15 @@
 	_cocoa_video_dialog = false;
 }
 
-
-/* This is needed since OS X applications are started with the working dir set to / when double-clicked */
-void cocoaSetWorkingDirectory(void)
-{
-	char parentdir[MAXPATHLEN];
-	int chdir_ret;
-	CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
-	CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
-	if (CFURLGetFileSystemRepresentation(url2, true, (unsigned char*)parentdir, MAXPATHLEN)) {
-		chdir_ret = chdir(parentdir); /* chdir to the binary app's parent */
-		assert(chdir_ret == 0);
-	}
-	CFRelease(url);
-	CFRelease(url2);
-}
-
 /* These are called from main() to prevent a _NSAutoreleaseNoPool error when
  * exiting before the cocoa video driver has been loaded
  */
-void cocoaSetupAutoreleasePool(void)
+void cocoaSetupAutoreleasePool()
 {
 	_ottd_autorelease_pool = [[NSAutoreleasePool alloc] init];
 }
 
-void cocoaReleaseAutoreleasePool(void)
+void cocoaReleaseAutoreleasePool()
 {
 	[_ottd_autorelease_pool release];
 }
--- a/src/video/dedicated_v.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/video/dedicated_v.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -33,7 +33,7 @@
 /**
  * Switches OpenTTD to a console app at run-time, instead of a PM app
  * Necessary to see stdout, etc. */
-static void OS2_SwitchToConsoleMode(void)
+static void OS2_SwitchToConsoleMode()
 {
 	PPIB pib;
 	PTIB tib;
@@ -74,10 +74,12 @@
 static char _win_console_thread_buffer[200];
 
 /* Windows Console thread. Just loop and signal when input has been received */
-static void WINAPI CheckForConsoleInput(void)
+static void WINAPI CheckForConsoleInput()
 {
+	DWORD nb;
+	HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
 	while (true) {
-		fgets(_win_console_thread_buffer, lengthof(_win_console_thread_buffer), stdin);
+		ReadFile(hStdin, _win_console_thread_buffer, lengthof(_win_console_thread_buffer), &nb, NULL);
 		/* Signal input waiting that input is read and wait for it being handled
 		 * SignalObjectAndWait() should be used here, but it's unsupported in Win98< */
 		SetEvent(_hInputReady);
@@ -85,7 +87,7 @@
 	}
 }
 
-static void CreateWindowsConsoleThread(void)
+static void CreateWindowsConsoleThread()
 {
 	DWORD dwThreadId;
 	/* Create event to signal when console input is ready */
@@ -99,7 +101,7 @@
 	DEBUG(driver, 2, "Windows console thread started");
 }
 
-static void CloseWindowsConsoleThread(void)
+static void CloseWindowsConsoleThread()
 {
 	CloseHandle(_hThread);
 	CloseHandle(_hInputReady);
@@ -140,7 +142,7 @@
 	return NULL;
 }
 
-static void DedicatedVideoStop(void)
+static void DedicatedVideoStop()
 {
 #ifdef WIN32
 	CloseWindowsConsoleThread();
@@ -153,7 +155,7 @@
 static void DedicatedVideoFullScreen(bool fs) {}
 
 #if defined(UNIX) || defined(__OS2__) || defined(PSP)
-static bool InputWaiting(void)
+static bool InputWaiting()
 {
 	struct timeval tv;
 	fd_set readfds;
@@ -168,7 +170,7 @@
 	return select(STDIN + 1, &readfds, NULL, NULL, &tv) > 0;
 }
 
-static uint32 GetTime(void)
+static uint32 GetTime()
 {
 	struct timeval tim;
 
@@ -178,19 +180,19 @@
 
 #else
 
-static bool InputWaiting(void)
+static bool InputWaiting()
 {
 	return WaitForSingleObject(_hInputReady, 1) == WAIT_OBJECT_0;
 }
 
-static uint32 GetTime(void)
+static uint32 GetTime()
 {
 	return GetTickCount();
 }
 
 #endif
 
-static void DedicatedHandleKeyInput(void)
+static void DedicatedHandleKeyInput()
 {
 	static char input_line[200] = "";
 
@@ -225,7 +227,7 @@
 	IConsoleCmdExec(input_line); // execute command
 }
 
-static void DedicatedVideoMainLoop(void)
+static void DedicatedVideoMainLoop()
 {
 	uint32 cur_ticks = GetTime();
 	uint32 next_tick = cur_ticks + 30;
--- a/src/video/null_v.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/video/null_v.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -17,11 +17,11 @@
 	return NULL;
 }
 
-static void NullVideoStop(void) { free(_null_video_mem); }
+static void NullVideoStop() { free(_null_video_mem); }
 
 static void NullVideoMakeDirty(int left, int top, int width, int height) {}
 
-static void NullVideoMainLoop(void)
+static void NullVideoMainLoop()
 {
 	uint i;
 
--- a/src/video/sdl_v.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/video/sdl_v.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -49,12 +49,12 @@
 	SDL_CALL SDL_SetColors(_sdl_screen, pal, start, count);
 }
 
-static void InitPalette(void)
+static void InitPalette()
 {
 	UpdatePalette(0, 256);
 }
 
-static void CheckPaletteAnim(void)
+static void CheckPaletteAnim()
 {
 	if (_pal_last_dirty != -1) {
 		UpdatePalette(_pal_first_dirty, _pal_last_dirty - _pal_first_dirty + 1);
@@ -62,7 +62,7 @@
 	}
 }
 
-static void DrawSurfaceToScreen(void)
+static void DrawSurfaceToScreen()
 {
 	int n = _num_dirty_rects;
 	if (n != 0) {
@@ -88,7 +88,7 @@
 	{1920, 1200}
 };
 
-static void GetVideoModes(void)
+static void GetVideoModes()
 {
 	int i;
 	SDL_Rect **modes;
@@ -209,11 +209,11 @@
 	return true;
 }
 
-typedef struct VkMapping {
+struct VkMapping {
 	uint16 vk_from;
 	byte vk_count;
 	byte map_to;
-} VkMapping;
+};
 
 #define AS(x, z) {x, 0, z}
 #define AM(x, y, z, w) {x, y - x, z}
@@ -301,7 +301,7 @@
 	return (key << 16) + sym->unicode;
 }
 
-static int PollEvent(void)
+static int PollEvent()
 {
 	SDL_Event ev;
 
@@ -415,12 +415,12 @@
 	return NULL;
 }
 
-static void SdlVideoStop(void)
+static void SdlVideoStop()
 {
 	SdlClose(SDL_INIT_VIDEO);
 }
 
-static void SdlVideoMainLoop(void)
+static void SdlVideoMainLoop()
 {
 	uint32 cur_ticks = SDL_CALL SDL_GetTicks();
 	uint32 next_tick = cur_ticks + 30;
@@ -452,7 +452,7 @@
 		}
 
 		cur_ticks = SDL_CALL SDL_GetTicks();
-		if (cur_ticks >= next_tick || (_fast_forward && !_pause) || cur_ticks < prev_cur_ticks) {
+		if (cur_ticks >= next_tick || (_fast_forward && !_pause_game) || cur_ticks < prev_cur_ticks) {
 			next_tick = cur_ticks + 30;
 
 			_ctrl_pressed  = !!(mod & KMOD_CTRL);
--- a/src/video/win32_v.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/video/win32_v.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -36,8 +36,11 @@
 uint _display_hz;
 uint _fullscreen_bpp;
 static uint16 _bck_resolution[2];
+#if !defined(UNICODE)
+uint _codepage;
+#endif
 
-static void MakePalette(void)
+static void MakePalette()
 {
 	LOGPALETTE *pal;
 	uint i;
@@ -73,11 +76,11 @@
 	SetDIBColorTable(dc, start, count, rgb);
 }
 
-typedef struct {
+struct VkMapping {
 	byte vk_from;
 	byte vk_count;
 	byte map_to;
-} VkMapping;
+};
 
 #define AS(x, z) {x, 0, z}
 #define AM(x, y, z, w) {x, y - x, z}
@@ -156,7 +159,7 @@
 #ifdef _DEBUG
 // Keep this function here..
 // It allows you to redraw the screen from within the MSVC debugger
-int RedrawScreenDebug(void)
+int RedrawScreenDebug()
 {
 	HDC dc,dc2;
 	static int _fooctr;
@@ -208,6 +211,8 @@
 
 static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
+	static uint32 keycode = 0;
+
 	switch (msg) {
 		case WM_CREATE:
 			SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
@@ -347,40 +352,51 @@
 			return 0;
 		}
 
-		case WM_KEYDOWN: {
-			// this is the rewritten ascii input function
-			// it disables windows deadkey handling --> more linux like :D
-			wchar_t w = 0;
-#if !defined(WINCE)
-			byte ks[256];
-#endif
-			uint scancode;
-			uint32 pressed_key;
+#if !defined(UNICODE)
+		case WM_INPUTLANGCHANGE: {
+			TCHAR locale[6];
+			LCID lcid = GB(lParam, 0, 16);
 
-#if defined(WINCE)
-			/* On WinCE GetKeyboardState isn't supported */
-			w = wParam;
-#else
-			GetKeyboardState(ks);
-			if (ToUnicode(wParam, 0, ks, &w, 1, 0) != 1) {
-				/* On win9x ToUnicode always fails, so fall back to ToAscii */
-				if (ToAscii(wParam, 0, ks, (LPWORD)&w, 0) != 1) w = 0; // no translation was possible
-			}
-#endif
+			int len = GetLocaleInfo(lcid, LOCALE_IDEFAULTANSICODEPAGE, locale, lengthof(locale));
+			if (len != 0) _codepage = _ttoi(locale);
+			return 1;
+		}
+#endif /* UNICODE */
 
-			pressed_key = w | MapWindowsKey(wParam) << 16;
+		case WM_CHAR: {
+			/* Silently drop all non-text messages as those were handled by WM_KEYDOWN */
+			if (wParam < VK_SPACE) return 0;
+			uint scancode = GB(lParam, 16, 8);
+			uint charcode = wParam;
 
-			scancode = GB(lParam, 16, 8);
-			if (scancode == 41) pressed_key = w | WKC_BACKQUOTE << 16;
+#if !defined(UNICODE)
+			wchar_t w;
+			int len = MultiByteToWideChar(_codepage, 0, (char*)&charcode, 1, &w, 1);
+			charcode = len == 1 ? w : 0;
+#endif /* UNICODE */
 
-			if (GB(pressed_key, 16, 16) == ('D' | WKC_CTRL) && !_wnd.fullscreen) {
+			/* No matter the keyboard layout, we will map the '~' to the console */
+			scancode = scancode == 41 ? (int)WKC_BACKQUOTE : keycode;
+			HandleKeypress(GB(charcode, 0, 16) | (scancode << 16));
+			return 0;
+		}
+
+		case WM_KEYDOWN: {
+			keycode = MapWindowsKey(wParam);
+
+			/* Silently drop all text messages as those will be handled by WM_CHAR
+			 * WM_KEYDOWN only handles CTRL+ commands and special keys like VK_LEFT, etc. */
+			if (keycode == 0 || (keycode > WKC_PAUSE && GB(keycode, 13, 4) == 0)) return 0;
+
+			if (keycode == ('D' | WKC_CTRL) && !_wnd.fullscreen) {
 				_double_size ^= 1;
 				_wnd.double_size = _double_size;
 				ClientSizeChanged(_wnd.width, _wnd.height);
 				MarkWholeScreenDirty();
 			}
-			HandleKeypress(pressed_key);
-			break;
+
+			HandleKeypress(0 | (keycode << 16));
+			return 0;
 		}
 
 		case WM_SYSKEYDOWN: /* user presses F10 or Alt, both activating the title-menu */
@@ -511,7 +527,7 @@
 	return DefWindowProc(hwnd, msg, wParam, lParam);
 }
 
-static void RegisterWndClass(void)
+static void RegisterWndClass()
 {
 	static bool registered = false;
 
@@ -681,7 +697,7 @@
 	{ 1920, 1200 }
 };
 
-static void FindResolutions(void)
+static void FindResolutions()
 {
 	uint n = 0;
 #if defined(WINCE)
@@ -749,7 +765,7 @@
 	return NULL;
 }
 
-static void Win32GdiStop(void)
+static void Win32GdiStop()
 {
 	DeleteObject(_wnd.gdi_palette);
 	DeleteObject(_wnd.dib_sect);
@@ -798,14 +814,14 @@
 	InvalidateRect(_wnd.main_wnd, &r, FALSE);
 }
 
-static void CheckPaletteAnim(void)
+static void CheckPaletteAnim()
 {
 	if (_pal_last_dirty == -1)
 		return;
 	InvalidateRect(_wnd.main_wnd, NULL, FALSE);
 }
 
-static void Win32GdiMainLoop(void)
+static void Win32GdiMainLoop()
 {
 	MSG mesg;
 	uint32 cur_ticks = GetTickCount();
@@ -818,6 +834,7 @@
 
 		while (PeekMessage(&mesg, NULL, 0, 0, PM_REMOVE)) {
 			InteractiveRandom(); // randomness
+			TranslateMessage(&mesg);
 			DispatchMessage(&mesg);
 		}
 		if (_exit_game) return;
@@ -835,7 +852,7 @@
 		}
 
 		cur_ticks = GetTickCount();
-		if (cur_ticks >= next_tick || (_fast_forward && !_pause) || cur_ticks < prev_cur_ticks) {
+		if (cur_ticks >= next_tick || (_fast_forward && !_pause_game) || cur_ticks < prev_cur_ticks) {
 			next_tick = cur_ticks + 30;
 			_ctrl_pressed = _wnd.has_focus && GetAsyncKeyState(VK_CONTROL)<0;
 			_shift_pressed = _wnd.has_focus && GetAsyncKeyState(VK_SHIFT)<0;
--- a/src/viewport.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/viewport.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -47,34 +47,34 @@
  *   X <                             > Y         *
  */
 
-typedef struct StringSpriteToDraw {
+struct StringSpriteToDraw {
 	uint16 string;
 	uint16 color;
-	struct StringSpriteToDraw *next;
+	StringSpriteToDraw *next;
 	int32 x;
 	int32 y;
 	uint32 params[2];
 	uint16 width;
-} StringSpriteToDraw;
-
-typedef struct TileSpriteToDraw {
+};
+
+struct TileSpriteToDraw {
 	SpriteID image;
 	SpriteID pal;
-	struct TileSpriteToDraw *next;
+	TileSpriteToDraw *next;
 	int32 x;
 	int32 y;
 	byte z;
-} TileSpriteToDraw;
-
-typedef struct ChildScreenSpriteToDraw {
+};
+
+struct ChildScreenSpriteToDraw {
 	SpriteID image;
 	SpriteID pal;
 	int32 x;
 	int32 y;
-	struct ChildScreenSpriteToDraw *next;
-} ChildScreenSpriteToDraw;
-
-typedef struct ParentSpriteToDraw {
+	ChildScreenSpriteToDraw *next;
+};
+
+struct ParentSpriteToDraw {
 	SpriteID image;
 	SpriteID pal;
 	int32 left;
@@ -89,13 +89,13 @@
 	byte unk16;
 	byte zmin;
 	byte zmax;
-} ParentSpriteToDraw;
+};
 
 // Quick hack to know how much memory to reserve when allocating from the spritelist
 // to prevent a buffer overflow.
 #define LARGEST_SPRITELIST_STRUCT ParentSpriteToDraw
 
-typedef struct ViewportDrawer {
+struct ViewportDrawer {
 	DrawPixelInfo dpi;
 
 	byte *spritelist_mem;
@@ -112,7 +112,7 @@
 	byte combine_sprites;
 
 	int offs_x, offs_y; // used when drawing ground sprites relative
-} ViewportDrawer;
+};
 
 static ViewportDrawer *_cur_vd;
 
@@ -129,7 +129,7 @@
 	return p;
 }
 
-void InitViewports(void) {
+void InitViewports() {
 	memset(_viewports, 0, sizeof(_viewports));
 	_active_viewports = 0;
 }
@@ -371,7 +371,7 @@
 	return pt;
 }
 
-Point GetTileBelowCursor(void)
+Point GetTileBelowCursor()
 {
 	return GetTileFromScreenXY(_cursor.pos.x, _cursor.pos.y, _cursor.pos.x, _cursor.pos.y);
 }
@@ -534,12 +534,12 @@
 	if (vd->combine_sprites == 1) vd->combine_sprites = 2;
 }
 
-void StartSpriteCombine(void)
+void StartSpriteCombine()
 {
 	_cur_vd->combine_sprites = 1;
 }
 
-void EndSpriteCombine(void)
+void EndSpriteCombine()
 {
 	_cur_vd->combine_sprites = 0;
 }
@@ -725,7 +725,7 @@
 	}
 }
 
-static void ViewportAddLandscape(void)
+static void ViewportAddLandscape()
 {
 	ViewportDrawer *vd = _cur_vd;
 	int x, y, width, height;
@@ -1445,7 +1445,7 @@
 	);
 }
 
-static void SetSelectionTilesDirty(void)
+static void SetSelectionTilesDirty()
 {
 	int y_size, x_size;
 	int x = _thd.pos.x;
@@ -1743,7 +1743,7 @@
 	}
 }
 
-Vehicle *CheckMouseOverVehicle(void)
+Vehicle *CheckMouseOverVehicle()
 {
 	const Window *w;
 	const ViewPort *vp;
@@ -1760,7 +1760,7 @@
 
 
 
-void PlaceObject(void)
+void PlaceObject()
 {
 	Point pt;
 	Window *w;
@@ -1866,7 +1866,7 @@
 }
 
 // called regular to update tile highlighting in all cases
-void UpdateTileSelection(void)
+void UpdateTileSelection()
 {
 	int x1;
 	int y1;
@@ -1976,7 +1976,7 @@
 	if (distance > 1) GuiShowTooltipsWithArgs(STR_MEASURE_LENGTH, 1, &distance);
 }
 
-static void VpStartPreSizing(void)
+static void VpStartPreSizing()
 {
 	_thd.selend.x = -1;
 	_special_mouse_mode = WSM_PRESIZE;
@@ -2385,7 +2385,7 @@
 }
 
 // while dragging
-bool VpHandlePlaceSizingDrag(void)
+bool VpHandlePlaceSizingDrag()
 {
 	Window *w;
 	WindowEvent e;
@@ -2477,7 +2477,7 @@
 		SetMouseCursor(icon, pal);
 }
 
-void ResetObjectToPlace(void)
+void ResetObjectToPlace()
 {
 	SetObjectToPlace(SPR_CURSOR_MOUSE, PAL_NONE, VHM_NONE, WC_MAIN_WINDOW, 0);
 }
--- a/src/viewport.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/viewport.h	Mon Mar 19 12:38:16 2007 +0000
@@ -16,12 +16,12 @@
 void SetSelectionRed(bool);
 
 /* viewport.c */
-void InitViewports(void);
+void InitViewports();
 void DeleteWindowViewport(Window *w);
 void AssignWindowViewport(Window *w, int x, int y,
 	int width, int height, uint32 follow_flags, byte zoom);
 ViewPort *IsPtInWindowViewport(const Window *w, int x, int y);
-Point GetTileBelowCursor(void);
+Point GetTileBelowCursor();
 void UpdateViewportPosition(Window *w);
 
 enum {
@@ -49,11 +49,11 @@
 void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y);
 
 
-void StartSpriteCombine(void);
-void EndSpriteCombine(void);
+void StartSpriteCombine();
+void EndSpriteCombine();
 
 void HandleViewportClicked(const ViewPort *vp, int x, int y);
-void PlaceObject(void);
+void PlaceObject();
 void SetRedErrorSquare(TileIndex tile);
 void SetTileSelectSize(int w, int h);
 void SetTileSelectBigSize(int ox, int oy, int sx, int sy);
@@ -62,7 +62,7 @@
 void VpSetPresizeRange(uint from, uint to);
 void VpSetPlaceSizingLimit(int limit);
 
-Vehicle *CheckMouseOverVehicle(void);
+Vehicle *CheckMouseOverVehicle();
 
 enum {
 	VPM_X_OR_Y          = 0,
@@ -109,7 +109,7 @@
 	HT_DIR_MASK = 0x7 ///< masks the drag-direction
 };
 
-typedef struct TileHighlightData {
+struct TileHighlightData {
 	Point size;
 	Point outersize;
 	Point pos;
@@ -135,7 +135,7 @@
 
 	int userdata;
 	TileIndex redsq;
-} TileHighlightData;
+};
 
 
 // common button handler
--- a/src/water_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/water_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -212,7 +212,7 @@
 /** Build a piece of canal.
  * @param tile end tile of stretch-dragging
  * @param p1 start tile of stretch-dragging
- * @param p2 ctrl pressed - toggles ocean / canals at sealevel
+ * @param p2 ctrl pressed - toggles ocean / canals at sealevel (ocean only allowed in the scenario editor)
  */
 int32 CmdBuildCanal(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
@@ -223,6 +223,8 @@
 	int sx, sy;
 
 	if (p1 >= MapSize()) return CMD_ERROR;
+	/* Outside of the editor you can only build canals, not oceans */
+	if (HASBIT(p2, 0) && _game_mode != GM_EDITOR) return CMD_ERROR;
 
 	x = TileX(tile);
 	y = TileY(tile);
@@ -401,11 +403,11 @@
 	}
 }
 
-typedef struct LocksDrawTileStruct {
+struct LocksDrawTileStruct {
 	int8 delta_x, delta_y, delta_z;
 	byte width, height, depth;
 	SpriteID image;
-} LocksDrawTileStruct;
+};
 
 #include "table/water_land.h"
 
@@ -610,7 +612,7 @@
 	if (!(v->vehstatus & VS_CRASHED)) {
 		uint16 pass = 0;
 
-		if (v->type == VEH_Road) { // flood bus/truck
+		if (v->type == VEH_ROAD) { // flood bus/truck
 			pass = 1; // driver
 			if (v->cargo_type == CT_PASSENGERS)
 				pass += v->cargo_count;
@@ -618,7 +620,7 @@
 			v->vehstatus |= VS_CRASHED;
 			v->u.road.crashed_ctr = 2000; // max 2220, disappear pretty fast
 			RebuildVehicleLists();
-		} else if (v->type == VEH_Train) {
+		} else if (v->type == VEH_TRAIN) {
 			Vehicle *u;
 
 			v = GetFirstVehicleInChain(v);
@@ -727,7 +729,7 @@
 	if (GetWaterTileType(tile) == WATER_TILE_DEPOT) {
 		TileIndex tile2 = GetOtherShipDepotTile(tile);
 
-		ShowDepotWindow(tile < tile2 ? tile : tile2, VEH_Ship);
+		ShowDepotWindow(tile < tile2 ? tile : tile2, VEH_SHIP);
 	}
 }
 
--- a/src/water_map.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/water_map.h	Mon Mar 19 12:38:16 2007 +0000
@@ -3,25 +3,25 @@
 #ifndef WATER_MAP_H
 #define WATER_MAP_H
 
-typedef enum WaterTileType {
+enum WaterTileType {
 	WATER_TILE_CLEAR,
 	WATER_TILE_COAST,
 	WATER_TILE_LOCK,
 	WATER_TILE_DEPOT,
-} WaterTileType;
+};
 
-typedef enum DepotPart {
+enum DepotPart {
 	DEPOT_NORTH = 0x80,
 	DEPOT_SOUTH = 0x81,
 	DEPOT_END   = 0x84,
-} DepotPart;
+};
 
-typedef enum LockPart {
+enum LockPart {
 	LOCK_MIDDLE = 0x10,
 	LOCK_LOWER  = 0x14,
 	LOCK_UPPER  = 0x18,
 	LOCK_END    = 0x1C
-} LockPart;
+};
 
 static inline WaterTileType GetWaterTileType(TileIndex t)
 {
--- a/src/waypoint.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/waypoint.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -40,7 +40,7 @@
 DEFINE_OLD_POOL(Waypoint, Waypoint, WaypointPoolNewBlock, NULL)
 
 /* Create a new waypoint */
-static Waypoint* AllocateWaypoint(void)
+static Waypoint* AllocateWaypoint()
 {
 	Waypoint *wp;
 
@@ -82,7 +82,7 @@
 }
 
 /* Update all signs */
-void UpdateAllWaypointSigns(void)
+void UpdateAllWaypointSigns()
 {
 	Waypoint *wp;
 
@@ -151,7 +151,7 @@
  * Update waypoint graphics id against saved GRFID/localidx.
  * This is to ensure the chosen graphics are correct if GRF files are changed.
  */
-void AfterLoadWaypoints(void)
+void AfterLoadWaypoints()
 {
 	Waypoint *wp;
 
@@ -254,7 +254,7 @@
 }
 
 /* Daily loop for waypoints */
-void WaypointsDailyLoop(void)
+void WaypointsDailyLoop()
 {
 	Waypoint *wp;
 
@@ -379,7 +379,7 @@
 }
 
 /* Fix savegames which stored waypoints in their old format */
-void FixOldWaypoints(void)
+void FixOldWaypoints()
 {
 	Waypoint *wp;
 
@@ -394,7 +394,7 @@
 	}
 }
 
-void InitializeWaypoints(void)
+void InitializeWaypoints()
 {
 	CleanPool(&_Waypoint_pool);
 	AddBlockToPool(&_Waypoint_pool);
@@ -416,7 +416,7 @@
 	SLE_END()
 };
 
-static void Save_WAYP(void)
+static void Save_WAYP()
 {
 	Waypoint *wp;
 
@@ -426,7 +426,7 @@
 	}
 }
 
-static void Load_WAYP(void)
+static void Load_WAYP()
 {
 	int index;
 
--- a/src/waypoint.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/waypoint.h	Mon Mar 19 12:38:16 2007 +0000
@@ -66,8 +66,8 @@
 Station *ComposeWaypointStation(TileIndex tile);
 void ShowRenameWaypointWindow(const Waypoint *cp);
 void DrawWaypointSprite(int x, int y, int image, RailType railtype);
-void FixOldWaypoints(void);
-void UpdateAllWaypointSigns(void);
-void AfterLoadWaypoints(void);
+void FixOldWaypoints();
+void UpdateAllWaypointSigns();
+void AfterLoadWaypoints();
 
 #endif /* WAYPOINT_H */
--- a/src/widget.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/widget.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -235,6 +235,13 @@
 			goto draw_default;
 		}
 
+		case WWT_TEXT: {
+			StringID str = wi->data;
+
+			if (str != STR_NULL) DrawStringTruncated(r.left, r.top, str, wi->color, r.right - r.left);
+			break;
+		}
+
 		case WWT_INSET: {
 			StringID str = wi->data;
 			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, FR_LOWERED | FR_DARKENED);
--- a/src/win32.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/win32.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -13,6 +13,7 @@
 #include "string.h"
 #include "gfx.h"
 #include "window.h"
+#include "fileio.h"
 #include <windows.h>
 #include <winnt.h>
 #include <wininet.h>
@@ -100,11 +101,11 @@
 static bool _did_emerg_save;
 static int _ident;
 
-typedef struct DebugFileInfo {
+struct DebugFileInfo {
 	uint32 size;
 	uint32 crc32;
 	SYSTEMTIME file_time;
-} DebugFileInfo;
+};
 
 static uint32 *_crc_table;
 
@@ -221,7 +222,7 @@
 	_T("Be aware that critical parts of the internal game state may have become ")
 	_T("corrupted. The saved game is not guaranteed to work.");
 
-static bool EmergencySave(void)
+static bool EmergencySave()
 {
 	SaveOrLoad("crash.sav", SL_SAVE);
 	return true;
@@ -230,14 +231,14 @@
 /* Disable the crash-save submit code as it's not used */
 #if 0
 
-typedef struct {
+struct WinInetProcs {
 	HINTERNET (WINAPI *InternetOpen)(LPCTSTR,DWORD, LPCTSTR, LPCTSTR, DWORD);
 	HINTERNET (WINAPI *InternetConnect)(HINTERNET, LPCTSTR, INTERNET_PORT, LPCTSTR, LPCTSTR, DWORD, DWORD, DWORD);
 	HINTERNET (WINAPI *HttpOpenRequest)(HINTERNET, LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR *, DWORD, DWORD);
 	BOOL (WINAPI *HttpSendRequest)(HINTERNET, LPCTSTR, DWORD, LPVOID, DWORD);
 	BOOL (WINAPI *InternetCloseHandle)(HINTERNET);
 	BOOL (WINAPI *HttpQueryInfo)(HINTERNET, DWORD, LPVOID, LPDWORD, LPDWORD);
-} WinInetProcs;
+};
 
 #define M(x) x "\0"
 #if defined(UNICODE)
@@ -431,14 +432,14 @@
 	return FALSE;
 }
 
-static void Handler2(void)
+static void Handler2()
 {
 	ShowCursor(TRUE);
 	ShowWindow(GetActiveWindow(), FALSE);
 	DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(100), NULL, CrashDialogFunc);
 }
 
-extern bool CloseConsoleLogIfActive(void);
+extern bool CloseConsoleLogIfActive();
 
 static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
 {
@@ -607,10 +608,10 @@
 }
 
 #ifdef _M_AMD64
-extern "C" void *_get_save_esp(void);
+extern "C" void *_get_save_esp();
 #endif
 
-static void Win32InitializeExceptions(void)
+static void Win32InitializeExceptions()
 {
 #ifdef _M_AMD64
 	_safe_esp = _get_save_esp();
@@ -636,7 +637,7 @@
 static DIR _global_dir;
 static LONG _global_dir_is_in_use = false;
 
-static inline DIR *dir_calloc(void)
+static inline DIR *dir_calloc()
 {
 	DIR *d;
 
@@ -658,23 +659,23 @@
 	}
 }
 
-DIR *opendir(const wchar_t *path)
+DIR *opendir(const TCHAR *path)
 {
 	DIR *d;
 	UINT sem = SetErrorMode(SEM_FAILCRITICALERRORS); // disable 'no-disk' message box
-	DWORD fa = GetFileAttributesW(path);
+	DWORD fa = GetFileAttributes(path);
 
 	if ((fa != INVALID_FILE_ATTRIBUTES) && (fa & FILE_ATTRIBUTE_DIRECTORY)) {
 		d = dir_calloc();
 		if (d != NULL) {
-			wchar_t search_path[MAX_PATH];
-			bool slash = path[wcslen(path) - 1] == L'\\';
+			TCHAR search_path[MAX_PATH];
+			bool slash = path[_tcslen(path) - 1] == '\\';
 
 			/* build search path for FindFirstFile, try not to append additional slashes
 			 * as it throws Win9x off its groove for root directories */
-			_snwprintf(search_path, lengthof(search_path), L"%s%s*", path, slash ? L"" : L"\\");
+			_sntprintf(search_path, lengthof(search_path), _T("%s%s*"), path, slash ? _T("") : _T("\\"));
 			*lastof(search_path) = '\0';
-			d->hFind = FindFirstFileW(search_path, &d->fd);
+			d->hFind = FindFirstFile(search_path, &d->fd);
 
 			if (d->hFind != INVALID_HANDLE_VALUE ||
 					GetLastError() == ERROR_NO_MORE_FILES) { // the directory is empty
@@ -705,7 +706,7 @@
 		/* the directory was empty when opened */
 		if (d->hFind == INVALID_HANDLE_VALUE) return NULL;
 		d->at_first_entry = false;
-	} else if (!FindNextFileW(d->hFind, &d->fd)) { // determine cause and bail
+	} else if (!FindNextFile(d->hFind, &d->fd)) { // determine cause and bail
 		if (GetLastError() == ERROR_NO_MORE_FILES) SetLastError(prev_err);
 		return NULL;
 	}
@@ -728,7 +729,7 @@
 	return file[3] == '\0'; // C:\...
 }
 
-void FiosGetDrives(void)
+void FiosGetDrives()
 {
 	TCHAR drives[256];
 	const TCHAR *s;
@@ -748,8 +749,7 @@
 {
 	// hectonanoseconds between Windows and POSIX epoch
 	static const int64 posix_epoch_hns = 0x019DB1DED53E8000LL;
-	const WIN32_FIND_DATAW *fd = &ent->dir->fd;
-	if (fd->dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)) return false;
+	const WIN32_FIND_DATA *fd = &ent->dir->fd;
 
 	sb->st_size  = ((uint64) fd->nFileSizeHigh << 32) + fd->nFileSizeLow;
 	/* UTC FILETIME to seconds-since-1970 UTC
@@ -763,6 +763,11 @@
 	return true;
 }
 
+bool FiosIsHiddenFile(const struct dirent *ent)
+{
+	return (ent->dir->fd.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)) != 0;
+}
+
 bool FiosGetDiskFreeSpace(const char *path, uint32 *tot)
 {
 	UINT sem = SetErrorMode(SEM_FAILCRITICALERRORS);  // disable 'no-disk' message box
@@ -811,7 +816,7 @@
 	return n;
 }
 
-void CreateConsole(void)
+void CreateConsole()
 {
 	HANDLE hand;
 	CONSOLE_SCREEN_BUFFER_INFO coninfo;
@@ -874,24 +879,22 @@
 	int _set_error_mode(int);
 #endif
 
-#if defined(WINCE) && !defined(_tWinMain)
-/* GCC crosscompiler for WINCE doesn't support wide version */
-# define _tWinMain WinMain
-#endif /* WINCE */
-
-int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
-	LPTSTR lpCmdLine, int nCmdShow)
+int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
 {
 	int argc;
 	char *argv[64]; // max 64 command line arguments
 	char *cmdline;
 
+#if !defined(UNICODE)
+	_codepage = GetACP(); // get system codepage as some kind of a default
+#endif /* UNICODE */
+
 #if defined(UNICODE)
 	/* For UNICODE we need to convert the commandline to char* _AND_
 	 * save it because argv[] points into this buffer and thus needs to
 	 * be available between subsequent calls to FS2OTTD() */
 	char cmdlinebuf[MAX_PATH];
-#endif
+#endif /* UNICODE */
 
 	cmdline = WIDE_TO_MB_BUFFER(GetCommandLine(), cmdlinebuf, lengthof(cmdlinebuf));
 
@@ -940,38 +943,19 @@
 }
 #endif
 
-void DeterminePaths(void)
+void DetermineBasePaths(const char *exe)
 {
-	char *s, *cfg;
-	wchar_t path[MAX_PATH];
-
-	_paths.personal_dir = _paths.game_data_dir = cfg = (char*)malloc(MAX_PATH);
-	GetCurrentDirectoryW(MAX_PATH - 1, path);
-	convert_from_fs(path, cfg, MAX_PATH);
-
-	cfg[0] = toupper(cfg[0]);
-	s = strchr(cfg, '\0');
-	if (s[-1] != '\\') strcpy(s, "\\");
+	_paths.personal_dir = _paths.game_data_dir = MallocT<char>(MAX_PATH);
+#if defined(UNICODE)
+	TCHAR path[MAX_PATH];
+	GetCurrentDirectory(MAX_PATH - 1, path);
+	convert_from_fs(path, _paths.personal_dir, MAX_PATH);
+#else
+	GetCurrentDirectory(MAX_PATH - 1, _paths.personal_dir);
+#endif
 
-	_paths.save_dir = str_fmt("%ssave", cfg);
-	_paths.autosave_dir = str_fmt("%s\\autosave", _paths.save_dir);
-	_paths.scenario_dir = str_fmt("%sscenario", cfg);
-	_paths.heightmap_dir = str_fmt("%sscenario\\heightmap", cfg);
-	_paths.gm_dir = str_fmt("%sgm\\", cfg);
-	_paths.data_dir = str_fmt("%sdata\\", cfg);
-	_paths.lang_dir = str_fmt("%slang\\", cfg);
-
-	if (_config_file == NULL)
-		_config_file = str_fmt("%sopenttd.cfg", _paths.personal_dir);
-
-	_highscore_file = str_fmt("%shs.dat", _paths.personal_dir);
-	_log_file = str_fmt("%sopenttd.log", _paths.personal_dir);
-
-	// make (auto)save and scenario folder
-	CreateDirectoryW(OTTD2FS(_paths.save_dir), NULL);
-	CreateDirectoryW(OTTD2FS(_paths.autosave_dir), NULL);
-	CreateDirectoryW(OTTD2FS(_paths.scenario_dir), NULL);
-	CreateDirectoryW(OTTD2FS(_paths.heightmap_dir), NULL);
+	_paths.personal_dir[0] = toupper(_paths.personal_dir[0]);
+	AppendPathSeparator(_paths.personal_dir,  MAX_PATH);
 }
 
 /**
@@ -991,25 +975,26 @@
 	uint16 width, length;
 
 	if (IsClipboardFormatAvailable(CF_UNICODETEXT)) {
-		const char *ret;
-
 		OpenClipboard(NULL);
 		cbuf = GetClipboardData(CF_UNICODETEXT);
 
 		ptr = (const char*)GlobalLock(cbuf);
-		ret = convert_from_fs((wchar_t*)ptr, utf8_buf, lengthof(utf8_buf));
+		const char *ret = convert_from_fs((wchar_t*)ptr, utf8_buf, lengthof(utf8_buf));
 		GlobalUnlock(cbuf);
 		CloseClipboard();
 
 		if (*ret == '\0') return false;
+#if !defined(UNICODE)
 	} else if (IsClipboardFormatAvailable(CF_TEXT)) {
 		OpenClipboard(NULL);
 		cbuf = GetClipboardData(CF_TEXT);
 
 		ptr = (const char*)GlobalLock(cbuf);
-		ttd_strlcpy(utf8_buf, ptr, lengthof(utf8_buf));
+		ttd_strlcpy(utf8_buf, FS2OTTD(ptr), lengthof(utf8_buf));
+
 		GlobalUnlock(cbuf);
 		CloseClipboard();
+#endif /* UNICODE */
 	} else {
 		return false;
 	}
@@ -1053,7 +1038,7 @@
 
 // Utility function to get the current timestamp in milliseconds
 // Useful for profiling
-int64 GetTS(void)
+int64 GetTS()
 {
 	static double freq;
 	__int64 value;
@@ -1065,8 +1050,103 @@
 	return (__int64)(value * freq);
 }
 
-/** Convert from OpenTTD's encoding to that of the local environment in
- * UNICODE. OpenTTD encoding is UTF8, local is wide-char
+
+/**
+ * Convert to OpenTTD's encoding from that of the local environment.
+ * When the project is built in UNICODE, the system codepage is irrelevant and
+ * the input string is wide. In ANSI mode, the string is in the
+ * local codepage which we'll convert to wide-char, and then to UTF-8.
+ * OpenTTD internal encoding is UTF8.
+ * The returned value's contents can only be guaranteed until the next call to
+ * this function. So if the value is needed for anything else, use convert_from_fs
+ * @param name pointer to a valid string that will be converted (local, or wide)
+ * @return pointer to the converted string; if failed string is of zero-length
+ * @see the current code-page comes from video\win32_v.cpp, event-notification
+ * WM_INPUTLANGCHANGE */
+const char *FS2OTTD(const TCHAR *name)
+{
+	static char utf8_buf[512];
+#if defined(UNICODE)
+	return convert_from_fs(name, utf8_buf, lengthof(utf8_buf));
+#else
+	char *s = utf8_buf;
+
+	for (; *name != '\0'; name++) {
+		wchar_t w;
+		int len = MultiByteToWideChar(_codepage, 0, name, 1, &w, 1);
+		if (len != 1) {
+			DEBUG(misc, 0, "[utf8] M2W error converting '%c'. Errno %d", *name, GetLastError());
+			continue;
+		}
+
+		if (s + Utf8CharLen(w) >= lastof(utf8_buf)) break;
+		s += Utf8Encode(s, w);
+	}
+
+	*s = '\0';
+	return utf8_buf;
+#endif /* UNICODE */
+}
+
+/**
+ * Convert from OpenTTD's encoding to that of the local environment.
+ * When the project is built in UNICODE the system codepage is irrelevant and
+ * the converted string is wide. In ANSI mode, the UTF8 string is converted
+ * to multi-byte.
+ * OpenTTD internal encoding is UTF8.
+ * The returned value's contents can only be guaranteed until the next call to
+ * this function. So if the value is needed for anything else, use convert_from_fs
+ * @param name pointer to a valid string that will be converted (UTF8)
+ * @return pointer to the converted string; if failed string is of zero-length
+ * @see the current code-page comes from video\win32_v.cpp, event-notification
+ * WM_INPUTLANGCHANGE */
+const TCHAR *OTTD2FS(const char *name)
+{
+	static TCHAR system_buf[512];
+#if defined(UNICODE)
+	return convert_to_fs(name, system_buf, lengthof(system_buf));
+#else
+	char *s = system_buf;
+
+	for (WChar c; (c = Utf8Consume(&name)) != '\0';) {
+		if (s >= lastof(system_buf)) break;
+
+		char mb;
+		int len = WideCharToMultiByte(_codepage, 0, (wchar_t*)&c, 1, &mb, 1, NULL, NULL);
+		if (len != 1) {
+			DEBUG(misc, 0, "[utf8] W2M error converting '0x%X'. Errno %d", c, GetLastError());
+			continue;
+		}
+
+		*s++ = mb;
+	}
+
+	*s = '\0';
+	return system_buf;
+#endif /* UNICODE */
+}
+
+
+/** Convert to OpenTTD's encoding from that of the environment in
+ * UNICODE. OpenTTD encoding is UTF8, local is wide
+ * @param name pointer to a valid string that will be converted
+ * @param utf8_buf pointer to a valid buffer that will receive the converted string
+ * @param buflen length in characters of the receiving buffer
+ * @return pointer to utf8_buf. If conversion fails the string is of zero-length */
+char *convert_from_fs(const wchar_t *name, char *utf8_buf, size_t buflen)
+{
+	int len = WideCharToMultiByte(CP_UTF8, 0, name, -1, utf8_buf, buflen, NULL, NULL);
+	if (len == 0) {
+		DEBUG(misc, 0, "[utf8] W2M error converting wide-string. Errno %d", GetLastError());
+		utf8_buf[0] = '\0';
+	}
+
+	return utf8_buf;
+}
+
+
+/** Convert from OpenTTD's encoding to that of the environment in
+ * UNICODE. OpenTTD encoding is UTF8, local is wide
  * @param name pointer to a valid string that will be converted
  * @param utf16_buf pointer to a valid wide-char buffer that will receive the
  * converted string
@@ -1076,55 +1156,13 @@
 {
 	int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, utf16_buf, buflen);
 	if (len == 0) {
-		DEBUG(misc, 0, "[utf8] error converting '%s'. Errno %d", name, GetLastError());
+		DEBUG(misc, 0, "[utf8] M2W error converting '%s'. Errno %d", name, GetLastError());
 		utf16_buf[0] = '\0';
 	}
 
 	return utf16_buf;
 }
 
-/** Convert from OpenTTD's encoding to that of the local environment in
- * UNICODE. OpenTTD encoding is UTF8, local is wide-char.
- * The returned value's contents can only be guaranteed until the next call to
- * this function. So if the value is needed for anything else, use convert_from_fs
- * @param name pointer to a valid string that will be converted
- * @return pointer to the converted string; if failed string is of zero-length */
-const wchar_t *OTTD2FS(const char *name)
-{
-	static wchar_t utf16_buf[512];
-	return convert_to_fs(name, utf16_buf, lengthof(utf16_buf));
-}
-
-
-/** Convert to OpenTTD's encoding from that of the local environment in
- * UNICODE. OpenTTD encoding is UTF8, local is wide-char
- * @param name pointer to a valid string that will be converted
- * @param utf8_buf pointer to a valid buffer that will receive the converted string
- * @param buflen length in characters of the receiving buffer
- * @return pointer to utf8_buf. If conversion fails the string is of zero-length */
-char *convert_from_fs(const wchar_t *name, char *utf8_buf, size_t buflen)
-{
-	int len = WideCharToMultiByte(CP_UTF8, 0, name, -1, utf8_buf, buflen, NULL, NULL);
-	if (len == 0) {
-		DEBUG(misc, 0, "[utf8] error converting wide-string. Errno %d", GetLastError());
-		utf8_buf[0] = '\0';
-	}
-
-	return utf8_buf;
-}
-
-/** Convert to OpenTTD's encoding from that of the local environment in
- * UNICODE. OpenTTD encoding is UTF8, local is wide-char.
- * The returned value's contents can only be guaranteed until the next call to
- * this function. So if the value is needed for anything else, use convert_from_fs
- * @param name pointer to a valid string that will be converted
- * @return pointer to the converted string; if failed string is of zero-length */
-const char *FS2OTTD(const wchar_t *name)
-{
-	static char utf8_buf[512];
-	return convert_from_fs(name, utf8_buf, lengthof(utf8_buf));
-}
-
 /** Our very own SHGetFolderPath function for support of windows operating
  * systems that don't have this function (eg Win9x, etc.). We try using the
  * native function, and if that doesn't exist we will try a more crude approach
--- a/src/win32.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/win32.h	Mon Mar 19 12:38:16 2007 +0000
@@ -26,6 +26,7 @@
 # define WIDE_TO_MB(str) FS2OTTD(str)
 # define WIDE_TO_MB_BUFFER(str, buffer, buflen) convert_from_fs(str, buffer, buflen)
 #else
+extern uint _codepage; // local code-page in the system @see win32_v.cpp:WM_INPUTLANGCHANGE
 # define MB_TO_WIDE(str) (str)
 # define MB_TO_WIDE_BUFFER(str, buffer, buflen) (str)
 # define WIDE_TO_MB(str) (str)
--- a/src/window.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/window.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -499,7 +499,7 @@
  * - Any sticked windows since we wanted to keep these
  * @return w pointer to the window that is going to be deleted
  */
-static Window *FindDeletableWindow(void)
+static Window *FindDeletableWindow()
 {
 	Window* const *wz;
 
@@ -519,7 +519,7 @@
  * @see FindDeletableWindow()
  * @return w Pointer to the window that is being deleted
  */
-static Window *ForceFindDeletableWindow(void)
+static Window *ForceFindDeletableWindow()
 {
 	Window* const *wz;
 
@@ -555,7 +555,7 @@
 	}
 }
 
-static Window *FindFreeWindow(void)
+static Window *FindFreeWindow()
 {
 	Window *w;
 
@@ -665,9 +665,9 @@
 	return LocalAllocateWindow(x, y, width, height, proc, cls, widget, 0);
 }
 
-typedef struct SizeRect {
+struct SizeRect {
 	int left,top,width,height;
-} SizeRect;
+};
 
 
 static SizeRect _awap_r;
@@ -891,7 +891,7 @@
 	return NULL;
 }
 
-void InitWindowSystem(void)
+void InitWindowSystem()
 {
 	IConsoleClose();
 
@@ -901,7 +901,7 @@
 	_no_scroll = 0;
 }
 
-void UnInitWindowSystem(void)
+void UnInitWindowSystem()
 {
 	Window **wz;
 
@@ -919,7 +919,7 @@
 	assert(_last_z_window == _z_windows);
 }
 
-void ResetWindowSystem(void)
+void ResetWindowSystem()
 {
 	UnInitWindowSystem();
 	InitWindowSystem();
@@ -929,7 +929,7 @@
 	_thd.new_pos.y = 0;
 }
 
-static void DecreaseWindowCounters(void)
+static void DecreaseWindowCounters()
 {
 	Window *w;
 	Window* const *wz;
@@ -954,12 +954,12 @@
 	}
 }
 
-Window *GetCallbackWnd(void)
+Window *GetCallbackWnd()
 {
 	return FindWindowById(_thd.window_class, _thd.window_number);
 }
 
-static void HandlePlacePresize(void)
+static void HandlePlacePresize()
 {
 	Window *w;
 	WindowEvent e;
@@ -979,7 +979,7 @@
 	w->wndproc(w, &e);
 }
 
-static bool HandleDragDrop(void)
+static bool HandleDragDrop()
 {
 	Window *w;
 	WindowEvent e;
@@ -1003,7 +1003,7 @@
 	return false;
 }
 
-static bool HandlePopupMenu(void)
+static bool HandlePopupMenu()
 {
 	Window *w;
 	WindowEvent e;
@@ -1030,7 +1030,7 @@
 	return false;
 }
 
-static bool HandleMouseOver(void)
+static bool HandleMouseOver()
 {
 	Window *w;
 	WindowEvent e;
@@ -1114,7 +1114,7 @@
 
 static bool _dragging_window;
 
-static bool HandleWindowDragging(void)
+static bool HandleWindowDragging()
 {
 	Window* const *wz;
 	// Get out immediately if no window is being dragged at all.
@@ -1338,7 +1338,7 @@
 }
 
 
-static bool HandleScrollbarScrolling(void)
+static bool HandleScrollbarScrolling()
 {
 	Window* const *wz;
 	int i;
@@ -1385,16 +1385,18 @@
 	return false;
 }
 
-static bool HandleViewportScroll(void)
+static bool HandleViewportScroll()
 {
 	WindowEvent e;
 	Window *w;
 
+	bool scrollwheel_scrolling = _patches.scrollwheel_scrolling == 1 && (_cursor.v_wheel != 0 || _cursor.h_wheel != 0);
+
 	if (!_scrolling_viewport) return true;
 
 	w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y);
 
-	if (!_right_button_down || w == NULL) {
+	if (!(_right_button_down || scrollwheel_scrolling) || w == NULL) {
 		_cursor.fix_at = false;
 		_scrolling_viewport = false;
 		return true;
@@ -1408,6 +1410,14 @@
 		e.we.scroll.delta.y = _cursor.delta.y;
 	}
 
+	if (scrollwheel_scrolling) {
+		/* We are using scrollwheels for scrolling */
+		e.we.scroll.delta.x = _cursor.h_wheel;
+		e.we.scroll.delta.y = _cursor.v_wheel;
+		_cursor.v_wheel = 0;
+		_cursor.h_wheel = 0;
+	}
+
 	/* Create a scroll-event and send it to the window */
 	e.event = WE_SCROLL;
 	w->wndproc(w, &e);
@@ -1580,12 +1590,12 @@
 	}
 }
 
-extern void UpdateTileSelection(void);
-extern bool VpHandlePlaceSizingDrag(void);
+extern void UpdateTileSelection();
+extern bool VpHandlePlaceSizingDrag();
 
 static int _input_events_this_tick = 0;
 
-static void HandleAutoscroll(void)
+static void HandleAutoscroll()
 {
 	Window *w;
 	ViewPort *vp;
@@ -1628,6 +1638,7 @@
 	int x,y;
 	Window *w;
 	ViewPort *vp;
+	bool scrollwheel_scrolling = _patches.scrollwheel_scrolling == 1 && (_cursor.v_wheel != 0 || _cursor.h_wheel != 0);
 
 	DecreaseWindowCounters();
 	HandlePlacePresize();
@@ -1643,7 +1654,7 @@
 	x = _cursor.pos.x;
 	y = _cursor.pos.y;
 
-	if (click == 0 && mousewheel == 0) return;
+	if (click == 0 && mousewheel == 0 && !scrollwheel_scrolling) return;
 
 	w = FindWindowFromPt(x, y);
 	if (w == NULL) return;
@@ -1654,18 +1665,22 @@
 	if (vp != NULL && (_game_mode == GM_MENU || IsGeneratingWorld())) return;
 
 	if (mousewheel != 0) {
-		WindowEvent e;
+		if (_patches.scrollwheel_scrolling == 0) {
+			/* Scrollwheel is in zoom mode. Make the zoom event. */
+			WindowEvent e;
 
-		/* Send WE_MOUSEWHEEL event to window */
-		e.event = WE_MOUSEWHEEL;
-		e.we.wheel.wheel = mousewheel;
-		w->wndproc(w, &e);
+			/* Send WE_MOUSEWHEEL event to window */
+			e.event = WE_MOUSEWHEEL;
+			e.we.wheel.wheel = mousewheel;
+			w->wndproc(w, &e);
+		}
 
 		/* Dispatch a MouseWheelEvent for widgets if it is not a viewport */
 		if (vp == NULL) DispatchMouseWheelEvent(w, GetWidgetFromPos(w, x - w->left, y - w->top), mousewheel);
 	}
 
 	if (vp != NULL) {
+		if (scrollwheel_scrolling) click = 2; // we are using the scrollwheel in a viewport, so we emulate right mouse button
 		switch (click) {
 			case 1:
 				DEBUG(misc, 2, "Cursor: 0x%X (%d)", _cursor.sprite, _cursor.sprite);
@@ -1673,7 +1688,7 @@
 						// query button and place sign button work in pause mode
 						_cursor.sprite != SPR_CURSOR_QUERY &&
 						_cursor.sprite != SPR_CURSOR_SIGN &&
-						_pause != 0 &&
+						_pause_game != 0 &&
 						!_cheats.build_in_pause.value) {
 					return;
 				}
@@ -1695,12 +1710,17 @@
 	} else {
 		switch (click) {
 			case 1: DispatchLeftClickEvent(w, x - w->left, y - w->top);  break;
+			default:
+				if (!scrollwheel_scrolling || w == NULL || w->window_class != WC_SMALLMAP) break;
+				/* We try to use the scrollwheel to scroll since we didn't touch any of the buttons.
+				* Simulate a right button click so we can get started. */
+				/* fallthough */
 			case 2: DispatchRightClickEvent(w, x - w->left, y - w->top); break;
 		}
 	}
 }
 
-void HandleMouseEvents(void)
+void HandleMouseEvents()
 {
 	int click;
 	int mousewheel;
@@ -1738,13 +1758,13 @@
 	MouseLoop(click, mousewheel);
 }
 
-void InputLoop(void)
+void InputLoop()
 {
 	HandleMouseEvents();
 	HandleAutoscroll();
 }
 
-void UpdateWindows(void)
+void UpdateWindows()
 {
 	Window* const *wz;
 	static int we4_timer = 0;
@@ -1857,7 +1877,7 @@
 	}
 }
 
-void CallWindowTickEvent(void)
+void CallWindowTickEvent()
 {
 	Window* const *wz;
 
@@ -1866,7 +1886,7 @@
 	}
 }
 
-void DeleteNonVitalWindows(void)
+void DeleteNonVitalWindows()
 {
 	Window* const *wz;
 
@@ -1895,7 +1915,7 @@
  * with this function. It closes all windows calling the standard function,
  * then, does a little hacked loop of closing all stickied windows. Note
  * that standard windows (status bar, etc.) are not stickied, so these aren't affected */
-void DeleteAllNonVitalWindows(void)
+void DeleteAllNonVitalWindows()
 {
 	Window* const *wz;
 
@@ -1915,7 +1935,7 @@
 }
 
 /* Delete all always on-top windows to get an empty screen */
-void HideVitalWindows(void)
+void HideVitalWindows()
 {
 	DeleteWindowById(WC_TOOLBAR_MENU, 0);
 	DeleteWindowById(WC_MAIN_TOOLBAR, 0);
--- a/src/window.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/window.h	Mon Mar 19 12:38:16 2007 +0000
@@ -11,7 +11,7 @@
 #include "rail.h"
 #include "airport.h"
 
-typedef struct WindowEvent WindowEvent;
+struct WindowEvent;
 
 typedef void WindowProc(Window *w, WindowEvent *e);
 
@@ -42,7 +42,7 @@
      w->resize.width or w->resize.height.
    That was all.. good luck, and enjoy :) -- TrueLight */
 
-typedef enum ResizeFlags {
+enum ResizeFlag {
 	RESIZE_NONE   = 0,  ///< no resize required
 
 	RESIZE_LEFT   = 1,  ///< left resize flag
@@ -64,28 +64,28 @@
 	WIDG_DISABLED = 4,  ///< widget is greyed out, not available
 	WIDG_HIDDEN   = 5,  ///< widget is made invisible
 	WIDG_LOWERED  = 6,  ///< widget is paint lowered, a pressed button in fact
-} ResizeFlag;
+};
 
 enum {
 	WIDGET_LIST_END = -1, ///< indicate the end of widgets' list for vararg functions
 };
 
-typedef struct Widget {
+struct Widget {
 	byte type;                        ///< Widget type, see WindowWidgetTypes
 	byte display_flags;               ///< Resize direction, alignment, etc. during resizing, see ResizeFlags
 	byte color;                       ///< Widget colour, see docs/ottd-colourtext-palette.png
 	int16 left, right, top, bottom;   ///< The position offsets inside the window
 	uint16 data;                      ///< The String/Image or special code (list-matrixes) of a widget
 	StringID tooltips;                ///< Tooltips that are shown when rightclicking on a widget
-} Widget;
+};
 
-typedef enum FrameFlags {
+enum FrameFlags {
 	FR_NONE         = 0x00,
 	FR_TRANSPARENT  = 0x01,  ///< Makes the background transparent if set
 	FR_BORDERONLY   = 0x10,  ///< Draw border only, no background
 	FR_LOWERED      = 0x20,  ///< If set the frame is lowered and the background color brighter (ie. buttons when pressed)
 	FR_DARKENED     = 0x40,  ///< If set the background is darker, allows for lowered frames with normal background color when used with FR_LOWERED (ie. dropdown boxes)
-} FrameFlags;
+};
 
 DECLARE_ENUM_AS_BIT_SET(FrameFlags);
 
@@ -186,14 +186,14 @@
 	} we;
 };
 
-typedef struct WindowDesc {
+struct WindowDesc {
 	int16 left, top, width, height;
 	WindowClass cls;
 	WindowClass parent_cls;
 	uint32 flags;
 	const Widget *widgets;
 	WindowProc *proc;
-} WindowDesc;
+};
 
 enum WindowDefaultFlag {
 	WDF_STD_TOOLTIPS    =   1, ///< use standard routine when displaying tooltips
@@ -214,14 +214,14 @@
 	WDP_ALIGN_TBL = -4, ///< Align the left side of the window with the left side of the main toolbar
 };
 
-typedef struct Textbuf {
+struct Textbuf {
 	char *buf;                  ///< buffer in which text is saved
 	uint16 maxlength, maxwidth; ///< the maximum size of the buffer. Maxwidth specifies screensize in pixels, maxlength is in bytes
 	uint16 length, width;       ///< the current size of the string. Width specifies screensize in pixels, length is in bytes
 	bool caret;                 ///< is the caret ("_") visible or not
 	uint16 caretpos;            ///< the current position of the caret in the buffer, in bytes
 	uint16 caretxoffs;          ///< the current position of the caret in pixels
-} Textbuf;
+};
 
 #define WP(ptr,str) (*(str*)(ptr)->custom)
 /* You cannot 100% reliably calculate the biggest custom struct as
@@ -229,22 +229,22 @@
  * 96 is the largest window-size for 64-bit machines currently */
 #define WINDOW_CUSTOM_SIZE 96
 
-typedef struct Scrollbar {
+struct Scrollbar {
 	uint16 count, cap, pos;
-} Scrollbar;
+};
 
-typedef struct ResizeInfo {
+struct ResizeInfo {
 	uint width; ///< Minimum width and height
 	uint height;
 	uint step_width; ///< In how big steps the width and height go
 	uint step_height;
-} ResizeInfo;
+};
 
-typedef struct WindowMessage {
-		int msg;
-		int wparam;
-		int lparam;
-} WindowMessage;
+struct WindowMessage {
+	int msg;
+	int wparam;
+	int lparam;
+};
 
 struct Window {
 	uint16 flags4;
@@ -271,16 +271,16 @@
 	byte custom[WINDOW_CUSTOM_SIZE];
 };
 
-typedef struct querystr_d {
+struct querystr_d {
 	StringID caption;
 	Textbuf text;
 	const char *orig;
 	CharSetFilter afilter;
 	bool handled;
-} querystr_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(querystr_d));
 
-typedef struct {
+struct menu_d {
 	byte item_count;      ///< follow_vehicle
 	byte sel_index;       ///< scrollpos_x
 	byte main_button;     ///< scrollpos_y
@@ -288,36 +288,36 @@
 	StringID string_id;   ///< unk30
 	uint16 checked_items; ///< unk32
 	byte disabled_items;
-} menu_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(menu_d));
 
-typedef struct {
+struct def_d {
 	int16 data_1, data_2, data_3;
 	int16 data_4, data_5;
 	bool close;
 	byte byte_1;
-} def_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(def_d));
 
-typedef struct {
+struct void_d {
 	void *data;
-} void_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(void_d));
 
-typedef struct {
+struct tree_d {
 	uint16 base;
 	uint16 count;
-} tree_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(tree_d));
 
-typedef struct {
+struct tooltips_d {
 	StringID string_id;
 	byte paramcount;
 	uint32 params[5];
-} tooltips_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(tooltips_d));
 
-typedef struct {
+struct buildvehicle_d {
 	byte vehicle_type;
 	union {
 		RailTypeByte railtype;
@@ -330,10 +330,10 @@
 	EngineID sel_engine;
 	EngineID rename_engine;
 	EngineList eng_list;
-} buildvehicle_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(buildvehicle_d));
 
-typedef struct {
+struct replaceveh_d {
 	byte sel_index[2];
 	EngineID sel_engine[2];
 	uint16 count[2];
@@ -342,10 +342,10 @@
 	bool update_left;
 	bool update_right;
 	bool init_lists;
-} replaceveh_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(replaceveh_d));
 
-typedef struct {
+struct depot_d {
 	VehicleID sel;
 	byte type;
 	bool generate_list;
@@ -355,110 +355,110 @@
 	uint16 wagon_count;
 	Vehicle **vehicle_list;
 	Vehicle **wagon_list;
-} depot_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(depot_d));
 
-typedef struct {
+struct order_d {
 	int sel;
-} order_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(order_d));
 
-typedef struct {
+struct traindetails_d {
 	byte tab;
-} traindetails_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(traindetails_d));
 
-typedef struct {
+struct smallmap_d {
 	int32 scroll_x;
 	int32 scroll_y;
 	int32 subscroll;
-} smallmap_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(smallmap_d));
 
-typedef struct {
+struct facesel_d {
 	uint32 face;
 	byte gender;
-} facesel_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(facesel_d));
 
-typedef struct {
+struct refit_d {
 	int sel;
 	struct RefitOption *cargo;
 	struct RefitList *list;
 	uint length;
 	VehicleOrderID order;
-} refit_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(refit_d));
 
-typedef struct {
+struct vp_d {
 	VehicleID follow_vehicle;
 	int32 scrollpos_x;
 	int32 scrollpos_y;
-} vp_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vp_d));
 
 /* vp2_d is the same as vp_d, except for the data_# values.. */
-typedef struct {
+struct vp2_d {
 	VehicleID follow_vehicle;
 	int32 scrollpos_x;
 	int32 scrollpos_y;
 	byte data_1;
 	byte data_2;
 	byte data_3;
-} vp2_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vp2_d));
 
-typedef struct {
+struct news_d {
 	uint16 follow_vehicle;
 	int32 scrollpos_x;
 	int32 scrollpos_y;
 	NewsItem *ni;
-} news_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(news_d));
 
-typedef struct {
+struct highscore_d {
 	uint32 background_img;
 	int8 rank;
-} highscore_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(highscore_d));
 
-typedef struct {
+struct scroller_d {
 	int height;
 	uint16 counter;
-} scroller_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(scroller_d));
 
-typedef enum SortListFlags {
+enum SortListFlags {
 	VL_NONE    = 0x00,  ///< no sort
 	VL_DESC    = 0x01,  ///< sort descending or ascending
 	VL_RESORT  = 0x02,  ///< instruct the code to resort the list in the next loop
 	VL_REBUILD = 0x04,  ///< create sort-listing to use for qsort and friends
 	VL_END     = 0x08
-} SortListFlags;
+};
 
 DECLARE_ENUM_AS_BIT_SET(SortListFlags);
 
-typedef struct Listing {
+struct Listing {
 	bool order;    ///< Ascending/descending
 	byte criteria; ///< Sorting criteria
-} Listing;
+};
 
-typedef struct list_d {
+struct list_d {
 	uint16 list_length;  ///< length of the list being sorted
 	byte sort_type;      ///< what criteria to sort on
 	SortListFlags flags; ///< used to control sorting/resorting/etc.
 	uint16 resort_timer; ///< resort list after a given amount of ticks if set
-} list_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(list_d));
 
-typedef struct message_d {
+struct message_d {
 	int msg;
 	int wparam;
 	int lparam;
-} message_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(message_d));
 
-typedef struct dropdown_d {
+struct dropdown_d {
 	uint32 disabled_state;
 	uint32 hidden_state;
 	WindowClass parent_wnd_class;
@@ -469,7 +469,7 @@
 	const StringID *items;
 	byte click_delay;
 	bool drag_mode;
-} dropdown_d;
+};
 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(dropdown_d));
 
 
@@ -492,6 +492,7 @@
 	WWT_TEXTBTN,    ///< button with text
 	WWT_TEXTBTN_2,  ///< button with diff text when clicked
 	WWT_LABEL,      ///< centered label
+	WWT_TEXT,       ///< pure simple text
 	WWT_MATRIX,
 	WWT_SCROLLBAR,
 	WWT_FRAME,      ///< frame
@@ -533,7 +534,7 @@
 
 /* window.cpp */
 void CallWindowEventNP(Window *w, int event);
-void CallWindowTickEvent(void);
+void CallWindowTickEvent();
 void SetWindowDirty(const Window *w);
 void SendWindowMessage(WindowClass wnd_class, WindowNumber wnd_num, int msg, int wparam, int lparam);
 void SendWindowMessageClass(WindowClass wnd_class, int msg, int wparam, int lparam);
@@ -709,11 +710,11 @@
 	return HASBIT(w->widget[widget_index].display_flags, WIDG_LOWERED);
 }
 
-void InitWindowSystem(void);
-void UnInitWindowSystem(void);
-void ResetWindowSystem(void);
+void InitWindowSystem();
+void UnInitWindowSystem();
+void ResetWindowSystem();
 int GetMenuItemIndex(const Window *w, int x, int y);
-void InputLoop(void);
+void InputLoop();
 void InvalidateWidget(const Window *w, byte widget_index);
 void InvalidateThisWindowData(Window *w);
 void InvalidateWindowData(WindowClass cls, WindowNumber number);
@@ -738,11 +739,11 @@
 
 void HandleButtonClick(Window *w, byte widget);
 
-Window *GetCallbackWnd(void);
-void DeleteNonVitalWindows(void);
-void DeleteAllNonVitalWindows(void);
-void HideVitalWindows(void);
-void ShowVitalWindows(void);
+Window *GetCallbackWnd();
+void DeleteNonVitalWindows();
+void DeleteAllNonVitalWindows();
+void HideVitalWindows();
+void ShowVitalWindows();
 Window **FindWindowZPosition(const Window *w);
 
 /* window.cpp */
--- a/src/yapf/follow_track.hpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/yapf/follow_track.hpp	Mon Mar 19 12:38:16 2007 +0000
@@ -22,7 +22,7 @@
 
 	FORCEINLINE void Init(const Vehicle* v, CPerformanceTimer* pPerf)
 	{
-		assert(!IsRailTT() || (v != NULL && v->type == VEH_Train));
+		assert(!IsRailTT() || (v != NULL && v->type == VEH_TRAIN));
 		m_veh = v;
 		m_pPerf = pPerf;
 		// don't worry, all is inlined so compiler should remove unnecessary initializations
--- a/src/yapf/yapf.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/yapf/yapf.h	Mon Mar 19 12:38:16 2007 +0000
@@ -66,7 +66,7 @@
 void YapfNotifyTrackLayoutChange(TileIndex tile, Track track);
 
 /** performance measurement helpers */
-void* NpfBeginInterval(void);
+void* NpfBeginInterval();
 int NpfEndInterval(void* perf);
 
 
@@ -88,7 +88,7 @@
  */
 
 /** Base struct for track followers. */
-typedef struct FollowTrack_t
+struct FollowTrack_t
 {
 	const Vehicle*      m_veh;           ///< moving vehicle
 	TileIndex           m_old_tile;      ///< the origin (vehicle moved from) before move
@@ -100,7 +100,7 @@
 	bool                m_is_bridge;     ///< last turn passed bridge ramp
 	bool                m_is_station;    ///< last turn passed station
 	int                 m_tiles_skipped; ///< number of skipped tunnel or station tiles
-} FollowTrack_t;
+};
 
 /** Initializes FollowTrack_t structure */
 void FollowTrackInit(FollowTrack_t *This, const Vehicle* v);
--- a/src/yapf/yapf.hpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/yapf/yapf.hpp	Mon Mar 19 12:38:16 2007 +0000
@@ -23,7 +23,7 @@
 #include "../debug.h"
 
 extern Patches _patches_newgame;
-extern uint64 _rdtsc(void);
+extern uint64 _rdtsc();
 
 #include <limits.h>
 #include <new>
--- a/src/yapf/yapf_costrail.hpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/yapf/yapf_costrail.hpp	Mon Mar 19 12:38:16 2007 +0000
@@ -154,7 +154,7 @@
 		int cost = 0;
 		const Vehicle* v = Yapf().GetVehicle();
 		assert(v != NULL);
-		assert(v->type == VEH_Train);
+		assert(v->type == VEH_TRAIN);
 		assert(v->u.rail.cached_total_length != 0);
 		int needed_platform_length = (v->u.rail.cached_total_length + TILE_SIZE - 1) / TILE_SIZE;
 		if (platform_length > needed_platform_length) {
--- a/src/yapf/yapf_settings.h	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/yapf/yapf_settings.h	Mon Mar 19 12:38:16 2007 +0000
@@ -11,17 +11,17 @@
 # ifndef YS_DEF
 /*
  *  if YS_DEF is not defined, we will only do following declaration:
- *  typedef struct YapfSettings {
+ *  struct YapfSettings {
  *    bool   disable_node_optimization;
  *    uint32 max_search_nodes;
  *    .... all other yapf related settings ...
- *  } YapfSettings;
+ *  };
  *
  *  otherwise we will just expand YS_DEF_xx macros and then #undef them
  */
-#  define YS_DEF_BEGIN typedef struct YapfSettings {
+#  define YS_DEF_BEGIN struct YapfSettings {
 #  define YS_DEF(type, name) type name;
-#  define YS_DEF_END } YapfSettings;
+#  define YS_DEF_END };
 
 # endif /* !YS_DEF */