summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-07-15 19:47:06 +0000
committeryexo <yexo@openttd.org>2009-07-15 19:47:06 +0000
commitf085d7775b12e77b8012ab09ae72b850367a3237 (patch)
treedcc6b0bf106aff0538a996a369c0d213834e462f /src/script
parent91a6af688e0f99017dd824de6b0f1f18dbc6ef50 (diff)
downloadopenttd-f085d7775b12e77b8012ab09ae72b850367a3237.tar.xz
(svn r16834) -Fix [FS#3034]: call the AI Save() function only once so AIs can't crash OpenTTD
Diffstat (limited to 'src/script')
-rw-r--r--src/script/squirrel.cpp5
-rw-r--r--src/script/squirrel.hpp5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp
index 6955d2d24..3fb778043 100644
--- a/src/script/squirrel.cpp
+++ b/src/script/squirrel.cpp
@@ -509,6 +509,11 @@ void Squirrel::ResetCrashed()
this->crashed = false;
}
+void Squirrel::CrashOccurred()
+{
+ this->crashed = true;
+}
+
bool Squirrel::CanSuspend()
{
return sq_can_suspend(this->vm);
diff --git a/src/script/squirrel.hpp b/src/script/squirrel.hpp
index b878c2b95..32f24cb11 100644
--- a/src/script/squirrel.hpp
+++ b/src/script/squirrel.hpp
@@ -215,6 +215,11 @@ public:
void ResetCrashed();
/**
+ * Set the AI status to crashed.
+ */
+ void CrashOccurred();
+
+ /**
* Are we allowed to suspend the squirrel script at this moment?
*/
bool CanSuspend();