mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-04-15 06:40:51 +00:00
Fix bruh
This commit is contained in:
parent
d0e7ba309a
commit
da6c159012
1 changed files with 6 additions and 8 deletions
|
@ -716,7 +716,7 @@ static void COM_Exec_Thread (struct COM_Exec_Ctx *ctx)
|
|||
|
||||
// load file
|
||||
// Try with Argv passed verbatim first, for back compat
|
||||
FIL_ReadFile(ctx->filename, &buf);
|
||||
FIL_ReadFile(ctx->filename, &ctx->buf);
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
if (I_thread_is_stopped())
|
||||
|
@ -725,13 +725,13 @@ static void COM_Exec_Thread (struct COM_Exec_Ctx *ctx)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (!buf)
|
||||
if (! ctx->buf)
|
||||
{
|
||||
// Now try by searching the file path
|
||||
// filename is modified with the full found path
|
||||
strcpy(filename, ctx->filename);
|
||||
if (findfile(filename, NULL, true) != FS_NOTFOUND)
|
||||
FIL_ReadFile(filename, &buf);
|
||||
FIL_ReadFile(filename, &ctx->buf);
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
if (I_thread_is_stopped())
|
||||
|
@ -741,17 +741,14 @@ static void COM_Exec_Thread (struct COM_Exec_Ctx *ctx)
|
|||
#endif
|
||||
}
|
||||
|
||||
if (buf)
|
||||
if (! ctx->buf)
|
||||
{
|
||||
if (! ctx->silent)
|
||||
CONS_Printf(M_GetText("executing %s\n"), ctx->filename);
|
||||
|
||||
// insert text file into the command buffer
|
||||
COM_BufAddText((char *)buf);
|
||||
COM_BufAddText((char *)ctx->buf);
|
||||
COM_BufAddText("\n");
|
||||
|
||||
// free buffer
|
||||
Z_Free(buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -759,6 +756,7 @@ static void COM_Exec_Thread (struct COM_Exec_Ctx *ctx)
|
|||
CONS_Printf(M_GetText("couldn't execute file %s\n"), ctx->filename);
|
||||
}
|
||||
|
||||
Free_COM_Exec_Ctx(ctx);
|
||||
}
|
||||
|
||||
/** Executes a script file.
|
||||
|
|
Loading…
Reference in a new issue