fix ONE possible lgbeam breakage
authorRudolf Polzer <divverent@alientrap.org>
Tue, 12 Oct 2010 20:22:47 +0000 (22:22 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 12 Oct 2010 20:22:47 +0000 (22:22 +0200)
qcsrc/server/w_electro.qc

index ef0786403abc9787566847a873747e2e4d9b6a1f..4bee058f0fcff973d2d2173332b819559b8f91af 100644 (file)
@@ -216,11 +216,18 @@ float lgbeam_send(entity to, float sf)
 void lgbeam_think()
 {
        self.owner.prevlgfire = time;
-       if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self != self.owner.lgbeam || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK)
+       if (self != self.owner.lgbeam)
        {
                remove(self);
                return;
        }
+       if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK)
+       {
+               if(self == self.owner.lgbeam)
+                       self.owner.lgbeam = world;
+               remove(self);
+               return;
+       }
 
        self.nextthink = time;