From bc206f21af342073fdb750ef57d45f77afdc40d5 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Tue, 10 Mar 2015 11:58:10 -0400 Subject: [PATCH] A_FireCustomMissile's useammo parameter should NOT use ammo if not called from a weapon --- src/thingdef/thingdef_codeptr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 4da9cea5f..0e5d44814 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1337,7 +1337,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireCustomMissile) AWeapon * weapon=player->ReadyWeapon; AActor *linetarget; - if (UseAmmo && weapon) + // Only use ammo if called from a weapon + if (UseAmmo && ACTION_CALL_FROM_WEAPON() && weapon) { if (!weapon->DepleteAmmo(weapon->bAltFire, true)) return; // out of ammo } @@ -5892,4 +5893,4 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetRipMax) ACTION_PARAM_START(1); ACTION_PARAM_INT(max, 1); self->RipLevelMax = max; -} \ No newline at end of file +}