botw
botw copied to clipboard
Rename `removeItem` to `removeFairy`
uking::ui::PauseMenuDataMgr::removeItem is only called by Player::tryReviveBeforeGameOver, in order to find the first slot containing a fairy to remove upon taking fatal damage. removeFairy is therefore a more fitting name for this function.
I don't think that means it should be renamed, mostly due to the fact you have to pass in the item name
This behavior for removing items (remove an item from the first slot of its type) is only used for fairies, while removing items in any other way (e.g. dropping, eating, selling) only removes from a specific slot. Naming this function removeItem only causes confusion when trying to figure out how the game removes items normally.
removeItem makes sense since mods can link to this function and use it to remove any item
My two cents: just because the function is only used for fairies doesn't mean it should be called removeFairy, especially when it's generic (takes an item name + checks if the item is stackable or not) and could conceivably be used to remove items that aren't fairies.