]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix an issue with Arc beam being canceled prematurely, start work on arc
authorSamual Lenks <samual@xonotic.org>
Wed, 8 Jan 2014 17:50:34 +0000 (12:50 -0500)
committerSamual Lenks <samual@xonotic.org>
Wed, 8 Jan 2014 17:50:34 +0000 (12:50 -0500)
qcsrc/common/weapons/w_arc.qc
qcsrc/server/cl_client.qc

index 5917826be5d00ec2af866ac6fcfb54d3eb28ae9c..90d3fe3ffdd117abf1e837e4740e9ee01a2a67b0 100644 (file)
@@ -46,7 +46,7 @@ void ArcInit();
 #endif
 #else
 #ifdef SVQC
-void spawnfunc_weapon_arc() { weapon_defaultspawnfunc(WEP_ARC); }
+void spawnfunc_weapon_arc(void) { weapon_defaultspawnfunc(WEP_ARC); }
 
 float W_Arc_Beam_Send(entity to, float sf)
 {
@@ -75,19 +75,22 @@ float W_Arc_Beam_Send(entity to, float sf)
        return TRUE;
 }
 
-void W_Arc_Beam_Think()
+void W_Arc_Beam_Think(void)
 {
+       print("W_Arc_Beam_Think();\n");
        self.owner.lg_fire_prev = time;
        if (self != self.owner.arc_beam)
        {
                remove(self);
+               print("W_Arc_Beam_Think(): EXPIRING BEAM #1\n");
                return;
        }
-       if (self.owner.weaponentity.state != WS_INUSE || (self.owner.WEP_AMMO(ARC) <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || self.owner.freezetag_frozen)
+       if ((self.owner.WEP_AMMO(ARC) <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || self.owner.freezetag_frozen)
        {
                if(self == self.owner.arc_beam)
                        self.owner.arc_beam = world;
                remove(self);
+               print("W_Arc_Beam_Think(): EXPIRING BEAM #2\n");
                return;
        }
 
@@ -136,8 +139,9 @@ void W_Arc_Beam_Think()
 }
 
 // Attack functions ========================= 
-void W_Arc_Attack1 (void)
+void W_Arc_Beam(void)
 {
+       print("W_Arc_Beam();\n");
        // only play fire sound if 0.5 sec has passed since player let go the fire button
        if(time - self.lg_fire_prev > 0.5)
                sound (self, CH_WEAPON_A, "weapons/lgbeam_fire.wav", VOL_BASE, ATTN_NORM);
@@ -202,7 +206,7 @@ float W_Arc(float req)
                }
                case WR_THINK:
                {
-                       if (self.BUTTON_ATCK)
+                       if(self.BUTTON_ATCK)
                        {
                                if(self.BUTTON_ATCK_prev) // TODO: Find another way to implement this!
                                        /*if(self.animstate_startframe == self.anim_shoot_x && self.animstate_numframes == self.anim_shoot_y)
@@ -210,10 +214,10 @@ float W_Arc(float req)
                                        else*/
                                                weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(arc, animtime), w_ready);
                                
-                               if (weapon_prepareattack(0, 0))
+                               if(weapon_prepareattack(0, 0))
                                {
                                        if ((!self.arc_beam) || wasfreed(self.arc_beam))
-                                               W_Arc_Attack1();
+                                               W_Arc_Beam();
                                        
                                        if(!self.BUTTON_ATCK_prev)
                                        {
index b858dd58cd6f7f5cbab0a55bdc5f82f896b3dae0..5547b13df326d8ee79d17654993a9f423f0ab28d 100644 (file)
@@ -2474,6 +2474,7 @@ void PlayerPreThink (void)
 
        target_voicescript_next(self);
 
+       // WEAPONTODO: Move into weaponsystem somehow
        // if a player goes unarmed after holding a loaded weapon, empty his clip size and remove the crosshair ammo ring
        if(!self.weapon)
                self.clip_load = self.clip_size = 0;