diff --git a/changelog.txt b/changelog.txt index 70e3f276c5..487547d454 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,25 @@ +0.7.1-RC3 (2009-06-03) +------------------------------------------------------------------------ +- Add: [NoAI] AISignList that can be used to get a list of valid signs (r16400) +- Change: [NoAI] Stop an AI when it takes too long to initialize or load [FS#2869] (r16425) +- Fix: Base graphics names must be unique, so do not add duplicates (r16503) +- Fix: [NoAI] When an AI was suspended while in a function called (indirectly) via call/acall/pcall OpenTTD crashed. Fix this by disallowing AIs to be suspended while called via call/acall/pcall [FS#2935] (r16502) +- Fix: [NewGRF] Invalidate NewGRF variable caches of more vehicles in more places. Esp. they were only invalidated for trains (r16480) +- Fix: [NewGRF] Call callbacks after initialisation of vehicle variables (r16479) +- Fix: [NewGRF] Determining most common (sub-)cargo-type was broken due to someone confusing similiary named variables (r16478) +- Fix: Loading indicator when 'unload' in and 'no loading' is off was pointing in the wrong direction [FS#2936] (r16477) +- Fix: Track reservation was drawn at bridge heads in the menu (r16470) +- Fix: [NoAI] Another try/catch related bug (r16454) +- Fix: Road vehicles ending up on the pavement when they are in a drive through station that got removed due to bankruptcy [FS#2909] (r16448) +- Fix: [NoAI] AIRail::GetRailStationDirection returned incorrect information (r16440) +- Fix: Crash when a company is deleted while a dropdown with company names is open (r16430) +- Fix: Do not allow content download via the console when there is no zlib as it is done for the GUI already [FS#2919] (r16420) +- Fix: Some 64bit architectures require size_t to be aligned at 8-byte boundary, ensure it for MemBlock (r16415) +- Fix: [NewGRF] Disable multitile houses with non-zero population on additional tiles as they cause desyncs and because the specs do not allow that either (r16383) +- Fix: [NewGRF] Valid UTF-8 sequences between 0x20 and 0xFF should be allowed as is instead of being treated as control codes (r16374) +- Fix: [NewGRF] Use a valid StringID as fall-back when undefined generic NewGRF strings of vehicles are requested (r16366) + + 0.7.1-RC2 (2009-05-21) ------------------------------------------------------------------------ - Fix: The previously selected NewGRF station type was still remembered after switching to a different game without newstations enabled, preventing stations from being built (r16363) diff --git a/os/debian/changelog b/os/debian/changelog index 24e2e5f4c6..6d199925bb 100644 --- a/os/debian/changelog +++ b/os/debian/changelog @@ -1,3 +1,9 @@ +openttd (0.7.1~RC3) unstable; urgency=low + + * New upstream release. + + -- Matthijs Kooijman Wed, 03 Jun 2008 15:34:56 +0200 + openttd (0.7.1~RC2) unstable; urgency=low * New upstream release. diff --git a/os/win32/installer/install.nsi b/os/win32/installer/install.nsi index 70df9b054a..3fd35ea881 100644 --- a/os/win32/installer/install.nsi +++ b/os/win32/installer/install.nsi @@ -1,7 +1,7 @@ !define APPNAME "OpenTTD" ; Define application name -!define APPVERSION "0.7.1-RC2" ; Define application version +!define APPVERSION "0.7.1-RC3" ; Define application version !define APPVERSIONINTERNAL "0.7.1.0" ; Define application version in X.X.X.X -!define INSTALLERVERSION 60 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!! +!define INSTALLERVERSION 61 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!! !include ${VERSION_INCLUDE} !define APPURLLINK "http://www.openttd.org" diff --git a/src/3rdparty/squirrel/include/squirrel.h b/src/3rdparty/squirrel/include/squirrel.h index e611d0853b..5623760fac 100644 --- a/src/3rdparty/squirrel/include/squirrel.h +++ b/src/3rdparty/squirrel/include/squirrel.h @@ -275,6 +275,7 @@ typedef struct tagSQRegFunction{ }SQRegFunction; /*vm*/ +SQUIRREL_API bool sq_can_suspend(HSQUIRRELVM v); SQUIRREL_API HSQUIRRELVM sq_open(SQInteger initialstacksize); SQUIRREL_API HSQUIRRELVM sq_newthread(HSQUIRRELVM friendvm, SQInteger initialstacksize); SQUIRREL_API void sq_seterrorhandler(HSQUIRRELVM v); diff --git a/src/3rdparty/squirrel/squirrel/sqapi.cpp b/src/3rdparty/squirrel/squirrel/sqapi.cpp index 34d32ec854..338281850d 100644 --- a/src/3rdparty/squirrel/squirrel/sqapi.cpp +++ b/src/3rdparty/squirrel/squirrel/sqapi.cpp @@ -90,6 +90,11 @@ SQInteger sq_getvmstate(HSQUIRRELVM v) } } +bool sq_can_suspend(HSQUIRRELVM v) +{ + return v->_can_suspend; +} + void sq_seterrorhandler(HSQUIRRELVM v) { SQObject o = stack_get(v, -1); diff --git a/src/ai/ai_instance.hpp b/src/ai/ai_instance.hpp index bf501dc232..3ae3aa152a 100644 --- a/src/ai/ai_instance.hpp +++ b/src/ai/ai_instance.hpp @@ -30,6 +30,7 @@ private: class AIInstance { public: + friend class AIObject; AIInstance(class AIInfo *info); ~AIInstance(); diff --git a/src/ai/api/ai_object.cpp b/src/ai/api/ai_object.cpp index 64ae493494..912f724157 100644 --- a/src/ai/api/ai_object.cpp +++ b/src/ai/api/ai_object.cpp @@ -2,6 +2,11 @@ /** @file ai_object.cpp Implementation of AIObject. */ +#include "../../stdafx.h" +#include +#include "../../script/squirrel.hpp" +#include "../../company_base.h" + #include "ai_log.hpp" #include "table/strings.h" #include "../ai.hpp" @@ -157,7 +162,8 @@ void AIObject::SetAllowDoCommand(bool allow) bool AIObject::GetAllowDoCommand() { - return GetStorage()->allow_do_command; + Squirrel *squirrel = GetCompany(_current_company)->ai_instance->engine; + return GetStorage()->allow_do_command && squirrel->CanSuspend(); } void *&AIObject::GetEventPointer() diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index d63d2429f4..d746818352 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -445,7 +445,7 @@ public: bool OBGFileScanner::AddFile(const char *filename, size_t basepath_length) { bool ret = false; - DEBUG(grf, 1, "Found %s as base graphics set", filename); + DEBUG(grf, 1, "Checking %s for base graphics set", filename); GraphicsSet *graphics = new GraphicsSet();; IniFile *ini = new IniFile(); @@ -460,12 +460,30 @@ bool OBGFileScanner::AddFile(const char *filename, size_t basepath_length) } if (FillGraphicsSetDetails(graphics, ini, path)) { - bool duplicate = false; - for (const GraphicsSet *c = _available_graphics_sets; !duplicate && c != NULL; c = c->next) { - duplicate = (strcmp(c->name, graphics->name) == 0 || c->shortname == graphics->shortname) && c->version == graphics->version; + GraphicsSet *duplicate = NULL; + for (GraphicsSet *c = _available_graphics_sets; c != NULL; c = c->next) { + if (strcmp(c->name, graphics->name) == 0 || c->shortname == graphics->shortname) { + duplicate = c; + break; + } } - if (duplicate) { - delete graphics; + if (duplicate != NULL) { + if (duplicate->version >= graphics->version) { + DEBUG(grf, 1, "Not adding %s (%i) as base graphics set (duplicate)", graphics->name, graphics->version); + delete graphics; + } else { + GraphicsSet **prev = &_available_graphics_sets; + while (*prev != duplicate) prev = &(*prev)->next; + + *prev = graphics; + graphics->next = duplicate->next; + /* don't allow recursive delete of all remaining items */ + duplicate->next = NULL; + + DEBUG(grf, 1, "Removing %s (%i) as base graphics set (duplicate)", duplicate->name, duplicate->version); + delete duplicate; + ret = true; + } } else { GraphicsSet **last = &_available_graphics_sets; while (*last != NULL) last = &(*last)->next; @@ -473,6 +491,9 @@ bool OBGFileScanner::AddFile(const char *filename, size_t basepath_length) *last = graphics; ret = true; } + if (ret) { + DEBUG(grf, 1, "Adding %s (%i) as base graphics set", graphics->name, graphics->version); + } } else { delete graphics; } diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 6737fd3ef3..6955d2d24e 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -508,3 +508,8 @@ void Squirrel::ResetCrashed() { this->crashed = false; } + +bool Squirrel::CanSuspend() +{ + return sq_can_suspend(this->vm); +} diff --git a/src/script/squirrel.hpp b/src/script/squirrel.hpp index ee597f87ad..b878c2b95a 100644 --- a/src/script/squirrel.hpp +++ b/src/script/squirrel.hpp @@ -213,6 +213,11 @@ public: * Reset the crashed status. */ void ResetCrashed(); + + /** + * Are we allowed to suspend the squirrel script at this moment? + */ + bool CanSuspend(); }; #endif /* SQUIRREL_HPP */