Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable irrelevant informations #2910

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
} else if (blockType == BLOCK_DODGE) {
g_game().addMagicEffect(targetPos, CONST_ME_DODGE);
} else if (blockType == BLOCK_IMMUNITY) {
uint8_t hitEffect = 0;

Check warning on line 69 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
switch (combatType) {
case COMBAT_UNDEFINEDDAMAGE: {
return;
Expand All @@ -76,19 +76,19 @@
case COMBAT_PHYSICALDAMAGE:
case COMBAT_ICEDAMAGE:
case COMBAT_DEATHDAMAGE: {
hitEffect = CONST_ME_BLOCKHIT;

Check warning on line 79 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
break;
}
case COMBAT_EARTHDAMAGE: {
hitEffect = CONST_ME_GREEN_RINGS;

Check warning on line 83 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
break;
}
case COMBAT_HOLYDAMAGE: {
hitEffect = CONST_ME_HOLYDAMAGE;

Check warning on line 87 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
break;
}
default: {
hitEffect = CONST_ME_POFF;

Check warning on line 91 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
break;
}
}
Expand Down Expand Up @@ -191,8 +191,8 @@
offlineTrainingWindow.choices.emplace_back("Magic Level and Shielding", SKILL_MAGLEVEL);
offlineTrainingWindow.buttons.emplace_back("Okay", 1);
offlineTrainingWindow.buttons.emplace_back("Cancel", 0);
offlineTrainingWindow.defaultEscapeButton = 1;

Check warning on line 194 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
offlineTrainingWindow.defaultEnterButton = 0;

Check warning on line 195 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
offlineTrainingWindow.priority = true;

// Create instance of IOWheel to Game class
Expand Down Expand Up @@ -709,7 +709,7 @@

// container
if (pos.y & 0x40) {
uint8_t from_cid = pos.y & 0x0F;

Check warning on line 712 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
return player->getContainerByID(from_cid);
}

Expand Down Expand Up @@ -796,7 +796,7 @@

// container
if (pos.y & 0x40) {
uint8_t fromCid = pos.y & 0x0F;

Check warning on line 799 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values

std::shared_ptr<Container> parentContainer = player->getContainerByID(fromCid);
if (!parentContainer) {
Expand Down Expand Up @@ -860,7 +860,7 @@
pos.x = 0;
pos.y = 0;
pos.z = 0;
stackpos = 0;

Check warning on line 863 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values

std::shared_ptr<Cylinder> topParent = item->getTopParent();
if (topParent) {
Expand All @@ -870,15 +870,15 @@
std::shared_ptr<Container> container = std::dynamic_pointer_cast<Container>(item->getParent());
if (container) {
pos.y = static_cast<uint16_t>(0x40) | static_cast<uint16_t>(player->getContainerID(container));
pos.z = container->getThingIndex(item);

Check warning on line 873 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
stackpos = pos.z;
} else {
pos.y = player->getThingIndex(item);
stackpos = pos.y;

Check warning on line 877 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
}
} else if (std::shared_ptr<Tile> tile = topParent->getTile()) {
pos = tile->getPosition();
stackpos = tile->getThingIndex(item);

Check warning on line 881 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
}
}
}
Expand Down Expand Up @@ -988,7 +988,7 @@
return nullptr;
}
std::shared_ptr<Player> tmpPlayer = std::make_shared<Player>(nullptr);
if (!IOLoginData::loadPlayerByName(tmpPlayer, s)) {
if (!IOLoginData::loadPlayerByName(tmpPlayer, s, allowOffline)) {
if (!isNewName) {
g_logger().error("Failed to load player {} from database", s);
} else {
Expand Down Expand Up @@ -1308,7 +1308,7 @@
return;
}

uint8_t fromIndex = 0;

Check warning on line 1311 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
if (fromPos.x == 0xFFFF) {
if (fromPos.y & 0x40) {
fromIndex = fromPos.z;
Expand Down Expand Up @@ -1472,7 +1472,7 @@
player->setLastPosition(player->getPosition());
}

ReturnValue Game::internalMoveCreature(std::shared_ptr<Creature> creature, Direction direction, uint32_t flags /*= 0*/) {

Check warning on line 1475 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

function-cognitive-complexity

function 'internalMoveCreature' has cognitive complexity of 36 (threshold 25)
if (!creature) {
return RETURNVALUE_NOTPOSSIBLE;
}
Expand All @@ -1491,9 +1491,9 @@
// try go up
auto tile = creature->getTile();
if (currentPos.z != 8 && tile && tile->hasHeight(3)) {
std::shared_ptr<Tile> tmpTile = map.getTile(currentPos.x, currentPos.y, currentPos.getZ() - 1);

Check warning on line 1494 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
if (tmpTile == nullptr || (tmpTile->getGround() == nullptr && !tmpTile->hasFlag(TILESTATE_BLOCKSOLID))) {
tmpTile = map.getTile(destPos.x, destPos.y, destPos.getZ() - 1);

Check warning on line 1496 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
if (tmpTile && tmpTile->getGround() && !tmpTile->hasFlag(TILESTATE_BLOCKSOLID)) {
flags |= FLAG_IGNOREBLOCKITEM | FLAG_IGNOREBLOCKCREATURE;

Expand All @@ -1509,7 +1509,7 @@
if (currentPos.z != 7 && currentPos.z == destPos.z) {
std::shared_ptr<Tile> tmpTile = map.getTile(destPos.x, destPos.y, destPos.z);
if (tmpTile == nullptr || (tmpTile->getGround() == nullptr && !tmpTile->hasFlag(TILESTATE_BLOCKSOLID))) {
tmpTile = map.getTile(destPos.x, destPos.y, destPos.z + 1);

Check warning on line 1512 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
if (tmpTile && tmpTile->hasHeight(3)) {
flags |= FLAG_IGNOREBLOCKITEM | FLAG_IGNOREBLOCKCREATURE;
player->setDirection(direction);
Expand Down Expand Up @@ -1614,7 +1614,7 @@
player->setNextActionTask(nullptr);

if (item == nullptr) {
uint8_t fromIndex = 0;

Check warning on line 1617 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
if (fromPos.x == 0xFFFF) {
if (fromPos.y & 0x40) {
fromIndex = fromPos.z;
Expand Down Expand Up @@ -1788,7 +1788,7 @@
return;
}

uint8_t toIndex = 0;

Check warning on line 1791 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
if (toPos.x == 0xFFFF) {
if (toPos.y & 0x40) {
toIndex = toPos.z;
Expand Down Expand Up @@ -2082,7 +2082,7 @@
int32_t newCount = m - n;
if (newCount > 0) {
moveItem = item->clone();
moveItem->setItemCount(newCount);

Check warning on line 2085 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
} else {
moveItem = nullptr;
}
Expand Down Expand Up @@ -2242,7 +2242,7 @@
if (count > 0) {
if (item->getItemCount() != count) {
std::shared_ptr<Item> remainderItem = item->clone();
remainderItem->setItemCount(count);

Check warning on line 2245 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
if (internalAddItem(destCylinder, remainderItem, INDEX_WHEREEVER, flags, false) != RETURNVALUE_NOERROR) {
remainderCount = count;
}
Expand Down Expand Up @@ -3520,7 +3520,7 @@
return;
}

g_chat().removeUserFromChannel(player, channelId);

Check warning on line 3523 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

err33-c

the value returned by this function should not be disregarded; neglecting it may lead to errors
}

void Game::playerOpenPrivateChannel(uint32_t playerId, std::string &receiver) {
Expand Down Expand Up @@ -4001,7 +4001,7 @@
player->setNextActionTask(nullptr);
}

g_actions().useItemEx(player, fromPos, creature->getPosition(), creature->getParent()->getThingIndex(creature), item, isHotkey, creature);

Check warning on line 4004 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
}

void Game::playerCloseContainer(uint32_t playerId, uint8_t cid) {
Expand Down Expand Up @@ -4253,7 +4253,7 @@

if (!player->canWear(outfit.lookType, outfit.lookAddons)) {
outfit.lookType = 0;
outfit.lookAddons = 0;

Check warning on line 4256 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
}

const auto mount = mounts.getMountByClientID(outfit.lookMount);
Expand Down Expand Up @@ -4583,7 +4583,7 @@
container = it->second.lock();
}

uint8_t dummyContainerId = 0xF - ((pos.x % 3) * 3 + (pos.y % 3));

Check warning on line 4586 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
std::shared_ptr<Container> openContainer = player->getContainerByID(dummyContainerId);
if (openContainer) {
player->onCloseContainer(openContainer);
Expand Down Expand Up @@ -4631,7 +4631,7 @@
// Refresh depot search window if necessary
if (player->isDepotSearchOpenOnItem(itemId)) {
// Tier for item stackable is 0
player->requestDepotSearchItem(itemId, 0);

Check warning on line 4634 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
}
}

Expand Down Expand Up @@ -4704,7 +4704,7 @@

// Refresh depot search window if necessary
if (player->isDepotSearchOpenOnItem(itemId)) {
player->requestDepotSearchItem(itemId, 0);

Check warning on line 4707 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
}

player->sendOpenStash(true);
Expand Down Expand Up @@ -5101,7 +5101,7 @@

std::vector<std::shared_ptr<Container>> containers { tradeContainer };
size_t i = 0;
while (i < containers.size()) {

Check warning on line 5104 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

id-dependent-backward-branch

backward branch (while loop) is ID-dependent due to variable reference to 'containers' and may cause performance degradation
std::shared_ptr<Container> container = containers[i++];
for (const std::shared_ptr<Item> &item : container->getItemList()) {
std::shared_ptr<Container> tmpContainer = item->getContainer();
Expand Down Expand Up @@ -5469,7 +5469,7 @@
ss << "Attention! The container for " << getObjectCategoryName(category) << " is full.";
} else {
if (ret == RETURNVALUE_NOERROR) {
player->sendLootStats(item, item->getItemCount());

Check warning on line 5472 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
ss << "You looted ";
} else {
ss << "You could not loot ";
Expand Down Expand Up @@ -5677,7 +5677,7 @@
return;
}

player->setDepotSearchIsOpen(0, 0);

Check warning on line 5680 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
player->sendCloseDepotSearch();
}

Expand Down Expand Up @@ -5836,7 +5836,7 @@
return;
}

player->vip()->remove(guid);

Check warning on line 5839 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

err33-c

the value returned by this function should not be disregarded; neglecting it may lead to errors
}

void Game::playerRequestEditVip(uint32_t playerId, uint32_t guid, const std::string &description, uint32_t icon, bool notify, std::vector<uint8_t> vipGroupsId) {
Expand Down Expand Up @@ -5956,7 +5956,7 @@

if (player->isWearingSupportOutfit()) {
outfit.lookMount = 0;
isMountRandomized = 0;

Check warning on line 5959 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
}

player->setRandomMount(isMountRandomized);
Expand Down Expand Up @@ -6620,7 +6620,7 @@
InternalGame::sendBlockEffect(secondaryBlockType, damage.secondary.type, target->getPosition(), attacker);

if (!damage.extension && attacker && target->getMonster()) {
int32_t secondaryReflectPercent = target->getReflectPercent(damage.secondary.type, true);

Check warning on line 6623 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

narrowing-conversions

narrowing conversion from 'double_t' (aka 'double') to 'int32_t' (aka 'int')
int32_t secondaryReflectFlat = target->getReflectFlat(damage.secondary.type, true);
if (secondaryReflectPercent > 0 || secondaryReflectFlat > 0) {
if (!canReflect) {
Expand Down Expand Up @@ -7082,8 +7082,8 @@
if (targetPos.z == attackerPos.z) {
int32_t distanceX = Position::getDistanceX(targetPos, attackerPos);
int32_t distanceY = Position::getDistanceY(targetPos, attackerPos);
int32_t damageX = attackerPlayer->getPerfectShotDamage(distanceX, true);

Check warning on line 7085 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
int32_t damageY = attackerPlayer->getPerfectShotDamage(distanceY, true);

Check warning on line 7086 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
std::shared_ptr<Item> item = attackerPlayer->getWeapon();
if (item && item->getWeaponType() == WEAPON_DISTANCE) {
std::shared_ptr<Item> quiver = attackerPlayer->getInventoryItem(CONST_SLOT_RIGHT);
Expand Down Expand Up @@ -7941,13 +7941,13 @@
}

if (newLightLevel <= LIGHT_LEVEL_NIGHT) {
lightLevel = LIGHT_LEVEL_NIGHT;

Check warning on line 7944 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
lightState = LIGHT_STATE_NIGHT;
} else if (newLightLevel >= LIGHT_LEVEL_DAY) {
lightLevel = LIGHT_LEVEL_DAY;

Check warning on line 7947 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
lightState = LIGHT_STATE_DAY;
} else {
lightLevel = newLightLevel;

Check warning on line 7950 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
}

LightInfo lightInfo = getWorldLightInfo();
Expand All @@ -7971,7 +7971,7 @@
}

LightInfo Game::getWorldLightInfo() const {
return { lightLevel, 0xD7 };

Check warning on line 7974 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
}

bool Game::gameIsDay() {
Expand Down Expand Up @@ -8318,7 +8318,7 @@
uint32_t playerGUID = player->getGUID();
if (characterID != playerGUID) {
// For now allow viewing only our character since we don't have tournaments supported
player->sendCyclopediaCharacterNoData(characterInfoType, 2);

Check warning on line 8321 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
return;
}

Expand Down Expand Up @@ -8367,7 +8367,7 @@
player->sendCyclopediaCharacterTitles();
break;
default:
player->sendCyclopediaCharacterNoData(characterInfoType, 1);

Check warning on line 8370 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
break;
}
}
Expand Down Expand Up @@ -8890,7 +8890,7 @@
}

// Do not register a transaction for coins creating an offer
player->getAccount()->removeCoins(enumToValue(CoinType::Transferable), static_cast<uint32_t>(amount), "");

Check warning on line 8893 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

err33-c

the value returned by this function should not be disregarded; neglecting it may lead to errors
} else {
if (!removeOfferItems(player, depotLocker, it, amount, tier, offerStatus)) {
g_logger().error("[{}] failed to remove item with id {}, from player {}, errorcode: {}", __FUNCTION__, it.id, player->getName(), offerStatus.str());
Expand Down Expand Up @@ -9095,7 +9095,7 @@
return;
}

player->getAccount()->removeCoins(

Check warning on line 9098 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

err33-c

the value returned by this function should not be disregarded; neglecting it may lead to errors
enumToValue(CoinType::Transferable),
amount,
"Sold on Market"
Expand Down Expand Up @@ -9371,7 +9371,7 @@

player->updateUIExhausted();

uint8_t coreCount = (usedCore ? 1 : 0) + (reduceTierLoss ? 1 : 0);

Check warning on line 9374 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
auto baseSuccess = static_cast<uint8_t>(g_configManager().getNumber(FORGE_BASE_SUCCESS_RATE, __FUNCTION__));
auto coreSuccess = usedCore ? g_configManager().getNumber(FORGE_BONUS_SUCCESS_RATE, __FUNCTION__) : 0;
auto finalRate = baseSuccess + coreSuccess;
Expand All @@ -9380,7 +9380,7 @@
bool success = roll ? true : false;

auto chance = uniform_random(0, 10000);
uint8_t bonus = convergence ? 0 : forgeBonus(chance);

Check warning on line 9383 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values

player->forgeFuseItems(actionType, firstItemId, tier, secondItemId, success, reduceTierLoss, convergence, bonus, coreCount);
}
Expand Down Expand Up @@ -9664,14 +9664,14 @@
}

std::map<Slots_t, std::shared_ptr<Item>> itemsWithImbueSlotMap;
for (uint8_t inventorySlot = CONST_SLOT_FIRST; inventorySlot <= CONST_SLOT_LAST; ++inventorySlot) {

Check warning on line 9667 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
auto item = player->getInventoryItem(static_cast<Slots_t>(inventorySlot));
if (!item) {
continue;
}

uint8_t imbuementSlot = item->getImbuementSlot();
for (uint8_t slot = 0; slot < imbuementSlot; slot++) {

Check warning on line 9674 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
ImbuementInfo imbuementInfo;
if (!item->getImbuementInfo(slot, &imbuementInfo)) {
continue;
Expand Down Expand Up @@ -10124,15 +10124,15 @@
}

monster->clearFiendishStatus();
removeFiendishMonster(monsterId, false);

Check warning on line 10127 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

err33-c

the value returned by this function should not be disregarded; neglecting it may lead to errors
makeFiendishMonster();
}

bool Game::removeForgeMonster(uint32_t id, ForgeClassifications_t monsterForgeClassification, bool create) {
if (monsterForgeClassification == ForgeClassifications_t::FORGE_FIENDISH_MONSTER) {
removeFiendishMonster(id, create);

Check warning on line 10133 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

err33-c

the value returned by this function should not be disregarded; neglecting it may lead to errors
} else if (monsterForgeClassification == ForgeClassifications_t::FORGE_INFLUENCED_MONSTER) {
removeInfluencedMonster(id, create);

Check warning on line 10135 in src/game/game.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

err33-c

the value returned by this function should not be disregarded; neglecting it may lead to errors
}

return true;
Expand Down
8 changes: 4 additions & 4 deletions src/io/iologindata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
query << "SELECT `type` FROM `accounts` WHERE `id` = " << accountId;
DBResult_ptr result = Database::getInstance().storeQuery(query.str());
if (!result) {
return ACCOUNT_TYPE_NORMAL;

Check warning on line 72 in src/io/iologindata.cpp

View workflow job for this annotation

GitHub Actions / Qodana for C/C++

misra-cpp2008-5-0-11

MISRA 5-0-11: The plain char type shall only be used for the storage and use of character values
}

return result->getNumber<uint8_t>("type");
Expand Down Expand Up @@ -123,6 +123,10 @@
// Experience load
IOLoginDataLoad::loadPlayerExperience(player, result);

if (disableIrrelevantInfo) {
return true;
}

// Blessings load
IOLoginDataLoad::loadPlayerBlessings(player, result);

Expand Down Expand Up @@ -180,10 +184,6 @@
// Load instant spells list
IOLoginDataLoad::loadPlayerInstantSpellList(player, result);

if (disableIrrelevantInfo) {
return true;
}

// load forge history
IOLoginDataLoad::loadPlayerForgeHistory(player, result);

Expand Down
Loading