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: colored text loot in OTC 13.40 #2929

Merged
merged 1 commit into from
Oct 2, 2024
Merged
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/creatures/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@

for (const auto &despawnCreature : despawnMonsterList) {
if (!despawnMonsterList.empty()) {
g_game().removeCreature(despawnCreature, true);

Check warning on line 469 in src/creatures/creature.cpp

View workflow job for this annotation

GitHub Actions / qodana

err33-c

the value returned by this function should not be disregarded; neglecting it may lead to errors
}
}
}
Expand Down Expand Up @@ -751,7 +751,7 @@
death(lastHitCreature);

if (droppedCorpse && !getPlayer()) {
g_game().removeCreature(static_self_cast<Creature>(), false);

Check warning on line 754 in src/creatures/creature.cpp

View workflow job for this annotation

GitHub Actions / qodana

err33-c

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

if (getMaster()) {
Expand All @@ -759,7 +759,7 @@
}
}

bool Creature::dropCorpse(std::shared_ptr<Creature> lastHitCreature, std::shared_ptr<Creature> mostDamageCreature, bool lastHitUnjustified, bool mostDamageUnjustified) {

Check warning on line 762 in src/creatures/creature.cpp

View workflow job for this annotation

GitHub Actions / qodana

function-cognitive-complexity

function 'dropCorpse' has cognitive complexity of 44 (threshold 25)
metrics::method_latency measure(__METHOD_NAME__);
if (!lootDrop && getMonster()) {
if (getMaster()) {
Expand Down Expand Up @@ -809,7 +809,7 @@
auto monster = getMonster();
if (monster && !monster->isRewardBoss()) {
std::ostringstream lootMessage;
auto collorMessage = player->getProtocolVersion() > 1200 && player->getOperatingSystem() < CLIENTOS_OTCLIENT_LINUX;
auto collorMessage = player->getProtocolVersion() > 1200;
lootMessage << "Loot of " << getNameDescription() << ": " << corpseContainer->getContentDescription(collorMessage) << ".";
auto suffix = corpseContainer->getAttribute<std::string>(ItemAttribute_t::LOOTMESSAGE_SUFFIX);
if (!suffix.empty()) {
Expand Down Expand Up @@ -1805,14 +1805,14 @@
if (teleportSummons) {
g_game().internalTeleport(static_self_cast<Creature>(), getMaster()->getPosition(), true);
} else {
g_game().removeCreature(static_self_cast<Creature>(), true);

Check warning on line 1808 in src/creatures/creature.cpp

View workflow job for this annotation

GitHub Actions / qodana

err33-c

the value returned by this function should not be disregarded; neglecting it may lead to errors
}
g_game().addMagicEffect(getPosition(), CONST_ME_POFF);
}

double_t Creature::getReflectPercent(CombatType_t combatType, bool useCharges /*= false*/) const {
try {
return reflectPercent.at(combatTypeToIndex(combatType));

Check warning on line 1815 in src/creatures/creature.cpp

View workflow job for this annotation

GitHub Actions / qodana

misra-cpp2008-5-0-5

MISRA 5-0-5: There shall be no implicit floating-integral conversions
} catch (const std::out_of_range &e) {
g_logger().error("Index is out of range in getReflectPercent: {}", e.what());
}
Expand Down
Loading