]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix failgun force through warpzones
authorRudolf Polzer <divverent@alientrap.org>
Sun, 26 Dec 2010 21:24:53 +0000 (22:24 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 26 Dec 2010 21:24:53 +0000 (22:24 +0100)
qcsrc/server/w_common.qc
qcsrc/server/w_electro.qc

index 24f434044a9b466b816b8cc0244fcd6d7d88f17f..62d3dd80936697b612f5f02de61822757e91fec4 100644 (file)
@@ -23,6 +23,7 @@ void W_GiveWeapon (entity e, float wep, string name)
 }
 
 .float railgundistance;
+.vector railgunforce;
 void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype)
 {
        local vector hitloc, force, endpoint, dir;
@@ -67,6 +68,7 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
                trace_ent.railgunhitloc = end;
                trace_ent.railgunhitsolidbackup = trace_ent.solid;
                trace_ent.railgundistance = vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos) - start);
+               trace_ent.railgunforce = WarpZone_TransformVelocity(WarpZone_trace_transform, force);
 
                // stop if this is a wall
                if (trace_ent.solid == SOLID_BSP)
@@ -130,7 +132,7 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
 
                // apply the damage
                if (ent.takedamage)
-                       Damage (ent, self, self, bdamage * f, deathtype, hitloc, force * ffs);
+                       Damage (ent, self, self, bdamage * f, deathtype, hitloc, ent.railgunforce * ffs);
 
                // create a small explosion to throw gibs around (if applicable)
                //setorigin (explosion, hitloc);
index 1ae02b1613e47c5f1e7ba97a347688cd0a35b2ce..a25d266312fa8c28e870201926234ccdc1339b8e 100644 (file)
@@ -295,6 +295,7 @@ void W_Electro_Attack3 (void)
        entity beam, oldself;
 
        self.lgbeam = beam = spawn();
+       beam.classname = "lgbeam";
        beam.solid = SOLID_NOT;
        beam.think = lgbeam_think;
        beam.owner = self;