#include "clprogdefs.h"
#include "csprogs.h"
#include "cl_collision.h"
+#include "snd_main.h"
//============================================================================
// Client prog handling
VectorSet(prog->globals.client->input_movevalues, cl.movecmd[0].forwardmove, cl.movecmd[0].sidemove, cl.movecmd[0].upmove);
//VectorCopy(cl.movement_origin, cl.csqc_origin);
Matrix4x4_OriginFromMatrix(&cl.entities[cl.viewentity].render.matrix, cl.csqc_origin);
+
+ // LordHavoc: Spike says not to do this, but without pmove_org the
+ // CSQC is useless as it can't alter the view origin without
+ // completely replacing it
+ VectorCopy(cl.csqc_origin, prog->globals.client->pmove_org);
+ VectorCopy(cl.velocity, prog->globals.client->pmove_vel);
+
if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.view_angles)))
VectorCopy(cl.viewangles, val->vector);
prog->globals.client->maxclients = cl.maxclients;
CSQC_END
}
}
+qboolean CL_VM_Event_Sound(int sound_num, int volume, int channel, float attenuation, int ent, vec3_t pos)
+{
+ qboolean r = false;
+ if(cl.csqc_loaded)
+ {
+ CSQC_BEGIN
+ if(prog->funcoffsets.CSQC_Event_Sound)
+ {
+ prog->globals.client->time = cl.time;
+ PRVM_G_FLOAT(OFS_PARM0) = ent;
+ PRVM_G_FLOAT(OFS_PARM1) = channel;
+ PRVM_G_INT(OFS_PARM2) = PRVM_SetTempString(cl.sound_name[sound_num] );
+ PRVM_G_FLOAT(OFS_PARM3) = volume;
+ PRVM_G_FLOAT(OFS_PARM4) = attenuation;
+ VectorCopy(pos, PRVM_G_VECTOR(OFS_PARM5) );
+ PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Event_Sound, "QC function CSQC_Event_Sound is missing");
+ r = CSQC_RETURNVAL;
+ }
+ CSQC_END
+ }
+
+ return r;
+}
void CL_VM_UpdateCoopDeathmatchGlobals (int gametype)
{
// Avoid global names for clean(er) coding