1
0
forked from mirrors/0ad

Added exit() JS function

This was SVN commit r673.
This commit is contained in:
Ykkrosh
2004-07-09 12:44:12 +00:00
parent dc5e5dd774
commit fcb85a5968
3 changed files with 19 additions and 1 deletions
+9
View File
@@ -30,6 +30,7 @@ JSFunctionSpec ScriptFunctionTable[] =
{"getEntityTemplate", getEntityTemplate, 1, 0, 0 },
{"getGUIObjectByName", JSI_IGUIObject::getByName, 1, 0, 0 },
{"getGlobal", getGlobal, 0, 0, 0 },
{"exit", exitProgram, 0, 0, 0 },
{0, 0, 0, 0, 0},
};
@@ -129,3 +130,11 @@ JSBool getGlobal( JSContext* context, JSObject* globalObject, unsigned int argc,
return( JS_TRUE );
}
extern void kill_mainloop(); // from main.cpp
JSBool exitProgram(JSContext* context, JSObject* globalObject, unsigned int argc, jsval* argv, jsval* rval)
{
kill_mainloop();
return JS_TRUE;
}