From 961db0cad965e0c19b9d1c55cd3374c438267547 Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Sat, 4 Nov 2023 11:33:36 -0300 Subject: [PATCH] fix: adjust autoloot as it is activated by default (-1) (#1767) --- data/scripts/talkactions/player/auto_loot.lua | 2 +- src/creatures/players/player.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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(); }