OctoD / godot-gameplay-systems

⚔️ A plugin for Godot to create your gameplay systems in a Godot way.
MIT License
509 stars 49 forks source link

🐛 [bug]EquippedItem3D tags_to_be_displayed not being used? #27

Closed Sezotove closed 1 year ago

Sezotove commented 1 year ago

Describe the bug I don't believe that tags_to_be_displayed is in use. Or at least I'm not certain how it's being used. I've checked the Doom demo, it had right.hand but I don't see any tags on the SMG or Shotgun that resemble right.hand and I don't see them in code anywhere.

To Reproduce Add tag to EquippedItem3D and equip-item, should still equip.

Expected behavior If the tags do not match it should not show the item.

Screenshots N/A

Desktop (please complete the following information):

Additional context I've added the following to the lambda function(I think thats what they're called):

From:

    equipment.equipped.connect(func (item: Item, _slot: EquipmentSlot):
        if item.scene and item.scene.can_instantiate():
            current = item.scene.instantiate()
            add_child(current)
    )

To:

    equipment.equipped.connect(func (item: Item, _slot: EquipmentSlot):
        if item.scene and item.scene.can_instantiate():
            if item.tags.has(tags_to_display[0]):
                current = item.scene.instantiate()
                add_child(current)
    )

My above check does work, but it's very specific to the first tag for my testing so it should probably be written differently to check all the tags and make sure they match or a grouping of them or something more modular/intelligent than my hard coded first entry of the tags_to_display array.

OctoD commented 1 year ago

Hi, thank you for reporting, this has been fixed in a51cdb77d8f6f58f7239f3cf952dc170a367e136.

Hope it fits!