Added ExtraDepletionBehavior for Inventory items

Moderator: GZDoom Developers

XLightningStormL
Posts: 394
Joined: Mon May 09, 2016 1:38 am
Location: Anywhere but here

Added ExtraDepletionBehavior for Inventory items

Post by XLightningStormL »

Pull request

This pull request adds the ExtraDepletionBehavior virtual void for TakeInventory, and UseInventory (theoretically SetInventory and anything else that depends on those functions - not tested by me) that enables additional code to be ran for stuff like weight systems without bloating true item use code with additional variables - essentially a dynamic system would be available instead. This system does work from private testing (though it's on a branch of a big project I'm working on so I'm not revealing any of that)

Currently the only "issue" I know of yet is that this function is only called if the item in the inventory is above 0 (to prevent potential from address 0 crashes); though REALLY you should be using DetachFromOwner for that instead.
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Added ExtraDepletionBehavior for Inventory items

Post by Nash »

XLightningStormL
Posts: 394
Joined: Mon May 09, 2016 1:38 am
Location: Anywhere but here

Re: Added ExtraDepletionBehavior for Inventory items

Post by XLightningStormL »

Return to “Closed Feature Suggestions [GZDoom]”