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:
parent
29cfb6efff
commit
034ca313c6
1 changed files with 3 additions and 1 deletions
|
@ -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();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue