diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c8ffef6c0a..ace20e3d9c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,10 +79,9 @@ endif() # === IPO === -option(OPTIONS_ENABLE_IPO "Check and Enable interprocedural optimization (IPO/LTO)" ON) if(OPTIONS_ENABLE_IPO) - log_option_enabled("IPO/LTO") if(MSVC) + log_option_enabled("IPO/LTO") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /GL") set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /LTCG") set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /LTCG") @@ -90,6 +89,7 @@ if(OPTIONS_ENABLE_IPO) set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /LTCG") else() if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" OR CMAKE_BUILD_TYPE STREQUAL "Release") + log_option_enabled("IPO/LTO") include(CheckIPOSupported) check_ipo_supported(RESULT result OUTPUT output) if(result) diff --git a/cmake/modules/BaseConfig.cmake b/cmake/modules/BaseConfig.cmake index 17388897b0f..ab92de08099 100644 --- a/cmake/modules/BaseConfig.cmake +++ b/cmake/modules/BaseConfig.cmake @@ -121,7 +121,7 @@ if (MSVC) add_compile_options(/MP /FS /Zf /EHsc) else() - add_compile_options(-Wno-unused-parameter -Wno-sign-compare) + add_compile_options(-Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-implicit-fallthrough -Wno-extra) endif() ## Link compilation files to build/bin folder, else link to the main dir diff --git a/src/canary_server.cpp b/src/canary_server.cpp index 56cd53bf567..7400ef9539f 100644 --- a/src/canary_server.cpp +++ b/src/canary_server.cpp @@ -326,7 +326,8 @@ void CanaryServer::loadModules() { // If "USE_ANY_DATAPACK_FOLDER" is set to true then you can choose any datapack folder for your server const auto useAnyDatapack = g_configManager().getBoolean(USE_ANY_DATAPACK_FOLDER, __FUNCTION__); auto datapackName = g_configManager().getString(DATA_DIRECTORY, __FUNCTION__); - if (!useAnyDatapack && (datapackName != "data-canary" && datapackName != "data-otservbr-global" || datapackName != "data-otservbr-global" && datapackName != "data-canary")) { + if (!useAnyDatapack && ((datapackName != "data-canary" && datapackName != "data-otservbr-global") || (datapackName != "data-otservbr-global" && datapackName != "data-canary"))) + { throw FailedToInitializeCanary(fmt::format( "The datapack folder name '{}' is wrong, please select valid " "datapack name 'data-canary' or 'data-otservbr-global " diff --git a/src/creatures/creature.cpp b/src/creatures/creature.cpp index bab935e8a97..f20aad63ff6 100644 --- a/src/creatures/creature.cpp +++ b/src/creatures/creature.cpp @@ -709,7 +709,7 @@ void Creature::onDeath() { } } - bool killedByPlayer = mostDamageCreature && mostDamageCreature->getPlayer() || mostDamageCreatureMaster && mostDamageCreatureMaster->getPlayer(); + bool killedByPlayer = (mostDamageCreature && mostDamageCreature->getPlayer()) || (mostDamageCreatureMaster && mostDamageCreatureMaster->getPlayer()); if (getPlayer()) { g_metrics().addCounter( "player_death", diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 48c92428681..d3952ef6cfe 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -7804,7 +7804,7 @@ bool Player::setAccount(uint32_t accountId) { } uint8_t Player::getAccountType() const { - return account ? account->getAccountType() : AccountType::ACCOUNT_TYPE_NORMAL; + return static_cast(account ? account->getAccountType() : AccountType::ACCOUNT_TYPE_NORMAL); } uint32_t Player::getAccountId() const { diff --git a/src/game/game.cpp b/src/game/game.cpp index ba1acf1fdf8..2bffb28fa50 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -5379,7 +5379,7 @@ void Game::playerSetManagedContainer(uint32_t playerId, ObjectCategory_t categor std::shared_ptr container = thing->getContainer(); auto allowConfig = g_configManager().getBoolean(TOGGLE_GOLD_POUCH_ALLOW_ANYTHING, __FUNCTION__) || g_configManager().getBoolean(TOGGLE_GOLD_POUCH_QUICKLOOT_ONLY, __FUNCTION__); - if (!container || (container->getID() == ITEM_GOLD_POUCH && category != OBJECTCATEGORY_GOLD) && !allowConfig) { + if (!container || ((container->getID() == ITEM_GOLD_POUCH && category != OBJECTCATEGORY_GOLD) && !allowConfig)) { player->sendCancelMessage(RETURNVALUE_NOTPOSSIBLE); return; } @@ -8076,7 +8076,7 @@ void Game::playerLeaveParty(uint32_t playerId) { } std::shared_ptr party = player->getParty(); - if (!party || player->hasCondition(CONDITION_INFIGHT) && !player->getZoneType() == ZONE_PROTECTION) { + if (!party || (player->hasCondition(CONDITION_INFIGHT) && !player->getZoneType() == ZONE_PROTECTION)) { player->sendTextMessage(TextMessage(MESSAGE_FAILURE, "You cannot leave party, contact the administrator.")); return; } @@ -8749,7 +8749,7 @@ bool checkCanInitCreateMarketOffer(std::shared_ptr player, uint8_t type, return false; } - if (amount == 0 || !it.stackable && amount > 2000 || it.stackable && amount > 64000) { + if (amount == 0 || (!it.stackable && amount > 2000) || (it.stackable && amount > 64000)) { offerStatus << "Failed to load amount " << amount << " for player " << player->getName(); return false; } @@ -8968,7 +8968,7 @@ void Game::playerAcceptMarketOffer(uint32_t playerId, uint32_t timestamp, uint16 return; } - if (amount == 0 || !it.stackable && amount > 2000 || it.stackable && amount > 64000 || amount > offer.amount) { + if (amount == 0 || (!it.stackable && amount > 2000) || (it.stackable && amount > 64000) || amount > offer.amount) { offerStatus << "Invalid offer amount " << amount << " for player " << player->getName(); return; } @@ -9539,7 +9539,7 @@ void Game::playerRotatePodium(uint32_t playerId, const Position &pos, uint8_t st bool isPodiumOfRenown = itemId == ITEM_PODIUM_OF_RENOWN1 || itemId == ITEM_PODIUM_OF_RENOWN2; if (!isPodiumOfRenown) { auto lookTypeExAttribute = item->getCustomAttribute("LookTypeEx"); - if (!isMonsterVisible || podiumRaceId == 0 || lookTypeExAttribute && lookTypeExAttribute->getInteger() == 39003) { + if (!isMonsterVisible || podiumRaceId == 0 || (lookTypeExAttribute && lookTypeExAttribute->getInteger() == 39003)) { player->sendCancelMessage(RETURNVALUE_NOTPOSSIBLE); return; } diff --git a/src/game/scheduling/events_scheduler.cpp b/src/game/scheduling/events_scheduler.cpp index c57f84b667c..a86254fa35c 100644 --- a/src/game/scheduling/events_scheduler.cpp +++ b/src/game/scheduling/events_scheduler.cpp @@ -27,7 +27,6 @@ bool EventsScheduler::loadScheduleEventFromXml() { int daysMath = ((timePtr->tm_year + 1900) * 365) + ((timePtr->tm_mon + 1) * 30) + (timePtr->tm_mday); // Keep track of loaded scripts to check for duplicates - int count = 0; phmap::flat_hash_set loadedScripts; std::map eventsOnSameDay; for (const auto &eventNode : doc.child("events").children()) { diff --git a/src/io/functions/iologindata_save_player.cpp b/src/io/functions/iologindata_save_player.cpp index 091f2fdf034..76310840210 100644 --- a/src/io/functions/iologindata_save_player.cpp +++ b/src/io/functions/iologindata_save_player.cpp @@ -737,7 +737,7 @@ bool IOLoginDataSave::savePlayerBosstiary(std::shared_ptr player) { // Bosstiary tracker PropWriteStream stream; - for (const auto monsterType : player->getCyclopediaMonsterTrackerSet(true)) { + for (const auto &monsterType : player->getCyclopediaMonsterTrackerSet(true)) { if (!monsterType) { continue; } diff --git a/src/io/iologindata.cpp b/src/io/iologindata.cpp index 4c6b95dc32e..46426451ddc 100644 --- a/src/io/iologindata.cpp +++ b/src/io/iologindata.cpp @@ -72,7 +72,7 @@ uint8_t IOLoginData::getAccountType(uint32_t accountId) { void IOLoginData::updateOnlineStatus(uint32_t guid, bool login) { static phmap::flat_hash_map updateOnline; - if (login && updateOnline.find(guid) != updateOnline.end() || guid <= 0) { + if ((login && updateOnline.find(guid) != updateOnline.end()) || guid <= 0) { return; } diff --git a/src/io/iomap.cpp b/src/io/iomap.cpp index 4edfefa66d1..d445e70efbe 100644 --- a/src/io/iomap.cpp +++ b/src/io/iomap.cpp @@ -122,7 +122,6 @@ void IOMap::parseTileArea(FileStream &stream, Map &map, const Position &pos) { const uint16_t base_y = stream.getU16(); const uint8_t base_z = stream.getU8(); - bool tileIsStatic = false; while (stream.startNode()) { const uint8_t tileType = stream.getU8(); @@ -166,9 +165,6 @@ void IOMap::parseTileArea(FileStream &stream, Map &map, const Position &pos) { const auto &iType = Item::items[id]; if (!tile->isHouse() || (!iType.isBed() && !iType.isTrashHolder())) { - if (iType.blockSolid) { - tileIsStatic = true; - } const auto item = std::make_shared(); item->id = id; @@ -194,9 +190,6 @@ void IOMap::parseTileArea(FileStream &stream, Map &map, const Position &pos) { const auto &iType = Item::items[id]; - if (iType.blockSolid) { - tileIsStatic = true; - } const auto item = std::make_shared(); item->id = id; diff --git a/src/items/containers/container.cpp b/src/items/containers/container.cpp index 7bd7dcef2c9..35406aee34f 100644 --- a/src/items/containers/container.cpp +++ b/src/items/containers/container.cpp @@ -383,7 +383,7 @@ bool Container::isInsideContainerWithId(const uint16_t id) { } bool Container::isAnyKindOfRewardChest() { - return getID() == ITEM_REWARD_CHEST || getID() == ITEM_REWARD_CONTAINER && getParent() && getParent()->getContainer() && getParent()->getContainer()->getID() == ITEM_REWARD_CHEST || isBrowseFieldAndHoldsRewardChest(); + return getID() == ITEM_REWARD_CHEST || (getID() == ITEM_REWARD_CONTAINER && getParent() && getParent()->getContainer() && getParent()->getContainer()->getID() == ITEM_REWARD_CHEST) || isBrowseFieldAndHoldsRewardChest(); } bool Container::isAnyKindOfRewardContainer() { diff --git a/src/items/item.cpp b/src/items/item.cpp index eea07a4e5dd..4cc904705b2 100644 --- a/src/items/item.cpp +++ b/src/items/item.cpp @@ -3218,7 +3218,7 @@ std::shared_ptr Item::transform(uint16_t itemId, uint16_t itemCount /*= -1 } std::shared_ptr newItem; - if (itemCount == -1) { + if (itemCount == 0) { newItem = Item::CreateItem(itemId, 1); } else { newItem = Item::CreateItem(itemId, itemCount); diff --git a/src/items/tile.cpp b/src/items/tile.cpp index ca354700f22..11e3fafd6fd 100644 --- a/src/items/tile.cpp +++ b/src/items/tile.cpp @@ -791,7 +791,7 @@ ReturnValue Tile::queryAdd(int32_t, const std::shared_ptr &thing, uint32_ if (ground) { const ItemType &iiType = Item::items[ground->getID()]; if (iiType.blockSolid) { - if (!iiType.pickupable && iiType.type != ITEM_TYPE_TRASHHOLDER || item->isMagicField() || item->isBlocking()) { + if ((!iiType.pickupable && iiType.type != ITEM_TYPE_TRASHHOLDER) || item->isMagicField() || item->isBlocking()) { if (!item->isPickupable() && !item->isCarpet()) { return RETURNVALUE_NOTENOUGHROOM; } @@ -1575,7 +1575,7 @@ void Tile::internalAddThing(uint32_t, std::shared_ptr thing) { if (!thing) { return; } - for (const auto zone : getZones()) { + for (const auto &zone : getZones()) { zone->thingAdded(thing); } diff --git a/src/lua/creature/movement.cpp b/src/lua/creature/movement.cpp index 0af09476ed8..b302877b3d3 100644 --- a/src/lua/creature/movement.cpp +++ b/src/lua/creature/movement.cpp @@ -24,8 +24,6 @@ void MoveEvents::clear(bool isFromXML /*= false*/) { for (int moveEventType = 0; moveEventType < MOVE_EVENT_LAST; ++moveEventType) { auto &eventList = moveEventList.moveEvent[moveEventType]; - int originalSize = eventList.size(); - eventList.remove_if([&](const std::shared_ptr &moveEvent) { bool removed = moveEvent && moveEvent->isFromXML(); if (removed) { diff --git a/src/lua/creature/movement.hpp b/src/lua/creature/movement.hpp index 485454a0564..4ce4297b0f5 100644 --- a/src/lua/creature/movement.hpp +++ b/src/lua/creature/movement.hpp @@ -180,7 +180,7 @@ class MoveEvent final : public Script, public SharedObject { } void addVocEquipMap(std::string vocName) { uint16_t vocationId = g_vocations().getVocationId(vocName); - if (vocationId != -1) { + if (vocationId != 65535) { vocEquipMap[vocationId] = true; } } diff --git a/src/lua/functions/core/game/config_functions.cpp b/src/lua/functions/core/game/config_functions.cpp index a84c500b985..d0e77a69352 100644 --- a/src/lua/functions/core/game/config_functions.cpp +++ b/src/lua/functions/core/game/config_functions.cpp @@ -22,7 +22,6 @@ void ConfigFunctions::init(lua_State* L) { #define registerMagicEnumIn(L, tableName, enumValue) \ do { \ - auto number = magic_enum::enum_integer(enumValue); \ auto name = magic_enum::enum_name(enumValue).data(); \ registerVariable(L, tableName, name, value); \ } while (0) diff --git a/src/lua/functions/core/game/game_functions.cpp b/src/lua/functions/core/game/game_functions.cpp index e5abd82f888..0d39ce01d41 100644 --- a/src/lua/functions/core/game/game_functions.cpp +++ b/src/lua/functions/core/game/game_functions.cpp @@ -212,7 +212,7 @@ int GameFunctions::luaGameGetMonsterTypes(lua_State* L) { const auto type = g_monsters().monsters; lua_createtable(L, type.size(), 0); - for (const auto [typeName, mType] : type) { + for (const auto &[typeName, mType] : type) { pushUserdata(L, mType); setMetatable(L, -1, "MonsterType"); lua_setfield(L, -2, typeName.c_str()); diff --git a/src/lua/functions/creatures/creature_functions.cpp b/src/lua/functions/creatures/creature_functions.cpp index a633afe9749..7a40cc426f1 100644 --- a/src/lua/functions/creatures/creature_functions.cpp +++ b/src/lua/functions/creatures/creature_functions.cpp @@ -54,7 +54,7 @@ int CreatureFunctions::luaCreatureGetEvents(lua_State* L) { lua_createtable(L, static_cast(eventList.size()), 0); int index = 0; - for (const auto eventPtr : eventList) { + for (const auto &eventPtr : eventList) { pushString(L, eventPtr->getName()); lua_rawseti(L, -2, ++index); } diff --git a/src/lua/functions/creatures/monster/charm_functions.cpp b/src/lua/functions/creatures/monster/charm_functions.cpp index 48f7ff5aec9..d456f1c96a8 100644 --- a/src/lua/functions/creatures/monster/charm_functions.cpp +++ b/src/lua/functions/creatures/monster/charm_functions.cpp @@ -18,7 +18,7 @@ int CharmFunctions::luaCharmCreate(lua_State* L) { if (isNumber(L, 2)) { charmRune_t charmid = getNumber(L, 2); const auto charmList = g_game().getCharmList(); - for (const auto charm : charmList) { + for (const auto &charm : charmList) { if (charm->id == charmid) { pushUserdata(L, charm); setMetatable(L, -1, "Charm"); diff --git a/src/lua/functions/creatures/monster/monster_spell_functions.cpp b/src/lua/functions/creatures/monster/monster_spell_functions.cpp index ee00fd43af7..a20d57008d2 100644 --- a/src/lua/functions/creatures/monster/monster_spell_functions.cpp +++ b/src/lua/functions/creatures/monster/monster_spell_functions.cpp @@ -170,7 +170,7 @@ int MonsterSpellFunctions::luaMonsterSpellSetConditionType(lua_State* L) { const auto spell = getUserdataShared(L, 1); if (spell) { auto conditionType = getNumber(L, 2); - if (conditionType == -1) { + if (conditionType == 254) { g_logger().error("[{}] trying to register condition type none for monster: {}", __FUNCTION__, spell->name); reportErrorFunc(fmt::format("trying to register condition type none for monster: {}", spell->name)); pushBoolean(L, false); diff --git a/src/map/map.cpp b/src/map/map.cpp index 395e6d7d2be..fcf14262c30 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -611,7 +611,7 @@ bool Map::getPathMatching(const std::shared_ptr &creature, const Posit const bool withoutCreature = creature == nullptr; const auto &tile = neighborNode || withoutCreature ? getTile(pos.x, pos.y, pos.z) : canWalkTo(creature, pos); - if (!tile || !neighborNode && withoutCreature && tile->hasFlag(TILESTATE_BLOCKSOLID)) { + if (!tile || (!neighborNode && withoutCreature && tile->hasFlag(TILESTATE_BLOCKSOLID))) { continue; } diff --git a/src/map/spectators.cpp b/src/map/spectators.cpp index 18ce13871fe..bf3b860dc28 100644 --- a/src/map/spectators.cpp +++ b/src/map/spectators.cpp @@ -79,7 +79,7 @@ bool Spectators::checkCache(const SpectatorsCache::FloorData &specData, bool onl if (checkDistance) { SpectatorList spectators; spectators.reserve(creatures.size()); - for (const auto creature : *list) { + for (const auto &creature : *list) { const auto &specPos = creature->getPosition(); if (centerPos.x - specPos.x >= minRangeX && centerPos.y - specPos.y >= minRangeY @@ -184,7 +184,7 @@ Spectators Spectators::find(const Position ¢erPos, bool multifloor, bool onl for (uint_fast16_t nx = startx1; nx <= endx2; nx += FLOOR_SIZE) { if (leafE) { const auto &node_list = (onlyPlayers ? leafE->player_list : leafE->creature_list); - for (const auto creature : node_list) { + for (const auto &creature : node_list) { const auto &cpos = creature->getPosition(); if (minRangeZ > cpos.z || maxRangeZ < cpos.z) { continue; @@ -211,7 +211,14 @@ Spectators Spectators::find(const Position ¢erPos, bool multifloor, bool onl } // It is necessary to create the cache even if no spectators is found, so that there is no future query. - auto &cache = cacheFound ? it->second : spectatorsCache.emplace(centerPos, SpectatorsCache { .minRangeX = minRangeX, .maxRangeX = maxRangeX, .minRangeY = minRangeY, .maxRangeY = maxRangeY }).first->second; + auto &cache = cacheFound ? it->second : spectatorsCache.emplace(centerPos, SpectatorsCache{ + .minRangeX = minRangeX, + .maxRangeX = maxRangeX, + .minRangeY = minRangeY, + .maxRangeY = maxRangeY, + .creatures = {}, + .players= {} + }).first->second; auto &creaturesCache = onlyPlayers ? cache.players : cache.creatures; auto &creatureList = (multifloor ? creaturesCache.multiFloor : creaturesCache.floor); if (creatureList) { diff --git a/src/server/network/protocol/protocolgame.cpp b/src/server/network/protocol/protocolgame.cpp index 30ff5e670dd..d241014cd16 100644 --- a/src/server/network/protocol/protocolgame.cpp +++ b/src/server/network/protocol/protocolgame.cpp @@ -4532,7 +4532,7 @@ void ProtocolGame::sendSaleItemList(const std::vector &shopVector, co msg.addByte(0xEE); msg.addByte(0x00); msg.add(player->getBankBalance()); - uint16_t currency = player->getShopOwner() ? player->getShopOwner()->getCurrency() : ITEM_GOLD_COIN; + uint16_t currency = player->getShopOwner() ? player->getShopOwner()->getCurrency() : static_cast(ITEM_GOLD_COIN); msg.addByte(0xEE); if (currency == ITEM_GOLD_COIN) { msg.addByte(0x01); @@ -6638,7 +6638,7 @@ void ProtocolGame::sendOutfitWindow() { } std::vector> mounts; - for (const auto mount : g_game().mounts.getMounts()) { + for (const auto &mount : g_game().mounts.getMounts()) { if (player->hasMount(mount)) { mounts.push_back(mount); } @@ -7256,7 +7256,7 @@ void ProtocolGame::AddCreature(NetworkMessage &msg, std::shared_ptr cr } auto bubble = creature->getSpeechBubble(); - msg.addByte(oldProtocol && bubble == SPEECHBUBBLE_HIRELING ? SPEECHBUBBLE_NONE : bubble); + msg.addByte(oldProtocol && bubble == SPEECHBUBBLE_HIRELING ? static_cast(SPEECHBUBBLE_NONE) : bubble); msg.addByte(0xFF); // MARK_UNMARKED if (!oldProtocol) { msg.addByte(0x00); // inspection type @@ -7539,7 +7539,7 @@ void ProtocolGame::updatePartyTrackerAnalyzer(const std::shared_ptr party msg.addByte(static_cast(party->priceType)); msg.addByte(static_cast(party->membersData.size())); - for (const std::shared_ptr analyzer : party->membersData) { + for (const std::shared_ptr &analyzer : party->membersData) { msg.add(analyzer->id); if (std::shared_ptr member = g_game().getPlayerByID(analyzer->id); !member || !member->getParty() || member->getParty() != party) { @@ -7558,7 +7558,7 @@ void ProtocolGame::updatePartyTrackerAnalyzer(const std::shared_ptr party msg.addByte(showNames ? 0x01 : 0x00); if (showNames) { msg.addByte(static_cast(party->membersData.size())); - for (const std::shared_ptr analyzer : party->membersData) { + for (const std::shared_ptr &analyzer : party->membersData) { msg.add(analyzer->id); msg.addString(analyzer->name, "ProtocolGame::updatePartyTrackerAnalyzer - analyzer->name"); } @@ -8397,7 +8397,7 @@ void ProtocolGame::parseSendBosstiarySlots() { std::string boostedBossName = g_ioBosstiary().getBoostedBossName(); const auto mTypeBoosted = g_monsters().getMonsterType(boostedBossName); auto boostedBossRace = mTypeBoosted ? mTypeBoosted->info.bosstiaryRace : BosstiaryRarity_t::BOSS_INVALID; - auto isValidBoostedBoss = boostedBossId == 0 || boostedBossRace >= BosstiaryRarity_t::RARITY_BANE && boostedBossRace <= BosstiaryRarity_t::RARITY_NEMESIS; + auto isValidBoostedBoss = boostedBossId == 0 || (boostedBossRace >= BosstiaryRarity_t::RARITY_BANE && boostedBossRace <= BosstiaryRarity_t::RARITY_NEMESIS); if (!isValidBoostedBoss) { g_logger().error("[{}] The boosted boss '{}' has an invalid race", __FUNCTION__, boostedBossName); return; @@ -8405,7 +8405,7 @@ void ProtocolGame::parseSendBosstiarySlots() { const auto mTypeSlotOne = g_ioBosstiary().getMonsterTypeByBossRaceId((uint16_t)bossIdSlotOne); auto bossRaceSlotOne = mTypeSlotOne ? mTypeSlotOne->info.bosstiaryRace : BosstiaryRarity_t::BOSS_INVALID; - auto isValidBossSlotOne = bossIdSlotOne == 0 || bossRaceSlotOne >= BosstiaryRarity_t::RARITY_BANE && bossRaceSlotOne <= BosstiaryRarity_t::RARITY_NEMESIS; + auto isValidBossSlotOne = bossIdSlotOne == 0 || (bossRaceSlotOne >= BosstiaryRarity_t::RARITY_BANE && bossRaceSlotOne <= BosstiaryRarity_t::RARITY_NEMESIS); if (!isValidBossSlotOne) { g_logger().error("[{}] boss slot1 with race id '{}' has an invalid race", __FUNCTION__, bossIdSlotOne); return; @@ -8413,7 +8413,7 @@ void ProtocolGame::parseSendBosstiarySlots() { const auto mTypeSlotTwo = g_ioBosstiary().getMonsterTypeByBossRaceId((uint16_t)bossIdSlotTwo); auto bossRaceSlotTwo = mTypeSlotTwo ? mTypeSlotTwo->info.bosstiaryRace : BosstiaryRarity_t::BOSS_INVALID; - auto isValidBossSlotTwo = bossIdSlotTwo == 0 || bossRaceSlotTwo >= BosstiaryRarity_t::RARITY_BANE && bossRaceSlotTwo <= BosstiaryRarity_t::RARITY_NEMESIS; + auto isValidBossSlotTwo = bossIdSlotTwo == 0 || (bossRaceSlotTwo >= BosstiaryRarity_t::RARITY_BANE && bossRaceSlotTwo <= BosstiaryRarity_t::RARITY_NEMESIS); if (!isValidBossSlotTwo) { g_logger().error("[{}] boss slot1 with race id '{}' has an invalid race", __FUNCTION__, bossIdSlotTwo); return;