don-tnowe / godot-wyvernbox-inventory

Action RPG-focused inventory system for Godot 3 and 4
MIT License
105 stars 4 forks source link

GroundItemManager from_array does not prevent duplicate items #4

Closed Mazianni closed 1 year ago

Mazianni commented 1 year ago

Hello!

When using the GroundItemManager class's to_array/from_array, from_array does not prevent duplicate items (or clear it's existing items).

I noticed that inventories do prevent duplicates, so I didn't encounter an issue in my use-case (multiplayer serialization) until I implemented a ground item manager.

don-tnowe commented 1 year ago

Interesting. Seems I've overlooked that

Should be as easy as for x in get_children(): x.free(), as ground items are simply the manager's children.