]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/trigger/jumppads.qc
Use gender-neutral pronouns when referring to the player
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / jumppads.qc
index 2c160eae95e8a05e75f1ead2512b81c257716242..eee980618d8b2b47341963aeed3e34b54556ba6d 100644 (file)
@@ -69,7 +69,7 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht, entity p
                and ti.
         */
 
-       // push him so high...
+       // push them so high...
        vz = sqrt(fabs(2 * grav * jumpheight)); // NOTE: sqrt(positive)!
 
        // we start with downwards velocity only if it's a downjump and the jump apex should be outside the jump!
@@ -134,11 +134,8 @@ bool jumppad_push(entity this, entity targ)
                return false;
 
        vector org = targ.origin;
-#ifdef SVQC
-       if(autocvar_sv_q3defragcompat)
-#elif defined(CSQC)
-       if(STAT(Q3DEFRAGCOMPAT))
-#endif
+
+       if(STAT(Q3COMPAT))
        {
                org.z += targ.mins_z;
                org.z += 1; // off by 1!
@@ -192,7 +189,9 @@ bool jumppad_push(entity this, entity targ)
                // 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);
@@ -571,8 +570,6 @@ float trigger_push_send(entity this, entity to, float sf)
        WriteByte(MSG_ENTITY, this.active);
        WriteCoord(MSG_ENTITY, this.height);
 
-       WriteVector(MSG_ENTITY, this.movedir);
-
        trigger_common_write(this, true);
 
        return true;
@@ -636,9 +633,7 @@ bool target_push_send(entity this, entity to, float sf)
        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;
 }
@@ -694,18 +689,11 @@ spawnfunc(target_position)
 
 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;
@@ -725,14 +713,11 @@ void target_push_remove(entity this)
 
 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;