summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lua_core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lua_core.c b/src/lua_core.c
index 1ee21de..54be454 100644
--- a/src/lua_core.c
+++ b/src/lua_core.c
@@ -213,12 +213,16 @@ bool luaCallMain() {
char path[ STRING_LEN ] = { '\0' };
+/* If web, set path to resources folder. */
+#ifdef EMSCRIPTEN
+ sprintf( path, "resources/main.lua" );
+#else
sprintf( path, "%smain.lua", state->exePath );
-
/* Alternatively look for main. Could be precompiled binary file. */
if ( !FileExists( path ) ) {
sprintf( path, "%smain", state->exePath );
}
+#endif
luaL_dofile( L, path );