mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Check item_drop amount clientside (#6242)
This commit is contained in:
parent
3cea7a349a
commit
ad9677a14f
2 changed files with 12 additions and 15 deletions
|
@ -1251,7 +1251,7 @@ protected:
|
|||
void processKeyInput();
|
||||
void processItemSelection(u16 *new_playeritem);
|
||||
|
||||
void dropSelectedItem();
|
||||
void dropSelectedItem(bool single_item = false);
|
||||
void openInventory();
|
||||
void openConsole(float scale, const wchar_t *line=NULL);
|
||||
void toggleFreeMove();
|
||||
|
@ -2499,7 +2499,7 @@ void Game::processUserInput(f32 dtime)
|
|||
void Game::processKeyInput()
|
||||
{
|
||||
if (wasKeyDown(KeyType::DROP)) {
|
||||
dropSelectedItem();
|
||||
dropSelectedItem(isKeyDown(KeyType::SNEAK));
|
||||
} else if (wasKeyDown(KeyType::AUTOFORWARD)) {
|
||||
toggleAutoforward();
|
||||
} else if (wasKeyDown(KeyType::INVENTORY)) {
|
||||
|
@ -2645,10 +2645,10 @@ void Game::processItemSelection(u16 *new_playeritem)
|
|||
}
|
||||
|
||||
|
||||
void Game::dropSelectedItem()
|
||||
void Game::dropSelectedItem(bool single_item)
|
||||
{
|
||||
IDropAction *a = new IDropAction();
|
||||
a->count = 0;
|
||||
a->count = single_item ? 1 : 0;
|
||||
a->from_inv.setCurrentPlayer();
|
||||
a->from_list = "main";
|
||||
a->from_i = client->getPlayerItem();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue