Use ctrl var

This commit is contained in:
tacotexmex 2017-07-11 23:29:18 +02:00
parent 1f9ceb3eb3
commit 189fea5eff
2 changed files with 5 additions and 4 deletions

View File

@ -13,12 +13,13 @@ local key_press = false
if pickup then
minetest.register_globalstep(function(dtime)
for _,player in ipairs(minetest.get_connected_players()) do
local ctrl = player:get_player_control()
if keytype == "Sneak" then
key_press = player:get_player_control().sneak
key_press = ctrl.sneak
elseif keytype == "LeftAndRight" then
key_press = player:get_player_control().left and player:get_player_control().right
key_press = ctrl.left and ctrl.right
else
key_press = player:get_player_control().aux1
key_press = ctrl.aux1
end
if key_press or not key then
if player:get_hp() > 0 or not minetest.settings:get_bool("enable_damage") then

View File

@ -2,7 +2,7 @@
enable_item_pickup (Enable item pickups) bool true
#Drop items in-world on dig
enable_item_drops (Enable item drops) bool true
enable_item_drop (Enable item drops) bool true
#Use a key to pick up items
enable_item_pickup_key (Use pickup key) bool true