1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Client: Don't allow dropping items while dead

This commit is contained in:
Lars Mueller 2025-01-31 00:36:53 +01:00
parent 29cfb6efff
commit 034ca313c6

View file

@ -1841,7 +1841,9 @@ void Game::processUserInput(f32 dtime)
void Game::processKeyInput() void Game::processKeyInput()
{ {
if (wasKeyDown(KeyType::DROP)) { const auto *player = client->getEnv().getLocalPlayer();
const bool dead = player->getCAO() && player->isDead();
if (wasKeyDown(KeyType::DROP) && !dead) {
dropSelectedItem(isKeyDown(KeyType::SNEAK)); dropSelectedItem(isKeyDown(KeyType::SNEAK));
} else if (wasKeyDown(KeyType::AUTOFORWARD)) { } else if (wasKeyDown(KeyType::AUTOFORWARD)) {
toggleAutoforward(); toggleAutoforward();