Skip to content

Commit

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

bool checkAutoLoot(bool isBoss) const {
const bool autoLoot = g_configManager().getBoolean(AUTOLOOT, __FUNCTION__);
if (!autoLoot) {
if (!g_configManager().getBoolean(AUTOLOOT, __FUNCTION__)) {
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");
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;
}
auto value = featureKV.has_value() ? featureKV->getNumber() : 0;
if (value == 2) {
return true;
} else if (value == 1) {
return !isBoss;
}

return true;
return false;
}

QuickLootFilter_t getQuickLootFilter() const {
Expand Down

0 comments on commit 81e250a

Please sign in to comment.