diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-10-19 13:09:38 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-10-19 13:09:38 +0200 |
commit | f1ff05bf5932a7825509dbe896e60183a96a6d36 (patch) | |
tree | 73f2e361a7fd8010345880071aa29f0495171879 /builtin/client/cheats/inventory.lua | |
parent | 35da7306dcd07fd43252468cdf71c9d8c09faeeb (diff) | |
download | dragonfireclient-f1ff05bf5932a7825509dbe896e60183a96a6d36.tar.xz |
Added ThroughWalls, InventoryActions API and AutoTotem
Diffstat (limited to 'builtin/client/cheats/inventory.lua')
-rw-r--r-- | builtin/client/cheats/inventory.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin/client/cheats/inventory.lua b/builtin/client/cheats/inventory.lua index d12052d7c..faa7d1c0e 100644 --- a/builtin/client/cheats/inventory.lua +++ b/builtin/client/cheats/inventory.lua @@ -1,5 +1,6 @@ local elapsed_time = 0 local tick_time = 0.05 +local drop_action = InventoryAction("drop") core.register_globalstep(function(dtime) -- AutoEject @@ -9,11 +10,8 @@ core.register_globalstep(function(dtime) local inventory = core.get_inventory("current_player") for index, stack in pairs(inventory.main) do if table.indexof(list, stack:get_name()) ~= -1 then - local old_index = player:get_wield_index() - player:set_wield_index(index - 1) - core.drop_selected_item() - player:set_wield_index(old_index) - return + drop_action:from("current_player", "main", index - 1) + drop_action:apply() end end end |