diff --git a/language.txt b/language.txt index 1008c29..b62fc89 100644 --- a/language.txt +++ b/language.txt @@ -160,6 +160,8 @@ M_LCLIP = "L Clip"; M_RCLIP = "R Clip"; M_NAME = "Name"; M_HEALTH = "Health"; +M_NOAMMO = "%s has no ammo."; +M_NOAMMO2 = "%s have no ammo."; /* Menus */ FLAK_BTOP1 = "Standard"; FLAK_BTOP2 = "Beta"; @@ -383,6 +385,8 @@ M_LCLIP = "Cargador Izq."; M_RCLIP = "Cargador Dch."; M_NAME = "Nombre"; M_HEALTH = "Salud"; +M_NOAMMO = "%s no tiene munición."; +M_NOAMMO2 = "%s no tienen munición."; /* Menus */ FLAK_BTOP1 = "Estándar"; FLAK_BTOP2 = "Beta"; diff --git a/zscript/utcommon.zsc b/zscript/utcommon.zsc index 15bfbe8..71f328b 100644 --- a/zscript/utcommon.zsc +++ b/zscript/utcommon.zsc @@ -1288,6 +1288,7 @@ Class UTWeapon : Weapon { int DropAmmo; bool bExtraPickup; + transient int lastnoammotic; Property DropAmmo: DropAmmo; @@ -1435,6 +1436,17 @@ Class UTWeapon : Weapon roll = 0; } + override bool CheckAmmo( int fireMode, bool autoSwitch, bool requireAmmo, int ammocount ) + { + bool rslt = Super.CheckAmmo(fireMode,autoSwitch,requireAmmo,ammocount); + if ( (gametic > lastnoammotic) && !rslt && !autoSwitch && !requireAmmo && Owner.CheckLocalView() ) + { + lastnoammotic = gametic; + Console.Printf(StringTable.Localize((Amount>1)?"$M_NOAMMO2":"$M_NOAMMO"),GetTag()); + } + return rslt; + } + Default { Weapon.BobStyle "Smooth";