Can't catch an inventory drop with SpecialDropAction?

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.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Can't catch an inventory drop with SpecialDropAction?

Post by Sir Robin »

I want an inventry item to catch a drop call but not actually drop (it's a master that can't be dropped but when dropped it will drop a child item)
I thought SpecialDropAction would do that, but it never fires:

Code: Select all

class invTest : inventory
{
    default{+inventory.invbar;inventory.icon "UNKNA0";}
    states{spawn: UNKN A -1; stop;}

    override bool SpecialDropAction (Actor dropper)
    {
        console.printf(level.time..": "..GetCharacterName()..": Dropped");
        return true;
    }
}
Do I need to turn on a flag somewhere to get that to work or what? Or is there another way to do what I want?
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Can't catch an inventory drop with SpecialDropAction?

Post by Jarewill »

To me it looks like the function is bugged, perhaps report it to the devs.
In the meantime you can override CreateTossable instead:

Code: Select all

	Override Inventory CreateTossable(int amt){
		console.printf("A");
		Return null; //Don't drop anything
	}
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49220
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Can't catch an inventory drop with SpecialDropAction?

Post by Graf Zahl »

That's not what this function is for. What it does is to execute a special action that happens instead of dropping the item.
User avatar
Player701
 
 
Posts: 1707
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: Can't catch an inventory drop with SpecialDropAction?

Post by Player701 »

It looks like SpecialDropAction is only used by monster drops (e.g. A_DropItem).

Return to “Closed Bugs [GZDoom]”