]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_weaponsystem.qc
Merge remote-tracking branch 'origin/fruitiex/animations'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_weaponsystem.qc
index 9aae26e6afb2c7aa10d4fc0449901bde797cce64..b3b0e6ea06f6d81123acf8ebb0ce60d06412f4e0 100644 (file)
@@ -1297,6 +1297,12 @@ void weapon_thinkf(float fr, float t, void() func)
                        anim_z = anim_y / (t + sys_frametime);
                        setanim(self, anim, FALSE, TRUE, TRUE);
                }
+               else if (self.animstate_startframe == self.anim_idle_x) // only allow shoot anim to override idle animation until we have animation blending
+               {
+                       anim = self.anim_shoot;
+                       anim_z = anim_y / (t + sys_frametime);
+                       setanim(self, anim, FALSE, TRUE, TRUE);
+               }
        }
 };
 
@@ -1657,7 +1663,7 @@ void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload)
        if(ammo_reload)
        {
                self.clip_load -= ammo_use;
-               self.weapon_load[self.weapon] = self.clip_load;
+               self.(weapon_load[self.weapon]) = self.clip_load;
        }
        else
                self.(self.current_ammo) -= ammo_use;
@@ -1686,7 +1692,7 @@ void W_ReloadedAndReady()
                        self.(self.current_ammo) -= 1;
                }
        }
-       self.weapon_load[self.weapon] = self.clip_load;
+       self.(weapon_load[self.weapon]) = self.clip_load;
 
        // do not set ATTACK_FINISHED in reload code any more. This causes annoying delays if eg: You start reloading a weapon,
        // then quickly switch to another weapon and back. Reloading is canceled, but the reload delay is still there,
@@ -1769,5 +1775,5 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri
        if(self.clip_load < 0)
                self.clip_load = 0;
        self.old_clip_load = self.clip_load;
-       self.clip_load = self.weapon_load[self.weapon] = -1;
+       self.clip_load = self.(weapon_load[self.weapon]) = -1;
 }