1
0
Fork 0

(svn r25339) [1.3] -Backport from trunk:

- Fix: Do not focus the editbox in the NewGRF window, if there is no editbox visible (r25307)
- Fix: Game Script APIs that execute a DoCommand were returning the same result as in TestMode during world generation [FS#5561] (r25305)
- Fix: Build railway fences next to objects, even if they are owned by the same company [FS#5565] (r25302)
- Fix: gcc4.6 removed -mno-cygwin option (r25266)
release/1.3
rubidium 2013-06-09 09:33:06 +00:00
parent 3ac18d20c9
commit 02fc90dfbd
5 changed files with 24 additions and 11 deletions

View File

@ -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"

View File

@ -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);

View File

@ -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;
}
}

View File

@ -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. */

View File

@ -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)