mirror of
https://github.com/minetest-mods/item_drop.git
synced 2024-11-05 06:53:47 +01:00
Use ctrl var
This commit is contained in:
parent
a7cdd68cc9
commit
1091537584
7
init.lua
7
init.lua
@ -13,12 +13,13 @@ local key_press = false
|
|||||||
if pickup then
|
if pickup then
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
for _,player in ipairs(minetest.get_connected_players()) do
|
for _,player in ipairs(minetest.get_connected_players()) do
|
||||||
|
local ctrl = player:get_player_control()
|
||||||
if keytype == "Sneak" then
|
if keytype == "Sneak" then
|
||||||
key_press = player:get_player_control().sneak
|
key_press = ctrl.sneak
|
||||||
elseif keytype == "LeftAndRight" then
|
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
|
else
|
||||||
key_press = player:get_player_control().aux1
|
key_press = ctrl.aux1
|
||||||
end
|
end
|
||||||
if key_press or not key then
|
if key_press or not key then
|
||||||
if player:get_hp() > 0 or not minetest.settings:get_bool("enable_damage") then
|
if player:get_hp() > 0 or not minetest.settings:get_bool("enable_damage") then
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
enable_item_pickup (Enable item pickups) bool true
|
enable_item_pickup (Enable item pickups) bool true
|
||||||
|
|
||||||
#Drop items in-world on dig
|
#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
|
#Use a key to pick up items
|
||||||
enable_item_pickup_key (Use pickup key) bool true
|
enable_item_pickup_key (Use pickup key) bool true
|
||||||
|
Loading…
Reference in New Issue
Block a user