prog->xfunction->profile += (st - startst);
st += st->b - 1; // offset the s++
startst = st;
+#if PRVMRUNAWAYCHECK
if (++jumpcount == 10000000)
{
prog->xstatement = st - prog->statements;
PRVM_Profile(1<<30, 1000000);
PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);
}
+#endif
}
break;
prog->xfunction->profile += (st - startst);
st += st->b - 1; // offset the s++
startst = st;
+#if PRVMRUNAWAYCHECK
if (++jumpcount == 10000000)
{
prog->xstatement = st - prog->statements;
PRVM_Profile(1<<30, 1000000);
PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);
}
+#endif
}
break;
prog->xfunction->profile += (st - startst);
st += st->a - 1; // offset the s++
startst = st;
+#if PRVMRUNAWAYCHECK
if (++jumpcount == 10000000)
{
prog->xstatement = st - prog->statements;
PRVM_Profile(1<<30, 1000000);
PRVM_ERROR("%s runaway loop counter hit limit of %d jumps\ntip: read above for list of most-executed functions", PRVM_NAME, jumpcount);
}
+#endif
break;
case OP_CALL0:
if (builtinnumber < prog->numbuiltins && prog->builtins[builtinnumber])
prog->builtins[builtinnumber]();
else
- PRVM_ERROR("No such builtin #%i in %s", builtinnumber, PRVM_NAME);
+ PRVM_ERROR("No such builtin #%i in %s; most likely cause: outdated engine build. Try updating!", builtinnumber, PRVM_NAME);
}
else
st = prog->statements + PRVM_EnterFunction(newf);
case OP_STATE:
if(prog->flag & PRVM_OP_STATE)
{
- ed = PRVM_PROG_TO_EDICT(PRVM_G_INT(prog->self->ofs));
- PRVM_E_FLOAT(ed,PRVM_ED_FindField ("nextthink")->ofs) = *prog->time + 0.1;
- PRVM_E_FLOAT(ed,PRVM_ED_FindField ("frame")->ofs) = OPA->_float;
- *(func_t *)((float*)ed->fields.vp + PRVM_ED_FindField ("think")->ofs) = OPB->function;
+ ed = PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict);
+ PRVM_EDICTFIELDVALUE(ed,prog->fieldoffsets.nextthink)->_float = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.time)->_float + 0.1;
+ PRVM_EDICTFIELDVALUE(ed,prog->fieldoffsets.frame)->_float = OPA->_float;
+ PRVM_EDICTFIELDVALUE(ed,prog->fieldoffsets.think)->function = OPB->function;
}
else
{