...may not activate in a certain case.
When two identical items with +INVENTORY.AUTOACTIVATE and Inventory.MaxAmount > 0 are spawned at the exact same location, only one item will actually auto-activate. The other item will just disappear and be wasted. However, it doesn't happen if MaxAmount is set to 0.
The reason for this is that there is special logic which handles auto-activation of items with MaxAmount == 0, but if the latter is not the case, then normal logic is used, which calls HandlePickup to see if any item in the player's inventory can handle the pickup, and that's where auto-activation will fail.
So, if the item class has MaxAmount == 0, then the third branch
of TryPickup will execute for both items and none of the items will go to the player's inventory. However, if MaxAmount > 0, then the second branch
will execute for the first item. The item will be added to the player's inventory, where its auto-activation flag will be checked and processed. However, the item will not disappear from the player's inventory for long enough so that picking up the next item will trigger the first branch
because CallHandlePickup will return true. Since neither HandlePickup nor TryPickup process auto-activation in this case, the second item will simply disappear without doing anything useful.
Attached to this post is an example to demonstrate this behavior. Go to any map, open the console and type "summon TestInv" two times. Each TestInv is supposed to give the player one health point, but you will only get one. Note that spawning more than two items will usually give more health points than one, but always less than they were actually supposed to give. Now edit the example and uncomment "Inventory.MaxAmount 0", then repeat the testing procedure. You will now correctly get two health points for two spawned items.
Tested in: GZDoom 3.6.0, g3.7pre-9-g4ac43dac3
You do not have the required permissions to view the files attached to this post.