mirror of https://github.com/OpenTTD/OpenTTD
(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
parent
3ac18d20c9
commit
02fc90dfbd
|
@ -1487,12 +1487,15 @@ make_cflags_and_ldflags() {
|
||||||
LDFLAGS="$LDFLAGS -mwin32"
|
LDFLAGS="$LDFLAGS -mwin32"
|
||||||
fi
|
fi
|
||||||
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
|
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
|
if [ "$enable_console" != "0" ]; then
|
||||||
LDFLAGS="$LDFLAGS -mno-cygwin -Wl,--subsystem,console"
|
LDFLAGS="$LDFLAGS -Wl,--subsystem,console"
|
||||||
else
|
else
|
||||||
LDFLAGS="$LDFLAGS -mno-cygwin -Wl,--subsystem,windows"
|
LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
|
LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
|
||||||
|
|
|
@ -645,7 +645,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
|
||||||
|
|
||||||
this->querystrings[WID_NS_FILTER] = &this->filter_editbox;
|
this->querystrings[WID_NS_FILTER] = &this->filter_editbox;
|
||||||
this->filter_editbox.cancel_button = QueryString::ACTION_CLEAR;
|
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.SetListing(this->last_sorting);
|
||||||
this->avails.SetFiltering(this->last_filtering);
|
this->avails.SetFiltering(this->last_filtering);
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "date_func.h"
|
#include "date_func.h"
|
||||||
#include "strings_func.h"
|
#include "strings_func.h"
|
||||||
#include "company_gui.h"
|
#include "company_gui.h"
|
||||||
|
#include "object_map.h"
|
||||||
|
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
#include "table/railtypes.h"
|
#include "table/railtypes.h"
|
||||||
|
@ -2576,9 +2577,9 @@ static void TileLoop_Track(TileIndex tile)
|
||||||
|
|
||||||
TileIndex tile2 = tile + TileOffsByDiagDir(d);
|
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) ||
|
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;
|
fences |= 1 << d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,7 +300,12 @@ ScriptObject::ActiveInstance::~ActiveInstance()
|
||||||
|
|
||||||
if (_generating_world) {
|
if (_generating_world) {
|
||||||
IncreaseDoCommandCosts(res.GetCost());
|
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;
|
return true;
|
||||||
} else if (_networking) {
|
} else if (_networking) {
|
||||||
/* Suspend the script till the command is really executed. */
|
/* Suspend the script till the command is really executed. */
|
||||||
|
|
|
@ -541,15 +541,19 @@ Squirrel::~Squirrel()
|
||||||
void Squirrel::InsertResult(bool result)
|
void Squirrel::InsertResult(bool result)
|
||||||
{
|
{
|
||||||
sq_pushbool(this->vm, result);
|
sq_pushbool(this->vm, result);
|
||||||
vm->GetAt(vm->_stackbase + vm->_suspended_target) = vm->GetUp(-1);
|
if (this->IsSuspended()) { // Called before resuming a suspended script?
|
||||||
vm->Pop();
|
vm->GetAt(vm->_stackbase + vm->_suspended_target) = vm->GetUp(-1);
|
||||||
|
vm->Pop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Squirrel::InsertResult(int result)
|
void Squirrel::InsertResult(int result)
|
||||||
{
|
{
|
||||||
sq_pushinteger(this->vm, result);
|
sq_pushinteger(this->vm, result);
|
||||||
vm->GetAt(vm->_stackbase + vm->_suspended_target) = vm->GetUp(-1);
|
if (this->IsSuspended()) { // Called before resuming a suspended script?
|
||||||
vm->Pop();
|
vm->GetAt(vm->_stackbase + vm->_suspended_target) = vm->GetUp(-1);
|
||||||
|
vm->Pop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void Squirrel::DecreaseOps(HSQUIRRELVM vm, int ops)
|
/* static */ void Squirrel::DecreaseOps(HSQUIRRELVM vm, int ops)
|
||||||
|
|
Loading…
Reference in New Issue