Skip to content

Commit

Permalink
fix: adjust autoloot as it is activated by default (-1) (opentibiabr#…
Browse files Browse the repository at this point in the history
  • Loading branch information
luanluciano93 authored Nov 4, 2023
1 parent b1f9fb2 commit 961db0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/scripts/talkactions/player/auto_loot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/creatures/players/player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 961db0c

Please sign in to comment.