Annother day of hacking finished.

Time for bed.


git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1137 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-07-08 00:37:52 +00:00
parent cc753531a5
commit 86b651132e
13 changed files with 324 additions and 78 deletions

View file

@ -1780,6 +1780,7 @@ void CL_LinkProjectiles (void)
ent->model = cl.model_precache[pr->modelindex];
ent->skinnum = 0;
ent->frame = 0;
ent->flags = 0;
ent->colormap = vid.colormap;
ent->scoreboard = NULL;
#ifdef PEXT_SCALE

View file

@ -591,6 +591,32 @@ void CL_ParseTEnt (void)
S_StartSound (-2, 0, cl_sfx_knighthit, pos, 1, 1);
break;
case DPTE_SPIKEQUAD:
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
R_AddStain(pos, -10, -10, -10, 20);
R_AddDecals(pos);
if (P_RunParticleEffectTypeString(pos, NULL, 1, "te_spikequad"))
if (P_RunParticleEffectType(pos, NULL, 1, pt_spike))
if (P_RunParticleEffectType(pos, NULL, 10, pt_gunshot))
P_RunParticleEffect (pos, vec3_origin, 0, 10);
if ( rand() % 5 )
S_StartSound (-2, 0, cl_sfx_tink1, pos, 1, 1);
else
{
rnd = rand() & 3;
if (rnd == 1)
S_StartSound (-2, 0, cl_sfx_ric1, pos, 1, 1);
else if (rnd == 2)
S_StartSound (-2, 0, cl_sfx_ric2, pos, 1, 1);
else
S_StartSound (-2, 0, cl_sfx_ric3, pos, 1, 1);
}
break;
case TE_SPIKE: // spike hitting wall
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
@ -603,6 +629,33 @@ void CL_ParseTEnt (void)
if (P_RunParticleEffectType(pos, NULL, 10, pt_gunshot))
P_RunParticleEffect (pos, vec3_origin, 0, 10);
if ( rand() % 5 )
S_StartSound (-2, 0, cl_sfx_tink1, pos, 1, 1);
else
{
rnd = rand() & 3;
if (rnd == 1)
S_StartSound (-2, 0, cl_sfx_ric1, pos, 1, 1);
else if (rnd == 2)
S_StartSound (-2, 0, cl_sfx_ric2, pos, 1, 1);
else
S_StartSound (-2, 0, cl_sfx_ric3, pos, 1, 1);
}
break;
case DPTE_SUPERSPIKEQUAD: // super spike hitting wall
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
R_AddStain(pos, -10, -10, -10, 20);
R_AddDecals(pos);
if (P_RunParticleEffectTypeString(pos, NULL, 1, "te_superspikequad"))
if (P_RunParticleEffectType(pos, NULL, 1, pt_superspike))
if (P_RunParticleEffectType(pos, NULL, 2, pt_spike))
if (P_RunParticleEffectType(pos, NULL, 20, pt_gunshot))
P_RunParticleEffect (pos, vec3_origin, 0, 20);
if ( rand() % 5 )
S_StartSound (-2, 0, cl_sfx_tink1, pos, 1, 1);
else
@ -699,6 +752,42 @@ void CL_ParseTEnt (void)
break;
#endif
case DPTE_EXPLOSIONQUAD: // rocket explosion
// particles
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
if (P_RunParticleEffectTypeString(pos, NULL, 1, "te_explosionquad"))
P_ParticleExplosion (pos);
// light
dl = CL_AllocDlight (0);
VectorCopy (pos, dl->origin);
dl->radius = 350;
dl->die = cl.time + 1;
dl->decay = 300;
dl->color[0] = 0.2;
dl->color[1] = 0.155;
dl->color[2] = 0.05;
dl->channelfade[0] = 0.196;
dl->channelfade[1] = 0.23;
dl->channelfade[2] = 0.12;
// sound
S_StartSound (-2, 0, cl_sfx_r_exp3, pos, 1, 1);
// sprite
if (cl_expsprite.value) // temp hopefully
{
explosion_t *ex = CL_AllocExplosion ();
VectorCopy (pos, ex->origin);
ex->start = cl.time;
ex->model = Mod_ForName ("progs/s_explod.spr", true);
}
break;
case TE_EXPLOSION: // rocket explosion
// particles
pos[0] = MSG_ReadCoord ();
@ -766,6 +855,18 @@ void CL_ParseTEnt (void)
P_RunParticleEffectType(pos, NULL, 1, pt_teleportsplash);
break;
case DPTE_GUNSHOTQUAD: // bullet hitting wall
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
R_AddStain(pos, -10, -10, -10, 20);
if (P_RunParticleEffectTypeString(pos, NULL, 1, "te_gunshotquad"))
if (P_RunParticleEffectType(pos, NULL, 1, pt_gunshot))
P_RunParticleEffect (pos, vec3_origin, 0, 20);
break;
case TE_GUNSHOT: // bullet hitting wall
if (nqprot)
cnt = 1;

