(svn r9851) [0.5] -Backport from trunk (r9731, r9741, r9743, r9753, r9757): 0.5
authorrubidium
Tue, 15 May 2007 21:42:27 +0000
branch0.5
changeset 5495 ccc57a497257
parent 5494 374bd2a631c7
child 5496 e50adc01d7e3
(svn r9851) [0.5] -Backport from trunk (r9731, r9741, r9743, r9753, r9757):
- Fix: when you have closed the "Load game"/"New game" windows which you started from the "start server" menu, you shouldn't start a server when starting a new game [SF#1244842] (r9757)
- Fix: Trains were lost after autorenewal/autoreplace [FS#732] (r9753)
- Fix: Stop flooded towns from building roads on water [FS#598] (r9743)
- Fix: Station signs were not resized when the language changed [FS#672] (r9741)
- Fix: In news history, newlines were not replaced with spaces [FS#677] (r9731)
intro_gui.c
network_gui.c
news_gui.c
settings_gui.c
town_cmd.c
vehicle.c
--- a/intro_gui.c	Tue May 15 21:24:18 2007 +0000
+++ b/intro_gui.c	Tue May 15 21:42:27 2007 +0000
@@ -64,6 +64,10 @@
 		break;
 
 	case WE_CLICK:
+		/* Do not create a network server when you (just) have closed one of the game
+		 * creation/load windows for the network server. */
+		if (2 <= e->we.click.widget && e->we.click.widget <= 6) _is_network_server = false;
+
 		switch (e->we.click.widget) {
 		case 2: ShowGenerateLandscape(); break;
 		case 3: ShowSaveLoadDialog(SLD_LOAD_GAME); break;
--- a/network_gui.c	Tue May 15 21:24:18 2007 +0000
+++ b/network_gui.c	Tue May 15 21:42:27 2007 +0000
@@ -1647,7 +1647,7 @@
 		assert(WP(w, chatquerystr_d).caption < lengthof(chat_captions));
 		msg = chat_captions[WP(w, chatquerystr_d).caption];
 		DrawStringRightAligned(w->widget[2].left - 2, w->widget[2].top + 1, msg, 16);
-		DrawEditBox(w, &WP(w, chatquerystr_d), 2);
+		DrawEditBox(w, &WP(w, querystr_d), 2);
 	} break;
 
 	case WE_CLICK:
@@ -1662,7 +1662,7 @@
 		break;
 
 	case WE_MOUSELOOP:
-		HandleEditBox(w, &WP(w, chatquerystr_d), 2);
+		HandleEditBox(w, &WP(w, querystr_d), 2);
 		break;
 
 	case WE_KEYPRESS:
@@ -1670,7 +1670,7 @@
 			ChatTabCompletion(w);
 		} else {
 			_chat_tab_completion_active = false;
-			switch (HandleEditBoxKey(w, &WP(w, chatquerystr_d), 2, e)) {
+			switch (HandleEditBoxKey(w, &WP(w, querystr_d), 2, e)) {
 				case 1: { /* Return */
 				DestType type = (DestType)WP(w, chatquerystr_d).caption;
 				int dest = WP(w, chatquerystr_d).dest;
--- a/news_gui.c	Tue May 15 21:24:18 2007 +0000
+++ b/news_gui.c	Tue May 15 21:42:27 2007 +0000
@@ -602,6 +602,7 @@
 	const char *ptr;
 	char *dest;
 	StringID str;
+	WChar c_last;
 
 	if (ni->display_mode == 3) {
 		str = _get_news_string_callback[ni->callback](ni);
@@ -615,15 +616,21 @@
 	 * from it such as big fonts, etc. */
 	ptr  = buffer;
 	dest = buffer2;
+	c_last = '\0';
 	for (;;) {
 		WChar c = Utf8Consume(&ptr);
 		if (c == 0) break;
-		if (c == '\r') {
+		/* Make a space from a newline, but ignore multiple newlines */
+		if (c == '\n' && c_last != '\n') {
+			dest[0] = ' ';
+			dest++;
+		} else if (c == '\r') {
 			dest[0] = dest[1] = dest[2] = dest[3] = ' ';
 			dest += 4;
 		} else if (IsPrintable(c)) {
 			dest += Utf8Encode(dest, c);
 		}
+		c_last = c;
 	}
 
 	*dest = '\0';
--- a/settings_gui.c	Tue May 15 21:24:18 2007 +0000
+++ b/settings_gui.c	Tue May 15 21:42:27 2007 +0000
@@ -200,6 +200,7 @@
 			break;
 		case 24: /* Change interface language */
 			ReadLanguagePack(e->we.dropdown.index);
+			UpdateAllStationVirtCoord();
 			MarkWholeScreenDirty();
 			break;
 		case 27: /* Change resolution */
--- a/town_cmd.c	Tue May 15 21:24:18 2007 +0000
+++ b/town_cmd.c	Tue May 15 21:42:27 2007 +0000
@@ -803,7 +803,7 @@
 	for (ptr = _town_coord_mod; ptr != endof(_town_coord_mod); ++ptr) {
 		/* Only work with plain land that not already has a house */
 		if (!IsTileType(tile, MP_HOUSE) && GetTileSlope(tile, NULL) == SLOPE_FLAT) {
-			if (!CmdFailed(DoCommand(tile, 0, 0, DC_AUTO, CMD_LANDSCAPE_CLEAR))) {
+			if (!CmdFailed(DoCommand(tile, 0, 0, DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR))) {
 				DoCommand(tile, GenRandomRoadBits(), t->index, DC_EXEC | DC_AUTO, CMD_BUILD_ROAD);
 				_current_player = old_player;
 				return true;
--- a/vehicle.c	Tue May 15 21:24:18 2007 +0000
+++ b/vehicle.c	Tue May 15 21:42:27 2007 +0000
@@ -2088,6 +2088,7 @@
 			new_v->service_interval = old_v->service_interval;
 			new_front = true;
 			new_v->unitnumber = old_v->unitnumber; // use the same unit number
+			new_v->dest_tile  = old_v->dest_tile;
 
 			new_v->current_order = old_v->current_order;
 			if (old_v->type == VEH_Train && GetNextVehicle(old_v) != NULL){