}
entnum = ((pnum == PRVM_CLIENTPROG) ? MAX_EDICTS : 0) + PRVM_NUM_FOR_EDICT(PRVM_G_EDICT(OFS_PARM0));
entchannel = (int)PRVM_G_FLOAT(OFS_PARM1);
- if (entchannel <= 0 || entchannel > 8)
+ entchannel = CHAN_USER2ENGINE(entchannel);
+ if (!IS_CHAN(entchannel))
VM_Warning("VM_getsoundtime: %s: bad channel %i\n", PRVM_NAME, entchannel);
PRVM_G_FLOAT(OFS_RETURN) = (float)S_GetEntChannelPosition(entnum, entchannel);
}
PRVM_SetProg(handle->prognr);
PRVM_Begin;
- if((prog->starttime == handle->starttime) && (prog->funcoffsets.URI_Get_Callback))
+ if((prog->starttime == handle->starttime) && (PRVM_allfunction(URI_Get_Callback)))
{
if(length_received >= sizeof(handle->buffer))
length_received = sizeof(handle->buffer) - 1;
PRVM_G_FLOAT(OFS_PARM0) = handle->id;
PRVM_G_FLOAT(OFS_PARM1) = status;
PRVM_G_INT(OFS_PARM2) = PRVM_SetTempString(handle->buffer);
- PRVM_ExecuteProgram(prog->funcoffsets.URI_Get_Callback, "QC function URI_Get_Callback is missing");
+ PRVM_ExecuteProgram(PRVM_allfunction(URI_Get_Callback), "QC function URI_Get_Callback is missing");
}
PRVM_End;
const char *query_string = NULL;
size_t lq;
- if(!prog->funcoffsets.URI_Get_Callback)
+ if(!PRVM_allfunction(URI_Get_Callback))
PRVM_ERROR("uri_get called by %s without URI_Get_Callback defined", PRVM_NAME);
VM_SAFEPARMCOUNTRANGE(2, 6, VM_uri_get);
animatemodel(model, ed);
applytransform_inverted(PRVM_G_VECTOR(OFS_PARM2), ed, p);
clippointtosurface(ed, model, surface, p, out);
- VectorAdd(out, ed->fields.server->origin, PRVM_G_VECTOR(OFS_RETURN));
+ VectorAdd(out, PRVM_serveredictvector(ed, origin), PRVM_G_VECTOR(OFS_RETURN));
}
//PF_getsurfacenumtriangles, // #??? float(entity e, float s) getsurfacenumtriangles = #???;
return;
}
// entity should have MOVETYPE_PHYSICS already set, this can damage memory (making leaked allocation) so warn about this even if non-developer
- if (ed->fields.server->movetype != MOVETYPE_PHYSICS)
+ if (PRVM_serveredictfloat(ed, movetype) != MOVETYPE_PHYSICS)
{
VM_Warning("VM_physics_enable: entity is not MOVETYPE_PHYSICS!\n");
return;
return;
}
// entity should have MOVETYPE_PHYSICS already set, this can damage memory (making leaked allocation) so warn about this even if non-developer
- if (ed->fields.server->movetype != MOVETYPE_PHYSICS)
+ if (PRVM_serveredictfloat(ed, movetype) != MOVETYPE_PHYSICS)
{
VM_Warning("VM_physics_addforce: entity is not MOVETYPE_PHYSICS!\n");
return;
}
f.type = ODEFUNC_RELFORCEATPOS;
VectorCopy(PRVM_G_VECTOR(OFS_PARM1), f.v1);
- VectorSubtract(ed->fields.server->origin, PRVM_G_VECTOR(OFS_PARM2), f.v2);
+ VectorSubtract(PRVM_serveredictvector(ed, origin), PRVM_G_VECTOR(OFS_PARM2), f.v2);
VM_physics_ApplyCmd(ed, &f);
}
return;
}
// entity should have MOVETYPE_PHYSICS already set, this can damage memory (making leaked allocation) so warn about this even if non-developer
- if (ed->fields.server->movetype != MOVETYPE_PHYSICS)
+ if (PRVM_serveredictfloat(ed, movetype) != MOVETYPE_PHYSICS)
{
VM_Warning("VM_physics_addtorque: entity is not MOVETYPE_PHYSICS!\n");
return;