]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_uzi.qc
Merge branch 'master' into mirceakitsune/universal_reload_system
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_uzi.qc
index eaa4442a2d05e115540a394996564ec7bd76da22..360c8913345dee4cca9b38adfb9a0b15573ab357 100644 (file)
@@ -3,6 +3,9 @@ REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT
 #else
 #ifdef SVQC
 
+// weapon load persistence, for weapons that support reloading
+.float uzi_load;
+
 void W_UZI_SetAmmoCounter()
 {
        // set clip_load to the weapon we have switched to, if the gun uses reloading
@@ -322,17 +325,6 @@ float w_uzi(float req)
                                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_first_refire, w_ready);
                        }
                }
-        if(self.wish_reload)
-        {
-            if(self.switchweapon == self.weapon)
-            {
-                if(self.weaponentity.state == WS_READY)
-                {
-                    self.wish_reload = 0;
-                    W_UZI_Reload();
-                }
-            }
-        }
        }
        else if (req == WR_PRECACHE)
        {
@@ -380,6 +372,11 @@ float w_uzi(float req)
                }
                return ammo_amount;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.uzi_load = autocvar_g_balance_uzi_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_UZI_Reload();
@@ -410,13 +407,13 @@ float w_uzi(float req)
                precache_sound("weapons/ric3.wav");
        }
        else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = "%s did the impossible";
+               w_deathtypestring = _("%s did the impossible");
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = "%s was sniped by %s";
+                       w_deathtypestring = _("%s was sniped by %s");
                else
-                       w_deathtypestring = "%s was riddled full of holes by %s";
+                       w_deathtypestring = _("%s was riddled full of holes by %s");
        }
        return TRUE;
 }