]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Always draw ladders (reduces amount of bandwidth wasted when player enters & leaves...
authorMario <mario@smbclan.net>
Tue, 1 Dec 2015 16:30:25 +0000 (02:30 +1000)
committerMario <mario@smbclan.net>
Tue, 1 Dec 2015 16:30:25 +0000 (02:30 +1000)
qcsrc/common/triggers/func/ladder.qc
qcsrc/common/triggers/trigger/impulse.qc
qcsrc/common/triggers/trigger/jumppads.qc

index df4cb4453f3254ee4654e263fc2441a6a1556324..edba032336ee45017104a46bb0a801f225b2ecde 100644 (file)
@@ -76,6 +76,7 @@ void func_ladder_init()
        else
                setsize(self, self.mins, self.maxs);
        self.touch = func_ladder_touch;
+       BITSET_ASSIGN(self.effects, EF_NODEPTHTEST);
 
        func_ladder_link();
 }
index e8d85a013f3b4fee7c97d3ebbbc0f2935539bc8b..abb40563ec33c672e29a895ba5d5f499bcd8c0f0 100644 (file)
@@ -24,7 +24,7 @@ void trigger_impulse_touch1()
 #ifdef SVQC
        str = min(self.radius, vlen(self.origin - other.origin));
 #elif defined(CSQC)
-       str = min(self.radius, vlen(self.move_origin - other.move_origin));
+       str = min(self.radius, vlen(self.origin - other.move_origin));
 #endif
 
        if(self.falloff == 1)
@@ -49,11 +49,11 @@ void trigger_impulse_touch1()
                        other.velocity += accelspeed * normalize(targ.origin - self.origin);
                }
 #elif defined(CSQC)
-               float addspeed = str - other.move_velocity * normalize(targ.move_origin - self.move_origin);
+               float addspeed = str - other.move_velocity * normalize(targ.origin - self.origin);
                if (addspeed > 0)
                {
                        float accelspeed = min(8 * pushdeltatime * str, addspeed);
-                       other.move_velocity += accelspeed * normalize(targ.move_origin - self.move_origin);
+                       other.move_velocity += accelspeed * normalize(targ.origin - self.origin);
                }
 #endif
        }
@@ -61,11 +61,11 @@ void trigger_impulse_touch1()
 #ifdef SVQC
                other.velocity = other.velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;
 #elif defined(CSQC)
-               other.move_velocity = other.move_velocity + normalize(targ.move_origin - self.move_origin) * str * pushdeltatime;
+               other.move_velocity = other.move_velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;
 #endif
 
 #ifdef SVQC
-       other.flags &= ~FL_ONGROUND;
+       UNSET_ONGROUND(other);
 
        UpdateCSQCProjectile(other);
 #elif defined(CSQC)
@@ -125,7 +125,7 @@ void trigger_impulse_touch3()
 #ifdef SVQC
        str = min(self.radius, vlen(self.origin - other.origin));
 #elif defined(CSQC)
-       str = min(self.radius, vlen(self.move_origin - other.move_origin));
+       str = min(self.radius, vlen(self.origin - other.move_origin));
 #endif
 
        if(self.falloff == 1)
@@ -140,7 +140,7 @@ void trigger_impulse_touch3()
 
        UpdateCSQCProjectile(other);
 #elif defined(CSQC)
-       other.move_velocity = other.move_velocity + normalize(other.move_origin - self.move_origin) * str * pushdeltatime;
+       other.move_velocity = other.move_velocity + normalize(other.move_origin - self.origin) * str * pushdeltatime;
 #endif
 }
 
index 390bae206e381c18c6b429c1d5fc0be062581dd3..62d1d8eaded90017397eb824557f80231bd6b64d 100644 (file)
@@ -351,6 +351,7 @@ void trigger_push_updatelink()
 
 void trigger_push_link()
 {
+       BITSET_ASSIGN(self.effects, EF_NODEPTHTEST);
        Net_LinkEntity(self, false, 0, trigger_push_send);
 }
 #endif
@@ -401,11 +402,16 @@ bool target_push_send(entity this, entity to, float sf)
        WriteCoord(MSG_ENTITY, self.origin_y);
        WriteCoord(MSG_ENTITY, self.origin_z);
 
+       WriteAngle(MSG_ENTITY, self.angles_x);
+       WriteAngle(MSG_ENTITY, self.angles_y);
+       WriteAngle(MSG_ENTITY, self.angles_z);
+
        return true;
 }
 
 void target_push_link()
 {SELFPARAM();
+       BITSET_ASSIGN(self.effects, EF_NODEPTHTEST);
        Net_LinkEntity(self, false, 0, target_push_send);
        //self.SendFlags |= 1; // update
 }
@@ -469,6 +475,10 @@ NET_HANDLE(ENT_CLIENT_TARGET_PUSH, bool isnew)
        self.origin_y = ReadCoord();
        self.origin_z = ReadCoord();
 
+       self.angles_x = ReadAngle();
+       self.angles_y = ReadAngle();
+       self.angles_z = ReadAngle();
+
        return = true;
 
        setorigin(self, self.origin);