Godot Version
v4.2.2.stable.official [15073afe3]
Question
I have a function that removes items in an array. For the most part, when I present a value to the erase function if it is in the array it removes. However when I pass it the name of a node, it doesn’t even though has() says the array has the item
func remove_needed(item):
print ("erase: " ,item)
print (needed_inputs.has(item))
needed_inputs.erase(item)
print ( needed_inputs)
Returns
erase: Strength
true
["Archetype", "Strength", "Dexterity", "Aptitude", "Fortitude", "Wits", "Will", "floating"]
It sees the value Strength, but it doesn’t remove it from the array for some reason
It is called in the node’s script by
CharacterSheet.remove_needed(self.name)
Any idea why it is not erasing the item, even though the has function says it is in the array?