diff --git a/code/modules/scripting/Parser/Parser.dm b/code/modules/scripting/Parser/Parser.dm index 9f88fd2227..ad961c755f 100644 --- a/code/modules/scripting/Parser/Parser.dm +++ b/code/modules/scripting/Parser/Parser.dm @@ -171,7 +171,12 @@ NextToken() //skip function name if(!CheckToken("(", /token/symbol)) //Check for and skip open parenthesis return + var/loops = 0 for() + loops++ + if(loops>=6000) + CRASH("Something TERRIBLE has gone wrong in ParseFunctionStatement ;__;") + if(!curToken) errors+=new/scriptError/EndOfFile() return