diff --git a/intro_gui.c b/intro_gui.c index 9d0198d446..37de9e7a9e 100644 --- a/intro_gui.c +++ b/intro_gui.c @@ -64,6 +64,10 @@ static void SelectGameWndProc(Window *w, WindowEvent *e) 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; diff --git a/network_gui.c b/network_gui.c index 38baa5bc5a..e50c6941e7 100644 --- a/network_gui.c +++ b/network_gui.c @@ -1647,7 +1647,7 @@ static void ChatWindowWndProc(Window *w, WindowEvent *e) 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 @@ static void ChatWindowWndProc(Window *w, WindowEvent *e) 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 @@ static void ChatWindowWndProc(Window *w, WindowEvent *e) 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; diff --git a/news_gui.c b/news_gui.c index d04b0ebf9d..afe353aaed 100644 --- a/news_gui.c +++ b/news_gui.c @@ -602,6 +602,7 @@ static void DrawNewsString(int x, int y, uint16 color, const NewsItem *ni, uint 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 @@ static void DrawNewsString(int x, int y, uint16 color, const NewsItem *ni, uint * 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'; diff --git a/settings_gui.c b/settings_gui.c index 4767d51951..3c25b74af8 100644 --- a/settings_gui.c +++ b/settings_gui.c @@ -200,6 +200,7 @@ static void GameOptionsWndProc(Window *w, WindowEvent *e) break; case 24: /* Change interface language */ ReadLanguagePack(e->we.dropdown.index); + UpdateAllStationVirtCoord(); MarkWholeScreenDirty(); break; case 27: /* Change resolution */ diff --git a/town_cmd.c b/town_cmd.c index 9238463698..6e9a92d1fb 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -803,7 +803,7 @@ static bool GrowTown(Town *t) 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; diff --git a/vehicle.c b/vehicle.c index e67f89df60..a24db1b045 100644 --- a/vehicle.c +++ b/vehicle.c @@ -2088,6 +2088,7 @@ static int32 ReplaceVehicle(Vehicle **w, byte flags, int32 total_cost) 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){