Revert "Prevent interacting with items out of the hotbar (#10359)"

master
MoNTE48 2021-11-13 01:36:50 +02:00
parent bd17b2f6d7
commit d6b01ab8ef
1 changed files with 0 additions and 19 deletions

View File

@ -867,15 +867,6 @@ void Server::handleCommand_PlayerItem(NetworkPacket* pkt)
*pkt >> item;
if (item >= player->getHotbarItemcount()) {
actionstream << "Player: " << player->getName()
<< " tried to access item=" << item
<< " out of hotbar_itemcount="
<< player->getHotbarItemcount()
<< "; ignoring." << std::endl;
return;
}
playersao->getPlayer()->setWieldIndex(item);
}
@ -991,16 +982,6 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
v3f player_pos = playersao->getLastGoodPosition();
// Update wielded item
if (item_i >= player->getHotbarItemcount()) {
actionstream << "Player: " << player->getName()
<< " tried to access item=" << item_i
<< " out of hotbar_itemcount="
<< player->getHotbarItemcount()
<< "; ignoring." << std::endl;
return;
}
playersao->getPlayer()->setWieldIndex(item_i);
// Get pointed to object (NULL if not POINTEDTYPE_OBJECT)