Loading

Paste #pysk0tt62

  1. Index: src/script/api/script_list.cpp
  2. ===================================================================
  3. --- src/script/api/script_list.cpp  (revision 27593)
  4. +++ src/script/api/script_list.cpp  (working copy)
  5. @@ -11,6 +11,7 @@
  6.  
  7.  #include "../../stdafx.h"
  8.  #include "script_list.hpp"
  9. +#include "script_controller.hpp"
  10.  #include "../../debug.h"
  11.  #include "../../script/squirrel.hpp"
  12.  
  13. @@ -905,6 +906,14 @@
  14.             }
  15.         }
  16.  
  17. +       if (ScriptController::GetOpsTillSuspend() < -1000000) {
  18. +           /* See below for explanation. The extra pop is the return value. */
  19. +           sq_pop(vm, nparam + 4);
  20. +
  21. +           ScriptObject::SetAllowDoCommand(backup_allow);
  22. +           return sq_throwerror(vm, "Excessive CPU usage");
  23. +       }
  24. +
  25.         /* Was something changed? */
  26.         if (previous_modification_count != this->modifications) {
  27.             /* See below for explanation. The extra pop is the return value. */
  28.  

Comments