NTSL Update:

- You can now send signals with signal(freq, code). Added a cooldown to limit spamming.
    - You can now use "elseif" in your scripts to create a chain.
    - You can now use "return" in the global scope to end the script from running.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5701 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2013-02-13 21:43:34 +00:00
parent 9f1318f48d
commit 39a97a6f77
11 changed files with 96 additions and 15 deletions

View File

@@ -223,10 +223,21 @@
Checks a condition and runs either the if block or else block.
*/
RunIf(node/statement/IfStatement/stmt)
if(Eval(stmt.cond))
RunBlock(stmt.block)
else if(stmt.else_block)
RunBlock(stmt.else_block)
if(!stmt.skip)
if(Eval(stmt.cond))
RunBlock(stmt.block)
// Loop through the if else chain and tell them to be skipped.
var/node/statement/IfStatement/i = stmt.else_if
var/fail_safe = 800
while(i && fail_safe)
fail_safe -= 1
i.skip = 1
i = i.else_if
else if(stmt.else_block)
RunBlock(stmt.else_block)
// We don't need to skip you anymore.
stmt.skip = 0
/*
Proc: RunWhile