1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-10 22:31:40 +02:00

Fix crash on using life drain with area attacks, like magog w life drain

This commit is contained in:
Ivan Savenko
2025-04-11 00:34:39 +03:00
parent 2f149b59ca
commit d150b3907d

View File

@@ -1557,7 +1557,12 @@ void BattleActionProcessor::addGenericDrainedLifeLog(BattleLogMessage& blm, cons
attackerState->addText(text, EMetaText::GENERAL_TXT, 361);
attackerState->addNameReplacement(text);
text.replaceNumber(drainedLife);
defender->addNameReplacement(text);
if (defender)
defender->addNameReplacement(text);
else
text.replaceTextID("core.genrltxt.43"); // creatures
blm.lines.push_back(std::move(text));
}