Steps to reproduce:unknownna wrote:I just tried it and it doesn't seem to change anything. I can still select both empty weapons. I also tested ZDoom 2.8.1 and you can also select both weapons there, so it might be a bug/side-effect inherited from the ZDoom behavior.Edward-san wrote:Does changing sv_dontcheckammo on/off change the behavior?unknownna wrote:I was testing some mods and got confused wondering why the client was able to switch over to weapons without any ammo despite having cl_noammoswitch set to false. I investigated the issue further and narrowed it down to cl_noammoswitch not working if the weapons have Weapon.AmmoUse1/2 set to 0 or if the weapons have an AltFire state present in the DECORATE code.
Although Weapon.AmmoUse 0 is technically like having infinite ammo, many mods don't seem to actually fire the weapon in the fire state unless the player has another ammo item present in the inventory.
pwo_ammotype_02.wad
1. zdoom -iwad doom2.wad -file pwo_ammotype_02.wad +map map01
2. Fire the chaingun, using up the ammo.
3. Notice how you can still cycle between your empty weapons despite not having any ammo.
Code: Select all
Actor Pistol_02 : Pistol
{
Weapon.SlotNumber 2
Weapon.AmmoUse1 0
Weapon.AmmoUse2 0
Weapon.AmmoType1 "Clip"
Weapon.AmmoType2 "Clip"
Tag "Pistol Weapon.AmmoUse1/2 0"
}
Actor Chaingun_02 : Chaingun
{
Weapon.SlotNumber 4
Tag "Chaingun AltFire State Present"
States
{
AltFire:
CHGG A 4 A_GiveInventory ("Clip", 1)
Goto Ready
}
}