Added reject for stopflags in getHostname()

This commit is contained in:
Daniel Xie 2017-05-30 11:57:27 -05:00
parent 0e6036bfae
commit 9cc0a26d0b

@ -763,11 +763,13 @@ function evaluate(exp, workerScript) {
});
} else if (exp.func.value == "getHostname") {
if (env.stopFlag) {reject(workerScript); return;}
if (exp.args.length != 0) {
reject(makeRuntimeRejectMsg(workerScript, "getHostname() call has incorrect number of arguments. Takes 0 arguments"));
return;
}
setTimeout(function() {
if (env.stopFlag) {reject(workerScript); return;}
var scriptServer = getServer(workerScript.serverIp);
if (scriptServer == null) {
reject(makeRuntimeRejectMsg(workerScript, "Could not find server. This is a bug in the game. Report to game dev"));