Explorar el Código

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

Ivan Savenko hace 6 meses
padre
commit
d150b3907d
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      server/battles/BattleActionProcessor.cpp

+ 6 - 1
server/battles/BattleActionProcessor.cpp

@@ -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));
 }