Talking about this: https://github.com/coelckers/gzdoom/blo ... il.zs#L290
It'd be nice and useful if you could control how an item is dropped. For a very basic example, one may want to instantly place a dropped item in front of the player instead of what it does now. The only workaround to this is to spawn an entirely new item using A_SpawnItemEx and remove the one in the inventory, which could probably work for simpler items, but sometimes they may have variables that should not be lost, and transferring all those adds more complexity to the workaround.
Make DropInventory virtual
Moderator: GZDoom Developers
-
- Posts: 4949
- Joined: Sun Nov 14, 2010 12:59 am
Re: Make DropInventory virtual
What prevents you from overriding [wiki]OnDrop[/wiki]?
Re: Make DropInventory virtual
Nothing, really. Now that I look at it, OnDrop is called by DropInventory, so I could definitely override the item's movement in that. Looks good to me! Thanks, Blue Shadow! I can't think of another reason to override DropInventory at the moment.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Make DropInventory virtual
The reason this was never made virtual is that DropInventory is a member of the player class, normally you want to alter drop behavior based on the item, not the dropper. And there OnDrop makes more sense.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Make DropInventory virtual
.......
I've been doing crazy crap with CreateTossable overrides this whole time for nothin' lol
Thanks to the OP for asking this, maybe I can clean up some of this code now (later)...
I've been doing crazy crap with CreateTossable overrides this whole time for nothin' lol
Thanks to the OP for asking this, maybe I can clean up some of this code now (later)...
Re: Make DropInventory virtual
Same, been doing it via CreateTossable for the longest time. Heh, time to go back and edit a lot of stuff...