diff --git a/config.lib b/config.lib index aeb480aa3a..d13bb04aec 100644 --- a/config.lib +++ b/config.lib @@ -1487,12 +1487,15 @@ make_cflags_and_ldflags() { LDFLAGS="$LDFLAGS -mwin32" fi if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then - flags="$flags -mno-cygwin" + if [ $cc_version -lt 46 ]; then + flags="$flags -mno-cygwin" + LDFLAGS="$LDFLAGS -mno-cygwin" + fi if [ "$enable_console" != "0" ]; then - LDFLAGS="$LDFLAGS -mno-cygwin -Wl,--subsystem,console" + LDFLAGS="$LDFLAGS -Wl,--subsystem,console" else - LDFLAGS="$LDFLAGS -mno-cygwin -Wl,--subsystem,windows" + LDFLAGS="$LDFLAGS -Wl,--subsystem,windows" fi LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32" diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 8f73ee4f30..1a78cd53e2 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -645,7 +645,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { this->querystrings[WID_NS_FILTER] = &this->filter_editbox; this->filter_editbox.cancel_button = QueryString::ACTION_CLEAR; - this->SetFocusedWidget(WID_NS_FILTER); + if (editable) this->SetFocusedWidget(WID_NS_FILTER); this->avails.SetListing(this->last_sorting); this->avails.SetFiltering(this->last_filtering); diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 56b87b955c..5775241546 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -32,6 +32,7 @@ #include "date_func.h" #include "strings_func.h" #include "company_gui.h" +#include "object_map.h" #include "table/strings.h" #include "table/railtypes.h" @@ -2576,9 +2577,9 @@ static void TileLoop_Track(TileIndex tile) TileIndex tile2 = tile + TileOffsByDiagDir(d); - /* Show fences if it's a house, industry, road, tunnelbridge or not owned by us. */ + /* Show fences if it's a house, industry, object, road, tunnelbridge or not owned by us. */ if (!IsValidTile(tile2) || IsTileType(tile2, MP_HOUSE) || IsTileType(tile2, MP_INDUSTRY) || - IsTileType(tile2, MP_ROAD) || IsTileType(tile2, MP_TUNNELBRIDGE) || !IsTileOwner(tile2, owner)) { + IsTileType(tile2, MP_ROAD) || (IsTileType(tile2, MP_OBJECT) && !IsOwnedLand(tile2)) || IsTileType(tile2, MP_TUNNELBRIDGE) || !IsTileOwner(tile2, owner)) { fences |= 1 << d; } } diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index 7da23d6f75..2852c4ae9e 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -300,7 +300,12 @@ ScriptObject::ActiveInstance::~ActiveInstance() if (_generating_world) { IncreaseDoCommandCosts(res.GetCost()); - if (callback != NULL) callback(GetActiveInstance()); + if (callback != NULL) { + /* Insert return value into to stack and throw a control code that + * the return value in the stack should be used. */ + callback(GetActiveInstance()); + throw SQInteger(1); + } return true; } else if (_networking) { /* Suspend the script till the command is really executed. */ diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 4584b9d6ce..ed87d487cf 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -541,15 +541,19 @@ Squirrel::~Squirrel() void Squirrel::InsertResult(bool result) { sq_pushbool(this->vm, result); - vm->GetAt(vm->_stackbase + vm->_suspended_target) = vm->GetUp(-1); - vm->Pop(); + if (this->IsSuspended()) { // Called before resuming a suspended script? + vm->GetAt(vm->_stackbase + vm->_suspended_target) = vm->GetUp(-1); + vm->Pop(); + } } void Squirrel::InsertResult(int result) { sq_pushinteger(this->vm, result); - vm->GetAt(vm->_stackbase + vm->_suspended_target) = vm->GetUp(-1); - vm->Pop(); + if (this->IsSuspended()) { // Called before resuming a suspended script? + vm->GetAt(vm->_stackbase + vm->_suspended_target) = vm->GetUp(-1); + vm->Pop(); + } } /* static */ void Squirrel::DecreaseOps(HSQUIRRELVM vm, int ops)