IE it gives another one without checking if the player already has one.
https://github.com/coelckers/gzdoom/blo ... r.zs#L1837
I only noticed this while playing a mapset that utilizes ResetInventory in its MAPINFO by typing printinv right after finishing a map (was testing stuff) and seeing multiple BasicArmors being listed.
As I understand it, there should be only one "BasicArmor" in the inventory chain at any time.
Quick edit: was testing in 4.1.3
GiveDefaultInventory() always gives another BasicArmor
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.
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: GiveDefaultInventory() always gives another BasicArmor
This function was actually never meant to be called on a PlayerPawn with an initialized inventory. It really should clear the entire inventory before doing its stuff.
Re: GiveDefaultInventory() always gives another BasicArmor
Hmm. In that case maybe change ClearInventory() to DestroyAllInventory() here?
[EDIT]Nevermind. I think mental has the right approach.[/EDIT]
Again, I found out about this without any custom PlayerPawn actors.
[EDIT]Nevermind. I think mental has the right approach.[/EDIT]
Again, I found out about this without any custom PlayerPawn actors.
Last edited by Fishytza on Fri Jun 14, 2019 6:31 am, edited 1 time in total.
Re: GiveDefaultInventory() always gives another BasicArmor
In my opinion, these lines
should be replaced with
It's the same thing that already works for Hexen armor.
Code: Select all
let barmor = BasicArmor(Spawn('BasicArmor'));
barmor.BecomeItem ();
AddInventory (barmor);
Code: Select all
GiveInventoryType('BasicArmor');