Skip to content

Commit

Permalink
Revert "fix: autoloot default value (opentibiabr#2690)"
Browse files Browse the repository at this point in the history
This reverts commit 81e250a.
  • Loading branch information
lenangen94 committed Jun 19, 2024
1 parent b8e2e1a commit 9dd4141
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/creatures/players/player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2562,21 +2562,27 @@ class Player final : public Creature, public Cylinder, public Bankable {
}

bool checkAutoLoot(bool isBoss) const {
if (!g_configManager().getBoolean(AUTOLOOT, __FUNCTION__)) {
const bool autoLoot = g_configManager().getBoolean(AUTOLOOT, __FUNCTION__);
if (!autoLoot) {
return false;
}
if (g_configManager().getBoolean(VIP_SYSTEM_ENABLED, __FUNCTION__) && g_configManager().getBoolean(VIP_AUTOLOOT_VIP_ONLY, __FUNCTION__) && !isVip()) {
return false;
}

auto featureKV = kv()->scoped("features")->get("autoloot");
auto value = featureKV.has_value() ? featureKV->getNumber() : 0;
if (value == 2) {
return true;
} else if (value == 1) {
return !isBoss;
if (featureKV.has_value()) {
auto value = featureKV->getNumber();
if (value == 2) {
return true;
} else if (value == 1) {
return !isBoss;
} else if (value == 0) {
return false;
}
}
return false;

return true;
}

QuickLootFilter_t getQuickLootFilter() const {
Expand Down

0 comments on commit 9dd4141

Please sign in to comment.