From 6c6ce41b7e4ba1f0ce0e19a2860fb25f87b83225 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 2 Sep 2009 02:35:20 +0000 Subject: [PATCH] - Fixed: A_JumpIf(InTarget)Inventory jumped if the check amount was greater than the item's max amount and the item was maxed. SVN r1783 (trunk) --- docs/rh-log.txt | 2 ++ src/thingdef/thingdef_codeptr.cpp | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 9dc48c875d..c8030b92bc 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,6 @@ September 1, 2009 +- Fixed: A_JumpIf(InTarget)Inventory jumped if the check amount was greater + than the item's max amount and the item was maxed. - Fixed: Some dmadds wads used zero-length sprites as placeholders. When you ran dmadds to combine it with the IWAD's sprites, they would be replaced by the IWAD's sprites, so when loading such wads, we should ignore those as diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index f10e961b96..83bd9bba24 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -506,12 +506,19 @@ void DoJumpIfInventory(AActor * owner, DECLARE_PARAMINFO) if (!Type || owner == NULL) return; - AInventory * Item=owner->FindInventory(Type); + AInventory *Item = owner->FindInventory(Type); if (Item) { - if (ItemAmount>0 && Item->Amount>=ItemAmount) ACTION_JUMP(JumpOffset); - else if (Item->Amount>=Item->MaxAmount) ACTION_JUMP(JumpOffset); + if (ItemAmount > 0) + { + if (Item->Amount >= ItemAmount) + ACTION_JUMP(JumpOffset); + } + else if (Item->Amount >= Item->MaxAmount) + { + ACTION_JUMP(JumpOffset); + } } }