[2.8.0] Crash on "bad" item pickup

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

[2.8.0] Crash on "bad" item pickup

Post by _mental_ »

There is no check for actual type in A_GiveInventory() and bunch of related functions. The following code will lead to a crash when player will try to pickup an item.
Spoiler: Example of 'give non-inventory actor' issue
You can try it yourself using the attached file. Launch with this command line zdoom -iwad doom -file inventory_crash.wad +map e1m1 +summon a and go forward.

EDIT:
It's worth noting that scripting doesn't have this issue as actor inheritance is checked and an error is printed to console.
That's why I made a pull request with the fix to maint instead of master branch.
Also, I added no error message as it will be printed on every frame (not just once like in scripting) flooding the log quickly.
Attachments
inventory_crash.wad
(202 Bytes) Downloaded 25 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [2.8.0] Crash on "bad" item pickup

Post by Graf Zahl »

Just for confirmation: Master prints an error message but doesn't abort.
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: [2.8.0] Crash on "bad" item pickup

Post by _mental_ »

Master ignores the pickup state in the given example. With the exception of the error message my change makes both versions work the same.
Post Reply

Return to “Closed Bugs [GZDoom]”