The code that crashes when firing the weapon without any ammo looks like this:
Code: Select all
Fire:
BG2G FGHIJ 1 A_RailAttack (25, 0, 1, "", "", 0, 10.0, "none", 0, 0, 8192, 50, 0.5, 2.0, "MiniPlasma")
Goto Ready
Currently, i'm using a workaround that looks like this:
Code: Select all
Fire:
BG2G E 1 A_JumpIfInventory ("Cell", 1, "Shoot")
BG2G E 1 A_PlaySound ("weapons/bfg10kcool")
Goto Ready
Shoot:
BG2G FGHIJ 1 A_RailAttack (25, 0, 1, "", "", 0, 10.0, "none", 0, 0, 8192, 50, 0.5, 2.0, "MiniPlasma")
BG2G E 1 A_TakeInventory ("Cell", 5) //weapon consumes no ammo normally
Goto Ready