]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/vehicle/raptor_weapons.qc
Merge branch 'master' into morphed/hagar
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / vehicle / raptor_weapons.qc
index 6783a92cc9a4aa1d128ded8cdb73572b3b30e337..175dbd0995348a055bd010518052f3506dc4e4dc 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef VEHICLE_RAPTOR_WEAPONS_H
 #define VEHICLE_RAPTOR_WEAPONS_H
 
-#include "../../weapons/all.qh"
+#include <common/weapons/all.qh>
 
 CLASS(RaptorCannon, PortoLaunch)
 /* flags     */ ATTRIB(RaptorCannon, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
@@ -106,7 +106,7 @@ float autocvar_g_vehicle_raptor_flare_chase;
 float autocvar_g_vehicle_raptor_flare_range;
 
 void raptor_flare_think();
-void raptor_flare_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
+void raptor_flare_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
 void raptor_flare_touch();
 
 METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
@@ -165,7 +165,7 @@ void raptor_bomb_burst()
     {
         self.nextthink = time;
         traceline(self.origin, self.origin + (normalize(self.velocity) * autocvar_g_vehicle_raptor_bomblet_alt), MOVE_NORMAL, self);
-        if((trace_fraction == 1.0) || (vlen(self.origin - self.owner.origin) < autocvar_g_vehicle_raptor_bomblet_radius))
+        if((trace_fraction == 1.0) || (vdist(self.origin - self.owner.origin, <, autocvar_g_vehicle_raptor_bomblet_radius)))
         {
             UpdateCSQCProjectile(self);
             return;
@@ -204,8 +204,10 @@ void raptor_bombdrop()
     bomb_1 = spawn();
     bomb_2 = spawn();
 
-    setorigin(bomb_1, gettaginfo(self, gettagindex(self, "bombmount_left")));
-    setorigin(bomb_2, gettaginfo(self, gettagindex(self, "bombmount_right")));
+    vector org = gettaginfo(self, gettagindex(self, "bombmount_left"));
+    setorigin(bomb_1, org);
+    org = gettaginfo(self, gettagindex(self, "bombmount_right"));
+    setorigin(bomb_2, org);
 
     bomb_1.movetype     = bomb_2.movetype   = MOVETYPE_BOUNCE;
     bomb_1.velocity     = bomb_2.velocity   = self.velocity;
@@ -235,11 +237,11 @@ void raptor_flare_touch()
     remove(self);
 }
 
-void raptor_flare_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-{SELFPARAM();
-    self.health -= damage;
-    if(self.health <= 0)
-        remove(self);
+void raptor_flare_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+    this.health -= damage;
+    if(this.health <= 0)
+        remove(this);
 }
 
 void raptor_flare_think()
@@ -249,7 +251,7 @@ void raptor_flare_think()
     while(_missile)
     {
         if(_missile.flags & FL_PROJECTILE)
-        if(vlen(self.origin - _missile.origin) < autocvar_g_vehicle_raptor_flare_range)
+        if(vdist(self.origin - _missile.origin, <, autocvar_g_vehicle_raptor_flare_range))
         if(random() > autocvar_g_vehicle_raptor_flare_chase)
             _missile.enemy = self;
         _missile = _missile.chain;
@@ -265,18 +267,18 @@ void raptor_flare_think()
 
 void RaptorCBShellfragDraw(entity this)
 {
-    if(wasfreed(self))
+    if(wasfreed(this))
         return;
 
-    Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
-    self.move_avelocity += randomvec() * 15;
-    self.renderflags = 0;
+    Movetype_Physics_MatchTicrate(this, autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
+    this.move_avelocity += randomvec() * 15;
+    this.renderflags = 0;
 
-    if(self.cnt < time)
-        self.alpha = bound(0, self.nextthink - time, 1);
+    if(this.cnt < time)
+        this.alpha = bound(0, this.nextthink - time, 1);
 
-    if(self.alpha < ALPHA_MIN_VISIBLE)
-        remove(self);
+    if(this.alpha < ALPHA_MIN_VISIBLE)
+        remove(this);
 }
 
 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)