]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/weaponsystem.qc
Transifex autosync
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / weaponsystem.qc
index dc2ed5dfedc3548564ec11cebc8c28a4fd27f33b..9a4392ae3ec7fe668479b9d546b2e9bc3a229632 100644 (file)
@@ -1,23 +1,29 @@
 #include "weaponsystem.qh"
 
-#include "selection.qh"
-
-#include "../command/common.qh"
-#include <server/mutators/_mod.qh>
-#include "../round_handler.qh"
-#include <server/cheats.qh>
-#include <server/resources.qh>
-#include <common/items.qh>
 #include <common/animdecide.qh>
 #include <common/constants.qh>
-#include <common/net_linked.qh>
+#include <common/items/_mod.qh>
+#include <common/mapobjects/platforms.qh>
 #include <common/monsters/_mod.qh>
+#include <common/net_linked.qh>
 #include <common/notifications/all.qh>
+#include <common/state.qh>
 #include <common/util.qh>
+#include <common/vehicles/all.qh>
 #include <common/weapons/_all.qh>
-#include <common/state.qh>
-#include <lib/csqcmodel/sv_model.qh>
 #include <common/wepent.qh>
+#include <lib/csqcmodel/sv_model.qh>
+#include <server/cheats.qh>
+#include <server/client.qh>
+#include <server/command/common.qh>
+#include <server/damage.qh>
+#include <server/items/items.qh>
+#include <server/hook.qh>
+#include <server/mutators/_mod.qh>
+#include <server/resources.qh>
+#include <server/round_handler.qh>
+#include <server/weapons/selection.qh>
+#include <server/world.qh>
 
 .int state;
 
@@ -26,8 +32,8 @@
 float W_WeaponRateFactor(entity this)
 {
        float t = 1;
-       if(g_weaponratefactor > 0)
-               t = 1.0 / g_weaponratefactor;
+       if(autocvar_g_weaponratefactor > 0)
+               t = 1.0 / autocvar_g_weaponratefactor;
 
        MUTATOR_CALLHOOK(WeaponRateFactor, t, this);
        t = M_ARGV(0, float);
@@ -37,7 +43,7 @@ float W_WeaponRateFactor(entity this)
 
 float W_WeaponSpeedFactor(entity this)
 {
-       float t = 1.0 * g_weaponspeedfactor;
+       float t = 1.0 * autocvar_g_weaponspeedfactor;
 
        MUTATOR_CALLHOOK(WeaponSpeedFactor, t, this);
        t = M_ARGV(0, float);
@@ -404,7 +410,7 @@ void weapon_thinkf(entity actor, .entity weaponentity, WFRAME fr, float t, void(
        {
                FOREACH_CLIENT(true, {
                        if(it == actor || (IS_SPEC(it) && it.enemy == actor))
-                               wframe_send(it, this, fr, g_weaponratefactor, restartanim);
+                               wframe_send(it, this, fr, autocvar_g_weaponratefactor, restartanim);
                });
        }
 
@@ -503,6 +509,7 @@ void W_WeaponFrame(Player actor, .entity weaponentity)
                        this.m_switchweapon = WEP_Null;
                        this.state = WS_CLEAR;
                        this.weaponname = "";
+                       this.clip_load = this.clip_size = this.old_clip_load = 0;
                        return;
                }
        }
@@ -515,6 +522,7 @@ void W_WeaponFrame(Player actor, .entity weaponentity)
                this.m_switchingweapon = WEP_Null;
                this.state = WS_CLEAR;
                this.weaponname = "";
+               this.clip_load = this.clip_size = this.old_clip_load = 0;
                return;
        }
 
@@ -596,7 +604,8 @@ void W_WeaponFrame(Player actor, .entity weaponentity)
        {
                if (w != WEP_Null && !(STAT(WEAPONS, actor) & WepSet_FromWeapon(w)))
                {
-                       if (this.m_weapon == this.m_switchweapon) W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
+                       if (this.m_weapon == this.m_switchweapon)
+                               W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
                        w = WEP_Null;
                }
 
@@ -652,8 +661,7 @@ void W_WeaponFrame(Player actor, .entity weaponentity)
                                v_right = ri;
                                v_up = up;
                                Weapon wpn = this.m_weapon;
-                               this.weapon_think(wpn, actor, weaponentity,
-                                       button_atck | (button_atck2 << 1));
+                               this.weapon_think(wpn, actor, weaponentity, button_atck | (button_atck2 << 1));
                        }
                        else
                        {