View file

@ -674,6 +674,7 @@ void CL_BaseMove (usercmd_t *cmd, int pnum, float extra, float wantfps);
float CL_KeyState (kbutton_t *key, int pnum);
char *Key_KeynumToString (int keynum);
int Key_StringToKeynum (char *str, int *modifier);
char *Key_GetBinding(int keynum);
void VARGS CL_SendClientCommand(qboolean reliable, char *format, ...);
void CL_AllowIndependantSendCmd(qboolean allow);

View file

@ -249,6 +249,7 @@ void PF_pow (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_chr2str (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_localcmd (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_random (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_randomvector (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_fopen (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_fclose (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_fputs (progfuncs_t *prinst, struct globalvars_s *pr_globals);
@ -1130,6 +1131,11 @@ static void PF_ReadCoord(progfuncs_t *prinst, struct globalvars_s *pr_globals)
G_FLOAT(OFS_RETURN) = MSG_ReadCoord();
}
static void PF_ReadFloat(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
G_FLOAT(OFS_RETURN) = MSG_ReadFloat();
}
static void PF_ReadString(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
char *str = PF_TempStr(prinst);
@ -1608,6 +1614,93 @@ static void PF_cs_findradius (progfuncs_t *prinst, struct globalvars_s *pr_globa
RETURN_EDICT(prinst, (void*)chain);
}
static void PF_cl_te_gunshot (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
if (P_RunParticleEffectType(pos, NULL, 1, pt_gunshot))
P_RunParticleEffect (pos, vec3_origin, 0, 20);
}
static void PF_cl_te_spike (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
if (P_RunParticleEffectType(pos, NULL, 1, pt_spike))
if (P_RunParticleEffectType(pos, NULL, 10, pt_gunshot))
P_RunParticleEffect (pos, vec3_origin, 0, 10);
}
static void PF_cl_te_superspike (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
if (P_RunParticleEffectType(pos, NULL, 1, pt_superspike))
if (P_RunParticleEffectType(pos, NULL, 2, pt_spike))
if (P_RunParticleEffectType(pos, NULL, 20, pt_gunshot))
P_RunParticleEffect (pos, vec3_origin, 0, 20);
}
static void PF_cl_te_explosion (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
P_ParticleExplosion(pos);
}
static void PF_cl_te_tarexplosion (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
P_BlobExplosion (pos);
}
static void PF_cl_te_wizspike (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
if (P_RunParticleEffectType(pos, NULL, 1, pt_wizspike))
P_RunParticleEffect (pos, vec3_origin, 20, 30);
}
static void PF_cl_te_knightspike (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
if (P_RunParticleEffectType(pos, NULL, 1, pt_knightspike))
P_RunParticleEffect (pos, vec3_origin, 226, 20);
}
static void PF_cl_te_lavasplash (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
P_LavaSplash (pos);
}
static void PF_cl_te_teleport (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
P_RunParticleEffectType(pos, NULL, 1, pt_teleportsplash);
}
static void PF_cl_te_gunshotquad (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
if (P_RunParticleEffectTypeString(pos, vec3_origin, 1, "te_gunshotquad"))
if (P_RunParticleEffectType(pos, NULL, 2, pt_gunshot))
P_RunParticleEffect (pos, vec3_origin, 0, 40);
}
static void PF_cl_te_spikequad (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
if (P_RunParticleEffectTypeString(pos, vec3_origin, 1, "te_spikequad"))
if (P_RunParticleEffectType(pos, NULL, 2, pt_spike))
if (P_RunParticleEffectType(pos, NULL, 20, pt_gunshot))
P_RunParticleEffect (pos, vec3_origin, 0, 20);
}
static void PF_cl_te_superspikequad (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
if (P_RunParticleEffectTypeString(pos, vec3_origin, 1, "te_superspikequad"))
if (P_RunParticleEffectType(pos, NULL, 2, pt_superspike))
if (P_RunParticleEffectType(pos, NULL, 4, pt_spike))
if (P_RunParticleEffectType(pos, NULL, 40, pt_gunshot))
P_RunParticleEffect (pos, vec3_origin, 0, 40);
}
static void PF_cl_te_explosionquad (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
float *pos = G_VECTOR(OFS_PARM0);
if (P_RunParticleEffectTypeString(pos, vec3_origin, 1, "te_explosionquad"))
{
P_ParticleExplosion(pos);
P_ParticleExplosion(pos);
}
}
//these are the builtins that still need to be added.
#define PF_cs_droptofloor PF_Fixme
#define PF_cs_tracetoss PF_Fixme
@ -1619,27 +1712,26 @@ static void PF_cs_findradius (progfuncs_t *prinst, struct globalvars_s *pr_globa
#define PF_cl_te_spark PF_Fixme
#define PF_cl_te_smallflash PF_Fixme
#define PF_cl_te_customflash PF_Fixme
#define PF_cl_te_gunshot PF_Fixme
#define PF_cl_te_spike PF_Fixme
#define PF_cl_te_superspike PF_Fixme
#define PF_cl_te_explosion PF_Fixme
#define PF_cl_te_tarexplosion PF_Fixme
#define PF_cl_te_wizspike PF_Fixme
#define PF_cl_te_knightspike PF_Fixme
#define PF_cl_te_lavasplash PF_Fixme
#define PF_cl_te_teleport PF_Fixme
#define PF_cl_te_explosion2 PF_Fixme
#define PF_cl_te_lightning1 PF_Fixme
#define PF_cl_te_lightning2 PF_Fixme
#define PF_cl_te_lightning3 PF_Fixme
#define PF_cl_te_beam PF_Fixme
#define PF_cl_te_plasmaburn PF_Fixme
#define PF_cl_te_explosionrgb PF_Fixme
#define PF_cl_te_particlerain PF_Fixme
#define PF_cl_te_particlesnow PF_Fixme
#define PF_cs_gettagindex PF_Fixme
#define PF_cs_gettaginfo PF_Fixme
#define PS_cs_setattachment PF_Fixme
#define PF_cs_break PF_Fixme
#define PF_cs_walkmove PF_Fixme
#define PF_cs_checkbottom PF_Fixme
#define PF_cl_playingdemo PF_Fixme
#define PF_cl_runningserver PF_Fixme
#define PF_cl_getlight PF_Fixme
#define PF_findfloat PF_Fixme
#define PF_cl_getlight PF_Fixme
#define PF_FixTen PF_Fixme,PF_Fixme,PF_Fixme,PF_Fixme,PF_Fixme,PF_Fixme,PF_Fixme,PF_Fixme,PF_Fixme,PF_Fixme
@ -1756,15 +1848,15 @@ PF_Fixme,
PF_Fixme,
//90
PF_cs_tracebox,
PF_Fixme,
PF_Fixme,
PF_randomvector, // #91 vector() randomvec (DP_QC_RANDOMVEC)
PF_cl_getlight, // #92 vector(vector org) getlight (DP_QC_GETLIGHT)
PF_registercvar, // #93 void(string cvarname, string defaultvalue) registercvar (DP_QC_REGISTERCVAR)
PF_min, // #94 float(float a, floats) min (DP_QC_MINMAXBOUND)
PF_max, // #95 float(float a, floats) max (DP_QC_MINMAXBOUND)
PF_bound, // #96 float(float minimum, float val, float maximum) bound (DP_QC_MINMAXBOUND)
PF_pow, // #97 float(float value) pow (DP_QC_SINCOSSQRTPOW)
PF_Fixme, // #98
PF_findfloat, // #98 entity(entity start, .float fld, float match) findfloat (DP_QC_FINDFLOAT)
PF_checkextension, // #99 float(string extname) checkextension (EXT_CSQC)
//100
PF_Fixme,
@ -1866,7 +1958,7 @@ PF_ReadCoord, // #??? float() readcoord (EXT_CSQC)
PF_ReadAngle, // #??? float() readangle (EXT_CSQC)
PF_ReadString, // #??? string() readstring (EXT_CSQC)
PF_Fixme,
PF_ReadFloat, // #??? string() readfloat (EXT_CSQC)
PF_Fixme,
PF_Fixme,
@ -1953,47 +2045,47 @@ PF_findchain, // #402 entity(string field, string match) findchain (DP_QC_FIND
PF_findchainfloat, // #403 entity(float fld, float match) findchainfloat (DP_QC_FINDCHAINFLOAT)
PF_cl_effect, // #404 void(vector org, string modelname, float startframe, float endframe, float framerate) effect (DP_SV_EFFECT)
PF_cl_te_blood, // #405 te_blood (DP_TE_BLOOD)
PF_cl_te_blood, // #405 void(vector org, vector velocity, float howmany) te_blood (DP_TE_BLOOD)
PF_cl_te_bloodshower, // #406 void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower (DP_TE_BLOODSHOWER)
PF_Fixme, // #407
PF_cl_te_explosionrgb, // #407 void(vector org, vector color) te_explosionrgb (DP_TE_EXPLOSIONRGB)
PF_cl_te_particlecube, // #408 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube (DP_TE_PARTICLECUBE)
PF_Fixme, // #409
PF_cl_te_particlerain, // #409 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain (DP_TE_PARTICLERAIN)
PF_Fixme, // #410
PF_cl_te_particlesnow, // #410 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow (DP_TE_PARTICLESNOW)
PF_cl_te_spark, // #411 void(vector org, vector vel, float howmany) te_spark (DP_TE_SPARK)
PF_Fixme, // #412
PF_Fixme, // #413
PF_Fixme, // #414
PF_cl_te_gunshotquad, // #412 void(vector org) te_gunshotquad (DP_TE_QUADEFFECTS1)
PF_cl_te_spikequad, // #413 void(vector org) te_spikequad (DP_TE_QUADEFFECTS1)
PF_cl_te_superspikequad,// #414 void(vector org) te_superspikequad (DP_TE_QUADEFFECTS1)
PF_Fixme, // #415
PF_cl_te_explosionquad, // #415 void(vector org) te_explosionquad (DP_TE_QUADEFFECTS1)
PF_cl_te_smallflash, // #416 void(vector org) te_smallflash (DP_TE_SMALLFLASH)
PF_cl_te_customflash, // #417 void(vector org, float radius, float lifetime, vector color) te_customflash (DP_TE_CUSTOMFLASH)
PF_cl_te_gunshot, // #418 te_gunshot (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_spike, // #419 te_spike (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_gunshot, // #418 void(vector org) te_gunshot (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_spike, // #419 void(vector org) te_spike (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_superspike, // #420 te_superspike (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_explosion, // #421 te_explosion (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_tarexplosion, // #422 te_tarexplosion (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_wizspike, // #423 te_wizspike (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_knightspike, // #424 te_knightspike (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_superspike, // #420 void(vector org) te_superspike (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_explosion, // #421 void(vector org) te_explosion (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_tarexplosion, // #422 void(vector org) te_tarexplosion (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_wizspike, // #423 void(vector org) te_wizspike (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_knightspike, // #424 void(vector org) te_knightspike (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_lavasplash, // #425 te_lavasplash (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_teleport, // #426 te_teleport (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_explosion2, // #427 te_explosion2 (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_lightning1, // #428 te_lightning1 (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_lightning2, // #429 te_lightning2 (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_lavasplash, // #425 void(vector org) te_lavasplash (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_teleport, // #426 void(vector org) te_teleport (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_explosion2, // #427 void(vector org, float color, float colorlength) te_explosion2 (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_lightning1, // #428 void(entity own, vector start, vector end) te_lightning1 (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_lightning2, // #429 void(entity own, vector start, vector end) te_lightning2 (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_lightning3, // #430 te_lightning3 (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_beam, // #431 te_beam (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_lightning3, // #430 void(entity own, vector start, vector end) te_lightning3 (DP_TE_STANDARDEFFECTBUILTINS)
PF_cl_te_beam, // #431 void(entity own, vector start, vector end) te_beam (DP_TE_STANDARDEFFECTBUILTINS)
PF_cs_vectorvectors, // #432 void(vector dir) vectorvectors (DP_QC_VECTORVECTORS)
PF_cl_te_plasmaburn, // #433 void(vector org) te_plasmaburn (DP_TE_PLASMABURN)
PF_Fixme, // #434
PF_Fixme, // #434 float(entity e, float s) getsurfacenumpoints (DP_QC_GETSURFACE)
PF_Fixme, // #435
PF_Fixme, // #436
PF_Fixme, // #437
PF_Fixme, // #438
PF_Fixme, // #439
PF_Fixme, // #435 vector(entity e, float s, float n) getsurfacepoint (DP_QC_GETSURFACE)
PF_Fixme, // #436 vector(entity e, float s) getsurfacenormal (DP_QC_GETSURFACE)
PF_Fixme, // #437 string(entity e, float s) getsurfacetexture (DP_QC_GETSURFACE)
PF_Fixme, // #438 float(entity e, vector p) getsurfacenearpoint (DP_QC_GETSURFACE)
PF_Fixme, // #439 vector(entity e, float s, vector p) getsurfaceclippedpoint (DP_QC_GETSURFACE)
PF_NoCSQC, // #440 void(entity e, string s) clientcommand (KRIMZON_SV_PARSECLIENTCOMMAND) (don't implement)
PF_Tokenize, // #441 float(string s) tokenize (KRIMZON_SV_PARSECLIENTCOMMAND)
@ -2008,8 +2100,8 @@ PF_cvar_string, // #448 string(float n) cvar_string (DP_QC_CVAR_STRING)
PF_FindFlags, // #449 entity(entity start, .entity fld, float match) findflags (DP_QC_FINDFLAGS)
PF_findchainflags, // #450 entity(.float fld, float match) findchainflags (DP_QC_FINDCHAINFLAGS)
PF_Fixme, // #451
PF_Fixme, // #452
PF_cs_gettagindex, // #451 float(entity ent, string tagname) gettagindex (DP_MD3_TAGSINFO)
PF_cs_gettaginfo, // #452 vector(entity ent, float tagindex) gettaginfo (DP_MD3_TAGSINFO)
PF_NoCSQC, // #453 void(entity player) dropclient (DP_QC_BOTCLIENT) (don't implement)
PF_NoCSQC, // #454 entity() spawnclient (DP_QC_BOTCLIENT) (don't implement)

View file

@ -38,7 +38,7 @@ void PF_ArgV (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_FindString (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_FindFloat (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_nextent (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_randomvec (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_randomvector (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_Sin (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_Cos (progfuncs_t *prinst, struct globalvars_s *pr_globals);
void PF_Sqrt (progfuncs_t *prinst, struct globalvars_s *pr_globals);
@ -567,7 +567,7 @@ void PF_cl_keynumtostring (progfuncs_t *prinst, struct globalvars_s *pr_globals)
void PF_cl_getkeybind (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
char *binding = Key_GetBinding();
char *binding = Key_GetBinding(G_FLOAT(OFS_PARM0));
char *result = PF_TempStr(prinst);
if (!binding)
binding = "";
@ -1089,7 +1089,7 @@ builtin_t menu_builtins[] = {
PF_Cos,
//40
PF_Sqrt,
PF_randomvec,
PF_randomvector,
PF_registercvar,
PF_min,
PF_max,

View file

@ -330,6 +330,7 @@ char *particle_set_spikeset =
" texture \"particles/explosion\"\n"
" count 16\n"
" scale 0\n"
" alpha 0\n"
" die 1\n"
" randomvel 128\n"
" veladd 64\n"

View file

@ -513,6 +513,7 @@ void S_Init (void)
Cmd_AddCommand("play", S_Play);
Cmd_AddCommand("play2", S_Play);
Cmd_AddCommand("playvol", S_PlayVol);
Cmd_AddCommand("stopsound", S_StopAllSoundsC);
Cmd_AddCommand("soundlist", S_SoundList);

View file

@ -607,7 +607,11 @@ enum {
#define DPTE_BLOODSHOWER 52
#define DPTE_EXPLOSIONRGB 53
#define DPTE_PARTICLECUBE 54
#define DPTE_SMALLFLASH 72
#define DPTE_GUNSHOTQUAD 57 // [vector] origin
#define DPTE_SPIKEQUAD 58 // [vector] origin
#define DPTE_SUPERSPIKEQUAD 59 // [vector] origin
#define DPTE_EXPLOSIONQUAD 70 // [vector] origin
#define DPTE_SMALLFLASH 72 // [vector] origin
#define DPTE_CUSTOMFLASH 73
#define DPTE_FLAMEJET 74
#define DPTE_PLASMABURN 75

View file

@ -56,6 +56,27 @@ int ppl_specular_shader_texf;
//#define glBegin glEnd
qboolean PPL_ShouldDraw(void)
{
if (r_inmirror)
{
if (currententity->flags & Q2RF_WEAPONMODEL)
return false;
}
else
{
if (currententity->flags & Q2RF_EXTERNALMODEL)
return false;
if (currententity->keynum == (cl.viewentity[r_refdef.currentplayernum]?cl.viewentity[r_refdef.currentplayernum]:(cl.playernum[r_refdef.currentplayernum]+1)))
return false;
// if (cl.viewentity[r_refdef.currentplayernum] && currententity->keynum == cl.viewentity[r_refdef.currentplayernum])
// continue;
if (!Cam_DrawPlayer(0, currententity->keynum-1))
return false;
}
return true;
}
typedef struct shadowmesh_s {
int numindicies;
@ -1741,22 +1762,8 @@ void PPL_BaseEntTextures(void)
{
currententity = &cl_visedicts[i];
if (r_inmirror)
{
if (currententity->flags & Q2RF_WEAPONMODEL)
continue;
}
else
{
if (currententity->flags & Q2RF_EXTERNALMODEL)
continue;
if (currententity->keynum == (cl.viewentity[r_refdef.currentplayernum]?cl.viewentity[r_refdef.currentplayernum]:(cl.playernum[r_refdef.currentplayernum]+1)))
continue;
// if (cl.viewentity[r_refdef.currentplayernum] && currententity->keynum == cl.viewentity[r_refdef.currentplayernum])
// continue;
if (!Cam_DrawPlayer(0, currententity->keynum-1))
continue;
}
if (!PPL_ShouldDraw())
continue;
if (currententity->flags & Q2RF_BEAM)
{
@ -2464,6 +2471,8 @@ void PPL_DrawEntLighting(dlight_t *light, vec3_t colour)
{
currententity = &cl_visedicts[i];
if (!PPL_ShouldDraw())
continue;
if (r_inmirror)
{
if (currententity->flags & Q2RF_WEAPONMODEL)

View file

@ -4112,7 +4112,6 @@ rendererinfo_t d3drendererinfo = {
GLR_RenderView,
GLR_InitSky,
GLR_CheckSky,
GLR_SetSky,

View file

@ -221,7 +221,7 @@ void NPP_NQCheckDest(int dest)
{
if (dest == MSG_ONE)
{
/* client_t *cl = Write_GetClient();
client_t *cl = Write_GetClient();
if (!cl)
{
Con_Printf("Not a client\n");
@ -233,7 +233,7 @@ void NPP_NQCheckDest(int dest)
NPP_NQFlush();
}
cldest = cl;
*/
}
else
{
@ -1026,6 +1026,9 @@ void NPP_QWWriteByte(int dest, qbyte data) //replacement write func (nq to qw)
case svc_updatestatlong:
protocollen = 6;
break;
case svc_setpause:
protocollen = 2;
break;
default:
Con_Printf("QWWriteByte: bad protocol %i\n", (int)data);
protocollen = sizeof(buffer);

View file

@ -6125,8 +6125,11 @@ lh_extension_t QSG_Extensions[] = {
// {"TQ_RAILTRAIL"}, //treat this as the ZQ style railtrails which the client already supports, okay so the preparse stuff needs strengthening.
{"ZQ_MOVETYPE_FLY"},
{"ZQ_MOVETYPE_NOCLIP"},
{"ZQ_MOVETYPE_NONE"}
// {"ZQ_QC_PARTICLE"} //particle builtin works in QW ( we don't mimic ZQ fully though)
{"ZQ_MOVETYPE_NONE"},
// {"ZQ_QC_PARTICLE"}, //particle builtin works in QW ( we don't mimic ZQ fully though)
{"ZQ_QC_STRINGS", 11, NULL, {"stof", "strlen","strcat","substring","stov","strzone","strunzone"}}
};
//some of these are overkill yes, but they are all derived from the fteextensions flags and document the underlaying protocol available.
@ -6378,7 +6381,7 @@ string substr(string str, float start, float len)
void PF_substr (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
char *dest = PF_TempStr(prinst);
char *dest;
char *s;
int start, len, l;
@ -6387,11 +6390,12 @@ void PF_substr (progfuncs_t *prinst, struct globalvars_s *pr_globals)
len = (int) G_FLOAT(OFS_PARM2);
l = strlen(s);
if (start >= l || !len || !*s)
if (start >= l || len<=0 || !*s)
{
RETURN_TSTRING("");
return;
}
dest = PF_TempStr(prinst);
s += start;
l -= start;
@ -6984,7 +6988,7 @@ void PF_FindFlags (progfuncs_t *prinst, struct globalvars_s *pr_globals)
//EXTENSION: DP_QC_RANDOMVEC
//vector() randomvec = #91
void PF_randomvec (progfuncs_t *prinst, struct globalvars_s *pr_globals)
void PF_randomvector (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
vec3_t temp;
do
@ -7696,6 +7700,16 @@ void PF_te_gunshot(progfuncs_t *prinst, struct globalvars_s *pr_globals)
count = 1;
SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_GUNSHOT, count);
}
//DP_TE_QUADEFFECTS1
void PF_te_gunshotquad(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
int count;
if (*svprogfuncs->callargc >= 2)
count = G_FLOAT(OFS_PARM1);
else
count = 1;
SV_point_tempentity(G_VECTOR(OFS_PARM0), DPTE_GUNSHOTQUAD, count);
}
//DP_TE_STANDARDEFFECTBUILTINS
//void(vector org) te_spike = #419;
@ -7704,6 +7718,12 @@ void PF_te_spike(progfuncs_t *prinst, struct globalvars_s *pr_globals)
SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_SPIKE, 1);
}
//DP_TE_QUADEFFECTS1
void PF_te_spikequad(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
SV_point_tempentity(G_VECTOR(OFS_PARM0), DPTE_SPIKEQUAD, 1);
}
void PF_te_lightningblood(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_LIGHTNINGBLOOD, 1);
@ -7715,6 +7735,11 @@ void PF_te_superspike(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_SUPERSPIKE, 1);
}
//DP_TE_QUADEFFECTS1
void PF_te_superspikequad(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
SV_point_tempentity(G_VECTOR(OFS_PARM0), DPTE_SUPERSPIKEQUAD, 1);
}
//DP_TE_STANDARDEFFECTBUILTINS
//void(vector org) te_explosion = #421;
@ -7722,6 +7747,11 @@ void PF_te_explosion(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
SV_point_tempentity(G_VECTOR(OFS_PARM0), TE_EXPLOSION, 1);
}
//DP_TE_QUADEFFECTS1
void PF_te_explosionquad(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
SV_point_tempentity(G_VECTOR(OFS_PARM0), DPTE_EXPLOSIONQUAD, 1);
}
//DP_TE_STANDARDEFFECTBUILTINS
//void(vector org) te_tarexplosion = #422;
@ -8693,8 +8723,7 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
{"tracebox", PF_traceboxdp, 0, 0, 0, 90},
{"randomvec", PF_randomvec, 0, 0, 0, 91},
{"randomvec", PF_randomvector, 0, 0, 0, 91},
{"registercvar", PF_registercvar, 0, 0, 0, 93},
{"min", PF_min, 0, 0, 0, 94},// #94 float(float a, floats) min (DP_QC_MINMAXBOUND)
{"max", PF_max, 0, 0, 0, 95}, // #95 float(float a, floats) max (DP_QC_MINMAXBOUND)
@ -8814,6 +8843,11 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
{"te_particlecube", PF_te_particlecube, 0, 0, 0, 408},// #408 void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube (DP_TE_PARTICLECUBE)
//DP_TE_SPARK
{"te_spark", PF_te_spark, 0, 0, 0, 411},// #411 void(vector org, vector vel, float howmany) te_spark (DP_TE_SPARK)
//DP_TE_QUADEFFECTS1
{"te_gunshotquad", PF_te_gunshotquad, 0, 0, 0, 412},// #412 void(vector org) te_gunshotquad (DP_TE_QUADEFFECTS1)
{"te_spikequad", PF_te_spikequad, 0, 0, 0, 413},// #413 void(vector org) te_spikequad (DP_TE_QUADEFFECTS1)
{"te_superspikequad",PF_te_superspikequad, 0, 0, 0, 414},// #414 void(vector org) te_superspikequad (DP_TE_QUADEFFECTS1)
{"te_explosionquad",PF_te_explosionquad,0, 0, 0, 415},// #415 void(vector org) te_explosionquad (DP_TE_QUADEFFECTS1)
//DP_TE_SMALLFLASH
{"te_smallflash", PF_te_smallflash, 0, 0, 0, 416},// #416 void(vector org) te_smallflash (DP_TE_SMALLFLASH)
//DP_TE_CUSTOMFLASH

View file

@ -2405,13 +2405,13 @@ void SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg, qboolean ignore
#ifdef PEXT_SCALE
state->scale = clent->v->scale*16;
if (!clent->v->scale)
clent->v->scale = 1*16;
if (!state->scale)
state->scale = 1*16;
#endif
#ifdef PEXT_TRANS
state->trans = clent->v->alpha*255;
if (!clent->v->alpha)
clent->v->alpha = 255;
if (!state->trans)
state->trans = 255;
#endif
#ifdef PEXT_FATNESS
state->fatness = clent->v->fatness*2;
@ -2656,7 +2656,7 @@ void SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg, qboolean ignore
state->modelindex = SV_ModelIndex(modname);
}
}
if (progstype == PROG_H2 && ent->v->solid == SOLID_BSP)
if (/*progstype == PROG_H2 &&*/ ent->v->solid == SOLID_BSP)
state->angles[0]*=-1;
if (state->effects & EF_FULLBRIGHT)