(svn r13689) [0.6] -Backport from trunk: 0.6
authorrubidium
Wed, 09 Jul 2008 19:30:44 +0000
branch0.6
changeset 11131 d8136dad6b1c
parent 11130 488ecb9d3296
child 11132 6dd6907c378d
(svn r13689) [0.6] -Backport from trunk:
- Fix: Server crashing when banning the rconning client (r13661)
- Fix: Incorrect usage of strtoul (r13508)
- Fix: Crash when one tries to raise the nothern corner of MP_VOID tiles (i.e. the southern corner of the tiles on the southern map edge) in the scenario editor [FS#2106] (r13624)
- Fix: Division by zero when one would press 'd' (skip order) when there's no order (r13409)
changelog.txt
known-bugs.txt
src/console_cmds.cpp
src/genworld_gui.cpp
src/network/network_server.cpp
src/order_gui.cpp
src/rev.cpp.in
src/terraform_gui.cpp
--- a/changelog.txt	Wed Jul 09 19:20:50 2008 +0000
+++ b/changelog.txt	Wed Jul 09 19:30:44 2008 +0000
@@ -1,3 +1,35 @@
+0.6.2-RC1 (2008-??-??)
+------------------------------------------------------------------------
+- Fix: In the case that elrails and 'realistic' acceleration are disabled all electrified engines would have no power on load, until the vehicle got turned around, loaded or got into a depot [FS#2102]- Fix: Saving TTD imported games in recession failed due to wrong (and unneeded) type conversions in the saveload code [FS#2131] (r13679)
+- Fix: Inactive companies from old (TTD) saves could be marked active in some cases, which then loads garbage in their statistics and such [FS#2126] (r13676)
+- Fix: Memory leak when NewGRFs got forcefully disabled and they defined GOTO labels (r13675)
+- Fix: Crash when drawing a non-real sprite caused by NewGRF interference [FS#2127] (r13674)
+- Fix: Desync when building electrified trains on a dedicated server that was started with electrification disabled [FS#2122] (r13673)
+- Fix: Bus/truck forgetting go-to-depot order when entering a non-drivethrough road stop [FS#2117] (r13664)
+- Fix: Server crashing when banning the rconning client (r13661)
+- Fix: Signals were not updated correctly when a player removed a non-existing track piece (r13626)
+- Fix: Crash when one tries to raise the nothern corner of MP_VOID tiles (i.e. the southern corner of the tiles on the southern map edge) in the scenario editor [FS#2106] (r13624)
+X 13623 make things look nicer
+- Fix: Only the front of a RV would be considered when determining to what cargos a vehicle can be refitted instead of all cargos [FS#2109] (r13622)
+- Fix: If the first bridge can not be build for a given length, then none of the other bridges can. Effectively meaning that if someone replaces the first bridge with a bridge that can be only 3 tiles longs then only other bridges that can be 3 tiles long will be buildable, but only if they are 3 tiles long [FS#2100] (r13611)
+- Fix: Signal states could be propagated through waypoints built in orthogonal axis (r13589)
+- Fix: [OSX] 10.5 failed to switch to fullscreen (r13584)
+- Fix: RVs continueing onto next DT station when they are build adjacent to them [FS#2040] (r13581)
+- Fix: Disable static NewGRFs when non-static NewGRFs query them in the context of network games. This makes it impossible for static NewGRFs to disable non-static NewGRFs and 'bad' things happening because the non-static NewGRF doesn't know about the static NewGRF (r13576)
+- Fix: Properly count number of non-north housetiles [FS#2083] (r13518)
+- Fix: Incorrect usage of strtoul (r13508)
+- Fix: Clear the memory for the new AI during the loading of a savegame so it does not try to execute commands generated in a different savegame, which could be resulting in the AI trying to give orders to stations that do not exist (r13505)
+- Fix: Drawing of zoomed out partial sprites could cause deadlocks or crashes (r13502)
+- Fix: First determine where to *exactly* build a house before asking a NewGRF whether the location is good instead of possibly moving the house a tile after the NewGRF said the location is good (r13489)
+- Fix: Track was not removed on company bankrupcy when there was a ship on lower halftile (r13488)
+- Fix: Let ships also navigate on half-tile sloped watery rail tiles (r13485)
+- Fix: Road vehicles stoppping at drive through stations of other companies [FS#2050] (r13480)
+- Fix: Division by zero when one would press 'd' (skip order) when there's no order (r13409)
+- Fix: Do not crash when resolving vehicle sprite groups with zero sprites (r13397)
+- Fix: In the purchase list, CB36 for capacity was not called for the first part of rail and road vehicles (r13385)
+- Fix: Loading of very old OpenTTD savegames was broken (r13373)
+
+
 0.6.1 (2008-06-01)
 ------------------------------------------------------------------------
 - Fix: Industry tiles would sometimes tell they need a 'level' slope when they do not want the slope (r13348)
--- a/known-bugs.txt	Wed Jul 09 19:20:50 2008 +0000
+++ b/known-bugs.txt	Wed Jul 09 19:30:44 2008 +0000
@@ -15,12 +15,11 @@
 ------------------------------------------------------------------------
 URL: http://bugs.openttd.org
 
+- 2085	Vehicle list of shared vehicles without orders not possible
 - 1944	Road vehicles not picking empty drivethrough platform
 - 1923	Unique names not always enforced
-- 1891	Go to depot for servicing is forgotten
 - 1890	Airplanes copy helipcopters goto heliport order
 - 1885	Almost all unserved industries die in big maps
-- 1868	In depot, cannot move wagon from another line before first wagon in a wagon-only line
 - 1858	Industry legend in small map overwrites buttons
 - 1852	Minor tram reversing glitches
 - 1802	Path with space in configure fails
--- a/src/console_cmds.cpp	Wed Jul 09 19:20:50 2008 +0000
+++ b/src/console_cmds.cpp	Wed Jul 09 19:30:44 2008 +0000
@@ -426,9 +426,9 @@
 	}
 
 	if (ci != NULL) {
+		IConsolePrint(_icolour_def, "Client banned");
 		banip = inet_ntoa(*(struct in_addr *)&ci->client_ip);
 		SEND_COMMAND(PACKET_SERVER_ERROR)(NetworkFindClientStateFromIndex(index), NETWORK_ERROR_KICKED);
-		IConsolePrint(_icolour_def, "Client banned");
 	} else {
 		IConsolePrint(_icolour_def, "Client not online, banned IP");
 	}
--- a/src/genworld_gui.cpp	Wed Jul 09 19:20:50 2008 +0000
+++ b/src/genworld_gui.cpp	Wed Jul 09 19:30:44 2008 +0000
@@ -473,7 +473,7 @@
 			 * (use random seed) it should not be possible to be
 			 * entered into the input field; the generate seed
 			 * button can be used instead. */
-			_patches_newgame.generation_seed = minu(strtoul(_genseed_buffer, NULL, sizeof(_genseed_buffer) - 1), MAX_UVALUE(uint32) - 1);
+			_patches_newgame.generation_seed = minu(strtoul(_genseed_buffer, NULL, 10), MAX_UVALUE(uint32) - 1);
 			break;
 
 		case WE_DROPDOWN_SELECT:
--- a/src/network/network_server.cpp	Wed Jul 09 19:20:50 2008 +0000
+++ b/src/network/network_server.cpp	Wed Jul 09 19:30:44 2008 +0000
@@ -609,6 +609,12 @@
 
 DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_NEWGRFS_CHECKED)
 {
+	if (cs->status != STATUS_INACTIVE) {
+		/* Illegal call, return error and ignore the packet */
+		SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_NOT_EXPECTED);
+		return;
+	}
+
 	NetworkClientInfo *ci = DEREF_CLIENT_INFO(cs);
 
 	/* We now want a password from the client else we do not allow him in! */
@@ -625,6 +631,12 @@
 
 DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_JOIN)
 {
+	if (cs->status != STATUS_INACTIVE) {
+		/* Illegal call, return error and ignore the packet */
+		SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_NOT_EXPECTED);
+		return;
+	}
+
 	char name[NETWORK_CLIENT_NAME_LENGTH];
 	char unique_id[NETWORK_UNIQUE_ID_LENGTH];
 	NetworkClientInfo *ci;
@@ -1009,6 +1021,12 @@
 
 DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_ACK)
 {
+	if (cs->status < STATUS_AUTH) {
+		/* Illegal call, return error and ignore the packet */
+		SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_NOT_AUTHORIZED);
+		return;
+	}
+
 	uint32 frame = p->Recv_uint32();
 
 	/* The client is trying to catch up with the server */
@@ -1137,6 +1155,12 @@
 
 DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_CHAT)
 {
+	if (cs->status < STATUS_AUTH) {
+		/* Illegal call, return error and ignore the packet */
+		SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_NOT_AUTHORIZED);
+		return;
+	}
+
 	NetworkAction action = (NetworkAction)p->Recv_uint8();
 	DestType desttype = (DestType)p->Recv_uint8();
 	int dest = p->Recv_uint16();
@@ -1149,6 +1173,12 @@
 
 DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_SET_PASSWORD)
 {
+	if (cs->status != STATUS_ACTIVE) {
+		/* Illegal call, return error and ignore the packet */
+		SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_NOT_EXPECTED);
+		return;
+	}
+
 	char password[NETWORK_PASSWORD_LENGTH];
 	const NetworkClientInfo *ci;
 
@@ -1162,6 +1192,12 @@
 
 DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_SET_NAME)
 {
+	if (cs->status != STATUS_ACTIVE) {
+		/* Illegal call, return error and ignore the packet */
+		SEND_COMMAND(PACKET_SERVER_ERROR)(cs, NETWORK_ERROR_NOT_EXPECTED);
+		return;
+	}
+
 	char client_name[NETWORK_CLIENT_NAME_LENGTH];
 	NetworkClientInfo *ci;
 
--- a/src/order_gui.cpp	Wed Jul 09 19:20:50 2008 +0000
+++ b/src/order_gui.cpp	Wed Jul 09 19:30:44 2008 +0000
@@ -543,6 +543,7 @@
 				assert(w->widget[ORDER_WIDGET_REFIT].bottom        == w->widget[ORDER_WIDGET_UNLOAD].bottom);
 				assert(w->widget[ORDER_WIDGET_REFIT].display_flags == w->widget[ORDER_WIDGET_UNLOAD].display_flags);
 			}
+		if (GetVehicle(w->window_number)->num_orders == 0) return;
 
 			if (_patches.timetabling) {
 				w->widget[ORDER_WIDGET_CAPTION].right -= 61;
--- a/src/rev.cpp.in	Wed Jul 09 19:20:50 2008 +0000
+++ b/src/rev.cpp.in	Wed Jul 09 19:30:44 2008 +0000
@@ -34,7 +34,7 @@
  * final release will always have a lower version number than the released
  * version, thus making comparisions on specific revisions easy.
  */
-uint32 _openttd_newgrf_version = 0 << 28 | 6 << 24 | 1 << 20 | 0 << 19 | (@@REVISION@@ & ((1 << 19) - 1));
+uint32 _openttd_newgrf_version = 0 << 28 | 6 << 24 | 2 << 20 | 0 << 19 | (@@REVISION@@ & ((1 << 19) - 1));
 
 #ifdef __MORPHOS__
 /**
--- a/src/terraform_gui.cpp	Wed Jul 09 19:20:50 2008 +0000
+++ b/src/terraform_gui.cpp	Wed Jul 09 19:30:44 2008 +0000
@@ -338,8 +338,6 @@
 
 		DoCommandP(tile, SLOPE_N, (uint32)mode, CcTerraform, CMD_TERRAFORM_LAND | CMD_MSG(msg));
 	} else {
-		SndPlayTileFx(SND_1F_SPLAT, tile);
-
 		assert(_terraform_size != 0);
 		/* check out for map overflows */
 		sizex = min(MapSizeX() - TileX(tile) - 1, _terraform_size);
@@ -347,6 +345,8 @@
 
 		if (sizex == 0 || sizey == 0) return;
 
+		SndPlayTileFx(SND_1F_SPLAT, tile);
+
 		if (mode != 0) {
 			/* Raise land */
 			h = 15; // XXX - max height