1
0
Fork 0
forked from fte/fteqw

Raised the runaway loop limit. perhaps a little too high now, but nexuiz's menus require it. Improved debugging and stuff, so you can assign functions to variables in the debugger.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2393 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2006-09-18 22:58:42 +00:00
parent 35a62a4ffc
commit 31215e5b06

View file

@ -487,26 +487,39 @@ char *EvaluateDebugString(progfuncs_t *progfuncs, char *key)
} }
*(int *)val = G_INT(fdef->ofs); *(int *)val = G_INT(fdef->ofs);
break; break;
/*
case ev_function: case ev_function:
if (s[1]==':'&&s[2]=='\0')
{ {
*(func_t *)val = 0; dfunction_t *func;
return true; int i;
int progsnum = -1;
char *s = assignment;
if (s[0] && s[1] == ':')
{
progsnum = atoi(s);
s+=2;
} }
func = ED_FindFunction (assignment, &i, -1); else if (s[0] && s[1] && s[2] == ':')
{
progsnum = atoi(s);
s+=3;
}
func = ED_FindFunction (progfuncs, s, &i, progsnum);
if (!func) if (!func)
{ {
printf ("Can't find function %s\n", assignment); assignment[-1] = '=';
return false; return va("Can't find function %s\n", s);
} }
*(func_t *)val = (func - pr_progstate[i].functions) | (i<<24); *(func_t *)val = (func - pr_progstate[i].functions) | (i<<24);
}
break; break;
*/
default: default:
break; break;
} }
assignment[-1] = '=';
} }
strcpy(buf, PR_ValueString(progfuncs, def->type, val)); strcpy(buf, PR_ValueString(progfuncs, def->type, val));
@ -749,6 +762,7 @@ static char *lastfile = 0;
} }
else if (f) //annoying. else if (f) //annoying.
{ {
if (*(f->s_file+progfuncs->stringtable)) //if we can't get the filename, then it was stripped, and debugging it like this is useless
if (externs->useeditor) if (externs->useeditor)
externs->useeditor(progfuncs, f->s_file+progfuncs->stringtable, -1, 0, NULL); externs->useeditor(progfuncs, f->s_file+progfuncs->stringtable, -1, 0, NULL);
return statement; return statement;
@ -782,7 +796,7 @@ void PR_ExecuteCode (progfuncs_t *progfuncs, int s)
int fnum = pr_xfunction - pr_functions; int fnum = pr_xfunction - pr_functions;
runaway = 1000000; runaway = 100000000;
prinst->continuestatement = -1; prinst->continuestatement = -1;