]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/throwing.qc
Use think accessors
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / throwing.qc
index 43285fb6a32c74e5dbe588026aa9c405069f16a0..f1977c8f0c0ddf3ddb958900d8a5dbc1cda2a5e9 100644 (file)
 
 void thrown_wep_think()
 {SELFPARAM();
-       self.nextthink = time;
-       if(self.oldorigin != self.origin)
+       this.nextthink = time;
+       if(this.oldorigin != this.origin)
        {
-               self.SendFlags |= ISF_LOCATION;
-               self.oldorigin = self.origin;
+               this.SendFlags |= ISF_LOCATION;
+               this.oldorigin = this.origin;
        }
-       self.owner = world;
-       float timeleft = self.savenextthink - time;
+       this.owner = world;
+       float timeleft = this.savenextthink - time;
        if(timeleft > 1)
-               SUB_SetFade(self, self.savenextthink - 1, 1);
+               SUB_SetFade(this, this.savenextthink - 1, 1);
        else if(timeleft > 0)
-               SUB_SetFade(self, time, timeleft);
+               SUB_SetFade(this, time, timeleft);
        else
-               SUB_VanishOrRemove(self);
+               SUB_VanishOrRemove(this);
 }
 
 // returns amount of ammo used as string, or -1 for failure, or 0 for no ammo count
@@ -80,7 +80,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
        if(startitem_failed)
                return string_null;
        wep.glowmod = weaponentity_glowmod(info, own.clientcolors);
-       wep.think = thrown_wep_think;
+       setthink(wep, thrown_wep_think);
        wep.savenextthink = wep.nextthink;
        wep.nextthink = min(wep.nextthink, time + 0.5);
        wep.pickup_anyway = true; // these are ALWAYS pickable