float *time;
float _time;
+ // allow writing to world entity fields, this is set by server init and
+ // cleared before first server frame
+ qboolean allowworldwrites;
+
// name of the prog, e.g. "Server", "Client" or "Menu" (used for text output)
char *name; // [INIT]
return;
}
#endif
- /*if (OPA->edict == 0 && sv.state == ss_active)
+ if (OPA->edict == 0 && !prog->allowworldwrites)
{
prog->xfunction->profile += profile - startprofile;
startprofile = profile;
prog->xstatement = st - prog->statements;
Host_Error("assignment to world entity in %s", PRVM_NAME);
return;
- }*/
+ }
ed = PRVM_PROG_TO_EDICT(OPA->edict);
OPC->_int = (qbyte *)((int *)ed->fields.vp + OPB->_int) - (qbyte *)prog->edictsfields;
break;
break;
case OP_STATE:
- if(prog->flag & PRVM_OP_STATE)
+ if(prog->flag & PRVM_OP_STATE)
{
prog->xfunction->profile += profile - startprofile;
startprofile = profile;
else
PRVM_ERROR("OP_STATE not supported by %s\n", PRVM_NAME);
break;
-
+
// LordHavoc: to be enabled when Progs version 7 (or whatever it will be numbered) is finalized
/*
case OP_ADD_I:
//prog->num_edicts = svs.maxclients+1;
sv.state = ss_loading;
+ prog->allowworldwrites = true;
sv.paused = false;
*prog->time = sv.time = 1.0;
// all setup is completed, any further precache statements are errors
sv.state = ss_active;
+ prog->allowworldwrites = false;
// run two frames to allow everything to settle
for (i = 0;i < 2;i++)