Removed the scripting machine due to massive crashes! It'll be back when the crashes are resolved.

Some other bugfixes and improvements.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3214 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
vageyenaman@gmail.com
2012-02-29 06:27:25 +00:00
parent 587a385173
commit 55ec72c7cb
4 changed files with 54 additions and 38 deletions

View File

@@ -32,6 +32,7 @@
returnVal
max_iterations=100 // max iterations without any kind of delay
cur_iterations=0 // current iteration
max_recursion=50 // max recursions without returning anything (or completing the code block)
cur_recursion=0 // current amount of recursion
/*
@@ -211,9 +212,14 @@
*/
RunWhile(node/statement/WhileLoop/stmt)
var/i=1
if(!cur_iterations)
cur_iterations = 1
while(Eval(stmt.cond) && Iterate(stmt.block, i++))
cur_iterations++
continue
status &= ~BREAKING
cur_iterations -= i
if(cur_iterations <= 0) cur_iterations = 0
/*
Proc:Iterate
@@ -221,7 +227,7 @@
*/
Iterate(node/BlockDefinition/block, count)
RunBlock(block)
if(max_iterations > 0 && count >= max_iterations)
if(max_iterations > 0 && (count >= max_iterations || cur_iterations + 1 >= max_iterations))
RaiseError(new/runtimeError/IterationLimitReached())
return 0
if(status & (BREAKING|RETURNING))