Merge pull request #3940 from Tastyfish/sdqlcall

Fixes SDQL's CALL
This commit is contained in:
Fox McCloud
2016-03-20 15:38:50 -04:00
2 changed files with 9 additions and 2 deletions
+4 -1
View File
@@ -91,7 +91,10 @@
// To stop any procs which sleep from executing slowly.
if(d)
if(hascall(d, v))
spawn() call(d, v)(arglist(args_list)) // Spawn in case the function sleeps.
var/list/arguments[0]
for(var/list/arg in args_list)
arguments += SDQL_expression(d, arg)
spawn() call(d, v)(arglist(arguments)) // Spawn in case the function sleeps.
if("delete")
for(var/datum/d in objs)
@@ -397,16 +397,20 @@
//call_function: <function name> ['(' [arguments] ')']
call_function(i, list/node, list/arguments)
var/list/cur_argument = list()
if(length(tokenl(i)))
node += token(i++)
if(token(i) != "(")
parse_error("Expected ( but found '[token(i)]'")
else if(token(i + 1) != ")")
do
i = expression(i + 1, arguments)
i = expression(i + 1, cur_argument)
if(token(i) == ",")
arguments += list(cur_argument)
cur_argument = list()
continue
while(token(i) && token(i) != ")")
arguments += list(cur_argument)
else
i++
else