From f085d7775b12e77b8012ab09ae72b850367a3237 Mon Sep 17 00:00:00 2001 From: yexo Date: Wed, 15 Jul 2009 19:47:06 +0000 Subject: (svn r16834) -Fix [FS#3034]: call the AI Save() function only once so AIs can't crash OpenTTD --- src/script/squirrel.cpp | 5 +++++ src/script/squirrel.hpp | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'src/script') 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 @@ -214,6 +214,11 @@ public: */ void ResetCrashed(); + /** + * Set the AI status to crashed. + */ + void CrashOccurred(); + /** * Are we allowed to suspend the squirrel script at this moment? */ -- cgit v1.2.3-54-g00ecf