fix: Armor swapping executed even when interacting with a block (#168)

(This PR fixes [this issue](https://discord.com/channels/1482443865754701868/1534141325904183336) from the Discord server: )

Previously, when holding a piece of armor and right-clicking an interactable block (furnance, crafting table, levers, etc.) the armor would be equipped to the player.
This isn't the expected behavior. The interacted block should suppress any held item functionality (if not crouched)

This PR adds the "bool blockHandled" variable to the "handleUseItem" function. If the player interact with an interactable block, the variable is set to true.
This variable can be used for future packets added in this function

Reviewed-on: https://git.neolegacy.dev/neoStudiosLCE/neoLegacy/pulls/168
Co-authored-by: ACL <puffymono@gmail.com>
Co-committed-by: ACL <puffymono@gmail.com>
This commit is contained in:
ACL authored and Fireblade committed 2026-08-08 16:58:45 +01:00
1 parent a809e71d58
commit c85b2a8740
2 files changed
+5 -3

No files matched your search

@@ -421,6 +421,7 @@ bool ServerPlayerGameMode::useItemOn(shared_ptr<Player> player, Level *level, sh
if (Tile::tiles[t]->use(level, x, y, z, player, face, clickX, clickY, clickZ))
{
if(m_gameRules != nullptr) m_gameRules->onUseTile(t,x,y,z);
*pbUsedItem = true;
return true;
}
}