diff --git a/changelog.txt b/changelog.txt index fc85e5d270..4b12d92ec6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -466,7 +466,7 @@ - Fix: Some inconsistencies with the difficulty settings in the scenario editor. Also re-enable changing some difficulty settings (e.g. max loan) in the scenario editor [FS#3219] (r17644) - Fix: Do not accept cargo produced in the same industry; generalise and improve the check used only for valuables (r17437) - Fix: Pay only for cargo actually delivered, not for all cargo unloaded at station; can differ with 'stockpiling' industries (r17436) -- Fix: Improve movement of aircraft; do not make turns bigger then 45 degrees while in flight, do not move while turning on the ground (r17415, r17405) +- Fix: Improve movement of aircraft; do not make turns bigger than 45 degrees while in flight, do not move while turning on the ground (r17415, r17405) - Fix: Crash in order GUI when changing some orders with both the mouse and keyboard at the exact same time [FS#2859] (r17384) - Fix: Trains would not show smoke if the load/unload counter was not 0, though there does not seem to be a reason to check that variable anyhow anymore [FS#3162] (r17352) - Fix: One was not offered to take over bankrupt companies anymore; caused by the introduction NoAI, although NewAI had the same problem too [FS#2769] (r17345) @@ -2619,7 +2619,7 @@ - Fix: [Network] 'kick 1' did crash dedicated servers - Fix: [Network] A server no longer crashes when a client sends an invalid DoCommand, but drops the client instead - Fix: [Network] Added packet protection. No longer a client or server -- Fix: [Network] Bug in bind system. Advertising failed on systems with more then 1 ip, and server_bind active to one of them +- Fix: [Network] Bug in bind system. Advertising failed on systems with more than 1 ip, and server_bind active to one of them - Fix: [Network] Disabled 'money-cheat' (read: bug which could give people a lot of money) - Fix: [SDL] Now the binary never links to SDL if DEDICATED is set - Fix: [Windows] Somehow mousewheel was disabled on windows using SDL; reenabled again diff --git a/docs/multiplayer.txt b/docs/multiplayer.txt index ffe7ab9fb3..855b5dabe6 100644 --- a/docs/multiplayer.txt +++ b/docs/multiplayer.txt @@ -23,7 +23,7 @@ Multiplayer Manual for OpenTTD (0.3.5) - If you want to see which servers all online on the Internet, click on 'Internet' and 'Find Server' - - If there were more then one server + - If there were more than one server - select one in the list below the buttons - click on 'join game' diff --git a/src/news_gui.cpp b/src/news_gui.cpp index d90b8eb3ac..b736701757 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -193,10 +193,10 @@ static const WindowDesc _thin_news_desc( /* Small news items. */ static const NWidgetPart _nested_small_news_widgets[] = { - /* Caption + close box */ + /* Caption + close box. The caption is no WWT_CAPTION as the window shall not be moveable and so on. */ NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE, NTW_CLOSEBOX), - NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE, NTW_CAPTION), SetDataTip(STR_NEWS_MESSAGE_CAPTION, STR_NULL), + NWidget(WWT_EMPTY, COLOUR_LIGHT_BLUE, NTW_CAPTION), SetFill(1, 0), EndContainer(), /* Main part */ @@ -394,9 +394,13 @@ struct NewsWindow : Window { virtual void DrawWidget(const Rect &r, int widget) const { switch (widget) { + case NTW_CAPTION: + DrawCaption(r, COLOUR_LIGHT_BLUE, this->owner, STR_NEWS_MESSAGE_CAPTION); + break; + case NTW_PANEL: this->DrawNewsBorder(r); - return; + break; case NTW_MESSAGE: CopyInDParam(0, this->ni->params, lengthof(this->ni->params)); diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 228c413046..af89b05cf8 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -413,7 +413,7 @@ CommandCost CmdTurnRoadVeh(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 v->overtaking != 0 || v->state == RVSB_WORMHOLE || v->IsInDepot() || - v->cur_speed < 5) { + v->current_order.IsType(OT_LOADING)) { return CMD_ERROR; } diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 0c26204978..0301a5c62d 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2995,6 +2995,9 @@ static void TrainEnterStation(Train *v, StationID station) AI::NewEvent(v->owner, new AIEventStationFirstVehicle(st->index, v->index)); } + v->force_proceed = 0; + SetWindowDirty(WC_VEHICLE_VIEW, v->index); + v->BeginLoading(); StationAnimationTrigger(st, v->tile, STAT_ANIM_TRAIN_ARRIVES); @@ -4001,10 +4004,10 @@ static bool TrainLocoHandler(Train *v, bool mode) int j = v->UpdateSpeed(); /* we need to invalidate the widget if we are stopping from 'Stopping 0 km/h' to 'Stopped' */ - if (v->cur_speed == 0 && v->tcache.last_speed == 0 && (v->vehstatus & VS_STOPPED)) { + if (v->cur_speed == 0 && (v->vehstatus & VS_STOPPED)) { /* If we manually stopped, we're not force-proceeding anymore. */ v->force_proceed = 0; - SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); + SetWindowDirty(WC_VEHICLE_VIEW, v->index); } int adv_spd = (v->direction & 1) ? 192 : 256; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index f0a1d40daf..22fa4e5a54 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1001,6 +1001,7 @@ void VehicleEnterDepot(Vehicle *v) UpdateSignalsOnSegment(t->tile, INVALID_DIAGDIR, t->owner); t->wait_counter = 0; + t->force_proceed = 0; ClrBit(t->flags, VRF_TOGGLE_REVERSE); t->ConsistChanged(true); break; @@ -1022,6 +1023,7 @@ void VehicleEnterDepot(Vehicle *v) break; default: NOT_REACHED(); } + SetWindowDirty(WC_VEHICLE_VIEW, v->index); 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. diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 4557ddca79..2500154a49 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -89,7 +89,7 @@ CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, case VEH_AIRCRAFT: { Aircraft *a = Aircraft::From(v); /* cannot stop airplane when in flight, or when taking off / landing */ - if (a->state >= STARTTAKEOFF && a->state < TERM7) return_cmd_error(STR_ERROR_AIRCRAFT_IS_IN_FLIGHT); + if (!(v->vehstatus & VS_CRASHED) && a->state >= STARTTAKEOFF && a->state < TERM7) return_cmd_error(STR_ERROR_AIRCRAFT_IS_IN_FLIGHT); } break; default: return CMD_ERROR; diff --git a/src/widget.cpp b/src/widget.cpp index de89bf263a..33977b20b6 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -513,7 +513,7 @@ static inline void DrawCloseBox(const Rect &r, Colours colour, StringID str) * @param owner 'Owner' of the window. * @param str Text to draw in the bar. */ -static inline void DrawCaption(const Rect &r, Colours colour, Owner owner, StringID str) +void DrawCaption(const Rect &r, Colours colour, Owner owner, StringID str) { DrawFrameRect(r.left, r.top, r.right, r.bottom, colour, FR_BORDERONLY); DrawFrameRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, colour, (owner == INVALID_OWNER) ? FR_LOWERED | FR_DARKENED : FR_LOWERED | FR_DARKENED | FR_BORDERONLY); diff --git a/src/window.cpp b/src/window.cpp index e668f5b56f..0a8079ef24 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2226,6 +2226,17 @@ static void CheckSoftLimit() */ void InputLoop() { + /* + * During the generation of the world, there might be + * another thread that is currently building for example + * a road. To not interfere with those tasks, we should + * NOT change the _current_company here. + * + * This is not necessary either, as the only events that + * can be handled are the 'close application' events + */ + if (!IsGeneratingWorld()) _current_company = _local_company; + CheckSoftLimit(); HandleKeyScrolling(); diff --git a/src/window_gui.h b/src/window_gui.h index 5d36b59bd4..3306a9350d 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -119,8 +119,9 @@ enum WidgetDrawDistances { WD_PAR_VSEP_WIDE = 8, ///< Large amount of vertical space between two paragraphs of text. }; -/* wiget.cpp */ +/* widget.cpp */ void DrawFrameRect(int left, int top, int right, int bottom, Colours colour, FrameFlags flags); +void DrawCaption(const Rect &r, Colours colour, Owner owner, StringID str); /* window.cpp */ extern Window *_z_front_window;