Make DropInventory virtual

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Make DropInventory virtual

Re: Make DropInventory virtual

by Nash » Thu Jun 20, 2019 2:02 pm

Same, been doing it via CreateTossable for the longest time. Heh, time to go back and edit a lot of stuff...

Re: Make DropInventory virtual

by Matt » Thu Jun 20, 2019 2:00 pm

.......

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

by Graf Zahl » Thu Jun 20, 2019 4:19 am

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.

Re: Make DropInventory virtual

by Guest » Thu Jun 20, 2019 3:48 am

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.

Re: Make DropInventory virtual

by Blue Shadow » Thu Jun 20, 2019 3:33 am

What prevents you from overriding [wiki]OnDrop[/wiki]?

Make DropInventory virtual

by Guest » Thu Jun 20, 2019 2:46 am

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.

Top