Index: src/script/api/script_list.cpp
===================================================================
--- src/script/api/script_list.cpp (revision 27593)
+++ src/script/api/script_list.cpp (working copy)
@@ -11,6 +11,7 @@
#include "../../stdafx.h"
#include "script_list.hpp"
+#include "script_controller.hpp"
#include "../../debug.h"
#include "../../script/squirrel.hpp"
@@ -905,6 +906,14 @@
}
}
+ if (ScriptController::GetOpsTillSuspend() < -1000000) {
+ /* See below for explanation. The extra pop is the return value. */
+ sq_pop(vm, nparam + 4);
+
+ ScriptObject::SetAllowDoCommand(backup_allow);
+ return sq_throwerror(vm, "Excessive CPU usage");
+ }
+
/* Was something changed? */
if (previous_modification_count != this->modifications) {
/* See below for explanation. The extra pop is the return value. */