The thing is, it could be possible that it sends yo to a weapon that has no ammo. So, I also want to check if there is enough ammo and, if not, change to another weapon instead.
To do this, I am using A_JumpIfInventory
Code: Select all
Fire: TELS A 0 A_JumpIfInventory("NJPistol", 1, "ChangeToNJPistol") //fallthrough ChangeToNJFist: TELS A 1 A_SelectWeapon ("NJFist") Goto Deselect ChangeToNJPistol: TELS A 0 A_JumpIfInventory("NJPistolClip", 0, "ChangeToNJFist") TELS A 1 A_SelectWeapon ("NJPistol") Goto Deselect
Of course, the absolutely best option would be if I could set something up that changes to the highest priority weapon currently in the player's inventory, provided that it has ammo (i.e. what Doom normally does when you run out of ammo for the currently readied weapon).
So, can anyone help out here?