botw icon indicating copy to clipboard operation
botw copied to clipboard

Rename `removeItem` to `removeFairy`

Open Makonede opened this issue 2 years ago • 2 comments

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.


This change is Reviewable

Makonede avatar Nov 11 '23 22:11 Makonede

I don't think that means it should be renamed, mostly due to the fact you have to pass in the item name

ThePixelGamer avatar Nov 11 '23 23:11 ThePixelGamer

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.

Makonede avatar Nov 12 '23 01:11 Makonede

removeItem makes sense since mods can link to this function and use it to remove any item

Pistonight avatar Mar 09 '24 06:03 Pistonight

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.

leoetlino avatar Mar 09 '24 19:03 leoetlino