forked from fte/fteqw
1
0
Fork 0

Slightly better ktpro support.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1613 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-11-28 00:14:32 +00:00
parent 9ac5f4c441
commit 806c2eb85b
1 changed files with 29 additions and 8 deletions

View File

@ -182,13 +182,17 @@ pbool ED_CanFree (edict_t *ed)
ed->v->nextthink = 0; ed->v->nextthink = 0;
ed->v->solid = 0; ed->v->solid = 0;
if (pr_imitatemvdsv.value) if (pr_imitatemvdsv.value)
{ {
ed->v->classname = 0;
ed->v->health = 0; ed->v->health = 0;
ed->v->classname = 0;
ed->v->nextthink = -1;
ed->v->impulse = 0; //this is not true imitation, but it seems we need this line to get out of some ktpro infinate loops.
} }
else else
{
ed->v->think = 0; ed->v->think = 0;
}
ed->v->SendEntity = 0; ed->v->SendEntity = 0;
sv.csqcentversion[ed->entnum] = ed->v->Version+1; sv.csqcentversion[ed->entnum] = ed->v->Version+1;
@ -308,6 +312,7 @@ int QCEditor (progfuncs_t *prinst, char *filename, int line, int nump, char **pa
{ {
#ifdef TEXTEDITOR #ifdef TEXTEDITOR
static char oldfuncname[64]; static char oldfuncname[64];
if (!parms) if (!parms)
return QCLibEditor(prinst, filename, line, nump, parms); return QCLibEditor(prinst, filename, line, nump, parms);
else else
@ -325,6 +330,8 @@ int QCEditor (progfuncs_t *prinst, char *filename, int line, int nump, char **pa
char *r; char *r;
FILE *f; FILE *f;
SV_EndRedirect();
if (line == -1) if (line == -1)
return -1; return -1;
SV_EndRedirect(); SV_EndRedirect();
@ -333,7 +340,12 @@ int QCEditor (progfuncs_t *prinst, char *filename, int line, int nump, char **pa
else else
f = NULL; //faster. f = NULL; //faster.
if (!f) if (!f)
Con_Printf("%s - %i\n", filename, line); {
Q_snprintfz(buffer, sizeof(buffer), "src/%s", filename);
COM_FOpenFile(buffer, &f);
}
if (!f)
Con_Printf("-%s - %i\n", filename, line);
else else
{ {
for (i = 0; i < line; i++) for (i = 0; i < line; i++)
@ -342,7 +354,7 @@ int QCEditor (progfuncs_t *prinst, char *filename, int line, int nump, char **pa
} }
if ((r = strchr(buffer, '\r'))) if ((r = strchr(buffer, '\r')))
{ r[0] = '\n';r[1]='\0';} { r[0] = '\n';r[1]='\0';}
Con_Printf("%s", buffer); Con_Printf("-%s", buffer);
fclose(f); fclose(f);
} }
//PF_break(NULL); //PF_break(NULL);
@ -3465,8 +3477,11 @@ void PF_Remove (progfuncs_t *prinst, struct globalvars_s *pr_globals)
if (ed->isfree && progstype != PROG_H2) //h2 is dire... if (ed->isfree && progstype != PROG_H2) //h2 is dire...
{ {
ED_CanFree(ed); ED_CanFree(ed);
if (developer.value)
Con_DPrintf("Tried removing free entity\n"); {
Con_Printf("Tried removing free entity at:\n");
PR_StackTrace(prinst);
}
return; //yeah, alright, so this is hacky. return; //yeah, alright, so this is hacky.
} }
@ -5109,8 +5124,13 @@ void PF_infokey (progfuncs_t *prinst, struct globalvars_s *pr_globals)
if (e1 == 0) if (e1 == 0)
{ {
if ((value = Info_ValueForKey (svs.info, key)) == NULL || !*value) if (pr_imitatemvdsv.value && !strcmp(key, "*version"))
value = Info_ValueForKey(localinfo, key); value = "2.40";
else
{
if ((value = Info_ValueForKey (svs.info, key)) == NULL || !*value)
value = Info_ValueForKey(localinfo, key);
}
} }
else if (e1 <= MAX_CLIENTS) else if (e1 <= MAX_CLIENTS)
{ {
@ -5294,6 +5314,7 @@ void PF_forgetstring(progfuncs_t *prinst, struct globalvars_s *pr_globals)
Con_Printf("QC tried to free a non allocated string: "); Con_Printf("QC tried to free a non allocated string: ");
Con_Printf("%s\n", s+8); //two prints, so that logged prints ensure the first is written. Con_Printf("%s\n", s+8); //two prints, so that logged prints ensure the first is written.
(*prinst->pr_trace) = 1; (*prinst->pr_trace) = 1;
PR_StackTrace(prinst);
return; return;
} }
((int *)s)[0] = 0xabcd1234; ((int *)s)[0] = 0xabcd1234;