From 1f3be342fe7290e396193655c1c313d7858bfea5 Mon Sep 17 00:00:00 2001 From: Aerwix <26527255+Aerwix@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:48:16 -0600 Subject: [PATCH 1/4] fix-message-as-attacker --- src/game/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 4018c1b2f90..ff7492ff501 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -7614,7 +7614,7 @@ void Game::buildMessageAsAttacker( std::stringstream &ss, const std::string &damageString ) const { ss.str({}); - ss << ucfirst(target->getNameDescription()) << " loses " << damageString << " due to your " << (damage.critical ? "critical " : " ") << "attack."; + ss << ucfirst(target->getNameDescription()) << " loses " << damageString << " due to your" << (damage.critical ? " critical" : "") << " attack."; if (damage.extension) { ss << " " << damage.exString; } From 87fecc61fa5a245639196c81a26885e8f002cd94 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 31 Oct 2024 20:48:49 +0000 Subject: [PATCH 2/4] Code format - (Clang-format) --- src/creatures/monsters/spawns/spawn_monster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/creatures/monsters/spawns/spawn_monster.cpp b/src/creatures/monsters/spawns/spawn_monster.cpp index 153db66dee4..7d7bbc84e34 100644 --- a/src/creatures/monsters/spawns/spawn_monster.cpp +++ b/src/creatures/monsters/spawns/spawn_monster.cpp @@ -327,7 +327,7 @@ void SpawnMonster::scheduleSpawn(uint32_t spawnMonsterId, spawnBlock_t &sb, cons } void SpawnMonster::cleanup() { - for (auto it = spawnedMonsterMap.begin(); it != spawnedMonsterMap.end(); ) { + for (auto it = spawnedMonsterMap.begin(); it != spawnedMonsterMap.end();) { const auto &monster = it->second; if (!monster || monster->isRemoved()) { auto spawnIt = spawnMonsterMap.find(it->first); From e83715638b5987bce71089ae5a3e6653dccc04f9 Mon Sep 17 00:00:00 2001 From: Aerwix <26527255+Aerwix@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:41:18 -0600 Subject: [PATCH 3/4] Fix Mana Messages for Attacker, Target and Spectators --- src/game/game.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index ff7492ff501..7652601df9e 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -7271,7 +7271,7 @@ bool Game::combatChangeHealth(const std::shared_ptr &attacker, const s } } - std::string attackMsg = fmt::format("{} attack", damage.critical ? "critical " : " "); + std::string attackMsg = fmt::format("{} attack", damage.critical ? " critical" : ""); std::stringstream ss; if (target->hasCondition(CONDITION_MANASHIELD) && damage.primary.type != COMBAT_UNDEFINEDDAMAGE) { @@ -7325,7 +7325,7 @@ bool Game::combatChangeHealth(const std::shared_ptr &attacker, const s if (tmpPlayer == attackerPlayer && attackerPlayer != targetPlayer) { ss.str({}); - ss << ucfirst(target->getNameDescription()) << " loses " << damageString + " mana due to your " << attackMsg << "."; + ss << ucfirst(target->getNameDescription()) << " loses " << damageString + " mana due to your" << attackMsg << "."; // Probar if (!damage.exString.empty()) { ss << " (" << damage.exString << ")"; @@ -7340,7 +7340,7 @@ bool Game::combatChangeHealth(const std::shared_ptr &attacker, const s } else if (targetPlayer == attackerPlayer) { ss << " due to your own " << attackMsg << "."; } else { - ss << " due to an " << attackMsg << " by " << attacker->getNameDescription() << '.'; + ss << " due to an" << attackMsg << " by " << attacker->getNameDescription() << '.'; } message.type = MESSAGE_DAMAGE_RECEIVED; message.text = ss.str(); @@ -7353,7 +7353,7 @@ bool Game::combatChangeHealth(const std::shared_ptr &attacker, const s if (attacker == target) { ss << (targetPlayer ? targetPlayer->getPossessivePronoun() : "its") << " own attack"; } else { - ss << "an " << attackMsg << " by " << attacker->getNameDescription(); + ss << "an" << attackMsg << " by " << attacker->getNameDescription(); } } ss << '.'; @@ -7572,7 +7572,7 @@ void Game::buildMessageAsSpectator( ss << "its own " << attackMsg << "attack"; } } else { - ss << article << " " << attackMsg << "attack by " << attacker->getNameDescription(); + ss << article << "" << attackMsg << "attack by " << attacker->getNameDescription(); } } ss << '.'; From 3d95ba45eec5469febee3a721b719a2c83a98a84 Mon Sep 17 00:00:00 2001 From: Aerwix <26527255+Aerwix@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:55:25 -0600 Subject: [PATCH 4/4] removing my notes --- src/game/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 73f970e7cbd..1831b4fcc54 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -7325,7 +7325,7 @@ bool Game::combatChangeHealth(const std::shared_ptr &attacker, const s if (tmpPlayer == attackerPlayer && attackerPlayer != targetPlayer) { ss.str({}); - ss << ucfirst(target->getNameDescription()) << " loses " << damageString + " mana due to your" << attackMsg << "."; // Probar + ss << ucfirst(target->getNameDescription()) << " loses " << damageString + " mana due to your" << attackMsg << "."; if (!damage.exString.empty()) { ss << " (" << damage.exString << ")";