diff --git a/data/scripts/talkactions/player/auto_loot.lua b/data/scripts/talkactions/player/auto_loot.lua index 0b03b0101bd..a5541d51438 100644 --- a/data/scripts/talkactions/player/auto_loot.lua +++ b/data/scripts/talkactions/player/auto_loot.lua @@ -16,7 +16,7 @@ function autoLoot.onSay(player, words, param) player:setStorageValue(STORAGEVALUE_AUTO_LOOT, 1) player:sendTextMessage(MESSAGE_LOOK, "You have successfully enabled your automatic looting!") elseif param == "off" then - player:setStorageValue(STORAGEVALUE_AUTO_LOOT, 0) + player:setStorageValue(STORAGEVALUE_AUTO_LOOT, -1) player:sendTextMessage(MESSAGE_LOOK, "You have successfully disabled your automatic looting!") end return true diff --git a/src/creatures/players/player.hpp b/src/creatures/players/player.hpp index 1b35273b9cf..418f8659e49 100644 --- a/src/creatures/players/player.hpp +++ b/src/creatures/players/player.hpp @@ -2502,7 +2502,7 @@ class Player final : public Creature, public Cylinder, public Bankable { } bool checkAutoLoot() const { - const bool autoLoot = g_configManager().getBoolean(AUTOLOOT) && getStorageValue(STORAGEVALUE_AUTO_LOOT) != 0; + const bool autoLoot = g_configManager().getBoolean(AUTOLOOT) && getStorageValue(STORAGEVALUE_AUTO_LOOT) > 0; if (g_configManager().getBoolean(VIP_SYSTEM_ENABLED) && g_configManager().getBoolean(VIP_AUTOLOOT_VIP_ONLY)) { return autoLoot && isVip(); }