Skip to content
Snippets Groups Projects
Commit 0136c5ef authored by DarkGod's avatar DarkGod
Browse files

new --no-web command

Fixed the game not starting on some latest ubuntu installs
parent 78af673b
No related branches found
No related tags found
No related merge requests found
......@@ -1343,6 +1343,7 @@ int main(int argc, char *argv[])
bool logtofile = FALSE;
bool is_zygote = FALSE;
bool os_autoflush = FALSE;
bool no_web = FALSE;
FILE *logfile = NULL;
// Parse arguments
......@@ -1371,6 +1372,7 @@ int main(int argc, char *argv[])
if (!strncmp(arg, "--type=renderer", 15)) is_zygote = TRUE;
if (!strncmp(arg, "--no-sandbox", 12)) is_zygote = TRUE;
if (!strncmp(arg, "--logtofile", 11)) logtofile = TRUE;
if (!strncmp(arg, "--no-web", 8)) no_web = TRUE;
}
#ifdef SELFEXE_WINDOWS
......@@ -1392,7 +1394,7 @@ int main(int argc, char *argv[])
}
#endif
te4_web_load();
if (!no_web) te4_web_load();
// Initialize display lock for thread safety.
renderingLock = SDL_CreateMutex();
......
......@@ -577,6 +577,18 @@ void te4_web_load() {
printf("WebCore config: library(%s) spawn(%s)\n", libname ? libname : "--", spawnname ? spawnname : "--");
printf("Loading WebCore: %s\n", web ? "loaded!" : SDL_GetError());
#if defined(SELFEXE_LINUX) || defined(SELFEXE_BSD)
// Hack to fix a strange bug when it fails to load the library on some linux version it core dumps. So we restart a new process and tell it to not even try
if (!web) {
char **newargs = calloc(g_argc + 2, sizeof(char*));
int i;
for (i = 0; i < g_argc; i++) newargs[i] = g_argv[i];
newargs[g_argc] = strdup("--no-web");
newargs[g_argc+1] = NULL;
execv(get_self_executable(g_argc, g_argv), newargs);
}
#endif
if (web) {
webcore = TRUE;
te4_web_setup = (void (*)(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment