torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5;
grav = PHYS_GRAVITY(NULL);
- if(pushed_entity && PHYS_ENTGRAVITY(pushed_entity))
- grav *= PHYS_ENTGRAVITY(pushed_entity);
+ if(pushed_entity && pushed_entity.gravity)
+ grav *= pushed_entity.gravity;
zdist = torg.z - org.z;
sdist = vlen(torg - org - zdist * '0 0 1');
return false;
vector org = targ.origin;
-#ifdef SVQC
- if(autocvar_sv_vq3compat)
-#elif defined(CSQC)
- if(STAT(VQ3COMPAT))
-#endif
+
+ if(STAT(Q3COMPAT))
{
org.z += targ.mins_z;
org.z += 1; // off by 1!
// reset tracking of oldvelocity for impact damage (sudden velocity changes)
targ.oldvelocity = targ.velocity;
- if(this.pushltime < time) // prevent "snorring" sound when a player hits the jumppad more than once
+ // prevent sound spam when a player hits the jumppad more than once
+ // or when a dead player gets stuck in the jumppad for some reason
+ if(this.pushltime < time && !(IS_DEAD(targ) && targ.velocity == '0 0 0'))
{
// flash when activated
Send_Effect(EFFECT_JUMPPAD, targ.origin, targ.velocity, 1);
{
vector org = trigger_push_get_start_point(this);
- entity e = spawn();
- setsize(e, PL_MIN_CONST, PL_MAX_CONST);
- e.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
float grav = PHYS_GRAVITY(NULL);
- if (e && PHYS_ENTGRAVITY(e))
- grav *= PHYS_ENTGRAVITY(e);
entity t = this.enemy;
if (t)
{
+ entity e = spawn();
+ setsize(e, PL_MIN_CONST, PL_MAX_CONST);
+ e.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
vector v = trigger_push_calculatevelocity(org, t, this.height, e);
vector v2 = trigger_push_calculatevelocity(endpos, t, this.height, e);
+ delete(e);
return (v.z + v2.z) / grav;
}
else if (!(this.target && this.target != ""))
WriteByte(MSG_ENTITY, this.active);
WriteCoord(MSG_ENTITY, this.height);
- WriteVector(MSG_ENTITY, this.movedir);
-
trigger_common_write(this, true);
return true;
WriteString(MSG_ENTITY, this.targetname);
WriteVector(MSG_ENTITY, this.origin);
- WriteAngle(MSG_ENTITY, this.angles_x);
- WriteAngle(MSG_ENTITY, this.angles_y);
- WriteAngle(MSG_ENTITY, this.angles_z);
+ WriteAngleVector(MSG_ENTITY, this.angles);
return true;
}
NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH, bool isnew)
{
- this.classname = "jumppad";
- int mytm = ReadByte();
- if(mytm)
- {
- this.team = mytm - 1;
- }
+ int mytm = ReadByte(); if(mytm) { this.team = mytm - 1; }
this.spawnflags = ReadInt24_t();
this.active = ReadByte();
this.height = ReadCoord();
- this.movedir = ReadVector();
-
trigger_common_read(this, true);
this.entremove = trigger_remove_generic;
NET_HANDLE(ENT_CLIENT_TARGET_PUSH, bool isnew)
{
- this.classname = "push_target";
this.cnt = ReadByte();
this.targetname = strzone(ReadString());
this.origin = ReadVector();
- this.angles_x = ReadAngle();
- this.angles_y = ReadAngle();
- this.angles_z = ReadAngle();
+ this.angles = ReadAngleVector();
return = true;