ddef16_t *def16;
int i;
+ if (pr_typecurrent < 0)
+ return NULL;
+
switch (pr_progstate[pr_typecurrent].structtype)
{
case PST_DEFAULT:
int type;
ddef32_t fakedef;
eval_t fakeval;
+ edictrun_t *ed;
assignment = strchr(key, '=');
if (assignment)
c2 = c+1;
c = strchr(c2, '.');
type = type &~DEF_SAVEGLOBAL;
- if (current_progstate->types)
+ if (current_progstate && current_progstate->types)
type = current_progstate->types[type].type;
if (type != ev_entity)
return "'.' without entity";
if (c)*c = '.';
if (!fdef)
return "(Bad string)";
- val = (eval_t *) (((char *)PROG_TO_EDICT(progfuncs, val->_int)->fields) + fdef->ofs*4);
+ ed = PROG_TO_EDICT(progfuncs, val->_int);
+ if (!ed)
+ return "(Invalid Entity)";
+ val = (eval_t *) (((char *)ed->fields) + fdef->ofs*4);
type = fdef->type;
}
if (assignment)
{
assignment++;
+ while(*assignment == ' ')
+ assignment++;
switch (type&~DEF_SAVEGLOBAL)
{
case ev_string:
break;
case ev_float:
- *(float *)val = (float)atof (assignment);
+ if (assignment[0] == '0' && (assignment[1] == 'x' || assignment[1] == 'X'))
+ *(float*)val = strtoul(assignment, NULL, 0);
+ else
+ *(float *)val = (float)atof (assignment);
break;
case ev_integer:
dfunction_t *newf;
int runaway;
int i;
- int p;
edictrun_t *ed;
eval_t *ptr;
prinst->continuestatement = -1;
#ifdef QCJIT
- if (prinst->jit)
+ if (current_progstate->jit)
{
- PR_EnterJIT(progfuncs, prinst->jit, s);
+ PR_EnterJIT(progfuncs, current_progstate->jit, s);
return;
}
#endif
{ \
pr_xstatement = st-pr_statements; \
PR_StackTrace(progfuncs); \
- printf ("runaway loop error"); \
+ printf ("runaway loop error\n"); \
while(pr_depth > prinst->exitdepth) \
PR_LeaveFunction(progfuncs); \
pr_spushed = 0; \