mirror of
https://github.com/minetest-mods/item_drop.git
synced 2025-01-03 11:37:36 +01:00
Rename the key press test function
This commit is contained in:
parent
4c66b76937
commit
49b7bb19ef
4
init.lua
4
init.lua
@ -109,7 +109,7 @@ if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false then
|
|||||||
|
|
||||||
|
|
||||||
-- tests if the player has the keys pressed to enable item picking
|
-- tests if the player has the keys pressed to enable item picking
|
||||||
local function keys_pressed(player)
|
local function has_keys_pressed(player)
|
||||||
if not key_triggered then
|
if not key_triggered then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -129,7 +129,7 @@ if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false then
|
|||||||
|
|
||||||
-- called for each player to possibly collect an item, returns true if so
|
-- called for each player to possibly collect an item, returns true if so
|
||||||
local function pickupfunc(player)
|
local function pickupfunc(player)
|
||||||
if not keys_pressed(player)
|
if not has_keys_pressed(player)
|
||||||
or not minetest.get_player_privs(player:get_player_name()).interact
|
or not minetest.get_player_privs(player:get_player_name()).interact
|
||||||
or player:get_hp() <= 0 then
|
or player:get_hp() <= 0 then
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user