]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/impulse.qc
Merge branch 'master' into Mario/vehicles
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / impulse.qc
index 89ca2e03d6fdc1911d47e722550dd18f031b3346..7b8ebcfde91e67627c4ca76b6494441d87fc59a5 100644 (file)
@@ -35,7 +35,17 @@ void trigger_impulse_touch1()
        other.lastpushtime = time;
        if(!pushdeltatime) return;
 
-       other.velocity = other.velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;
+       if(self.spawnflags & 64)
+       {
+               float addspeed = str - other.velocity * normalize(targ.origin - self.origin);
+               if (addspeed > 0)
+               {
+                       float accelspeed = min(8 * pushdeltatime * str, addspeed);
+                       other.velocity += accelspeed * normalize(targ.origin - self.origin);
+               }
+       }
+       else
+               other.velocity = other.velocity + normalize(targ.origin - self.origin) * str * pushdeltatime;
        other.flags &= ~FL_ONGROUND;
 #ifdef SVQC
        UpdateCSQCProjectile(other);
@@ -137,7 +147,7 @@ bool trigger_impulse_send(entity to, int sf)
 
 void trigger_impulse_link()
 {
-       Net_LinkEntity(self, 0, false, trigger_impulse_send);
+       //Net_LinkEntity(self, 0, false, trigger_impulse_send);
 }
 
 void spawnfunc_trigger_impulse()