diff options
author | truebrain <truebrain@openttd.org> | 2011-12-19 21:00:32 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-19 21:00:32 +0000 |
commit | 3a535690d4e9aaa896a062e7b5b5454b1b07ac47 (patch) | |
tree | 600859d25db8391542b9cc0da9e063c7bdc6f4fc /src/script/script_instance.cpp | |
parent | 77b7366c2947a3f2545d5542021be1cc203a74e8 (diff) | |
download | openttd-3a535690d4e9aaa896a062e7b5b5454b1b07ac47.tar.xz |
(svn r23623) -Add: allow bi-directional communication with the AdminPort and GameScript
Diffstat (limited to 'src/script/script_instance.cpp')
-rw-r--r-- | src/script/script_instance.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index 4fabdf2fb..7a6b4fe70 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -297,12 +297,10 @@ static const SaveLoad _script_byte[] = { SLE_END() }; -static const uint SCRIPTSAVE_MAX_DEPTH = 25; ///< The maximum recursive depth for items stored in the savegame. - /* static */ bool ScriptInstance::SaveObject(HSQUIRRELVM vm, SQInteger index, int max_depth, bool test) { if (max_depth == 0) { - ScriptLog::Error("Savedata can only be nested to 25 deep. No data saved."); + ScriptLog::Error("Savedata can only be nested to 25 deep. No data saved."); // SQUIRREL_MAX_DEPTH = 25 return false; } @@ -439,7 +437,7 @@ void ScriptInstance::Save() _script_sl_byte = 1; SlObject(NULL, _script_byte); /* Save the data that was just loaded. */ - SaveObject(vm, -1, SCRIPTSAVE_MAX_DEPTH, false); + SaveObject(vm, -1, SQUIRREL_MAX_DEPTH, false); } else if (!this->is_started) { SaveEmpty(); return; @@ -478,10 +476,10 @@ void ScriptInstance::Save() return; } sq_pushobject(vm, savedata); - if (SaveObject(vm, -1, SCRIPTSAVE_MAX_DEPTH, true)) { + if (SaveObject(vm, -1, SQUIRREL_MAX_DEPTH, true)) { _script_sl_byte = 1; SlObject(NULL, _script_byte); - SaveObject(vm, -1, SCRIPTSAVE_MAX_DEPTH, false); + SaveObject(vm, -1, SQUIRREL_MAX_DEPTH, false); this->is_save_data_on_stack = true; } else { SaveEmpty(); |