Fixups to work around ktx issues.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5970 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-07-17 15:10:35 +00:00
parent 55dbce5a3b
commit 4ddb475e7b
2 changed files with 8 additions and 0 deletions

View file

@ -7453,6 +7453,8 @@ static void QCBUILTIN PF_readcmd (pubprogfuncs_t *prinst, struct globalvars_s *p
s = PR_GetStringOfs(prinst, OFS_PARM0);
Cbuf_Execute();
if (svs.spawncount != spawncount || sv.state < ss_loading)
Host_EndGame("PF_readcmd: map changed before reading\n");
Cbuf_AddText (s, RESTRICT_LOCAL);
old = sv_redirected;

View file

@ -1460,6 +1460,7 @@ static qintptr_t QVM_ReadCmd (void *offset, quintptr_t mask, const qintptr_t *ar
extern int sv_redirectedlang;
redirect_t old;
int oldl;
int spawncount = svs.spawncount;
char *s = VM_POINTER(arg[0]);
char *output = VM_POINTER(arg[1]);
@ -1469,6 +1470,8 @@ static qintptr_t QVM_ReadCmd (void *offset, quintptr_t mask, const qintptr_t *ar
return -1;
Cbuf_Execute(); //FIXME: this code is flawed
if (svs.spawncount != spawncount || sv.state < ss_loading)
Host_EndGame("QVM_ReadCmd: Map changed before reading");
Cbuf_AddText (s, RESTRICT_LOCAL);
old = sv_redirected;
@ -1481,6 +1484,9 @@ static qintptr_t QVM_ReadCmd (void *offset, quintptr_t mask, const qintptr_t *ar
Q_strncpyz(output, sv_redirected_buf, outputlen);
SV_EndRedirect();
if (svs.spawncount != spawncount || sv.state < ss_loading)
Host_EndGame("QVM_ReadCmd: Map changed after reading");
if (old != RD_NONE)
SV_BeginRedirect(old, oldl);