diff options
author | yexo <yexo@openttd.org> | 2012-08-13 19:22:26 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2012-08-13 19:22:26 +0000 |
commit | 54aa43c81b4adbaaf1eaab03062fa871d85fbeab (patch) | |
tree | 7f7ca92995edd09bd9dc41499d1aae60d8869bc3 /src/script/script_instance.hpp | |
parent | 51921552536d2fbc56c8cdaf682da038e26a168c (diff) | |
download | openttd-54aa43c81b4adbaaf1eaab03062fa871d85fbeab.tar.xz |
(svn r24468) -Add [FS#5219]: API compatibility scripts for Goal Scripts (Hirundo)
Diffstat (limited to 'src/script/script_instance.hpp')
-rw-r--r-- | src/script/script_instance.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/script/script_instance.hpp b/src/script/script_instance.hpp index 7a02237b8..0cda170f4 100644 --- a/src/script/script_instance.hpp +++ b/src/script/script_instance.hpp @@ -17,6 +17,7 @@ #include "../command_type.h" #include "../company_type.h" +#include "../fileio_type.h" static const uint SQUIRREL_MAX_DEPTH = 25; ///< The maximum recursive depth for items stored in the savegame. @@ -176,6 +177,7 @@ public: protected: class Squirrel *engine; ///< A wrapper around the squirrel vm. + const char *versionAPI; ///< Current API used by this script. /** * Register all API functions to the VM. @@ -183,6 +185,14 @@ protected: virtual void RegisterAPI(); /** + * Load squirrel scripts to emulate an older API. + * @param api_version: API version to load scripts for + * @param dir Subdirectory to find the scripts in + * @return true iff script loading should proceed + */ + bool LoadCompatibilityScripts(const char *api_version, Subdirectory dir); + + /** * Tell the script it died. */ virtual void Died(); |