浏览代码

Fix crash on AI capturing artifacts in battle while covered by FoW

Ivan Savenko 4 月之前
父节点
当前提交
099a168158
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      client/NetPacksClient.cpp

+ 2 - 2
client/NetPacksClient.cpp

@@ -828,7 +828,7 @@ void ApplyClientNetPackVisitor::visitBattleResultsApplied(BattleResultsApplied &
 {
 {
 	if(!pack.learnedSpells.spells.empty())
 	if(!pack.learnedSpells.spells.empty())
 	{
 	{
-		const auto hero = GAME->interface()->cb->getHero(pack.learnedSpells.hid);
+		const auto * hero = cl.gameInfo().getHero(pack.learnedSpells.hid);
 		assert(hero);
 		assert(hero);
 		callInterfaceIfPresent(cl, pack.victor, &CGameInterface::showInfoDialog, EInfoWindowMode::MODAL,
 		callInterfaceIfPresent(cl, pack.victor, &CGameInterface::showInfoDialog, EInfoWindowMode::MODAL,
 			UIHelper::getEagleEyeInfoWindowText(*hero, pack.learnedSpells.spells), UIHelper::getSpellsComponents(pack.learnedSpells.spells), soundBase::soundID(0));
 			UIHelper::getEagleEyeInfoWindowText(*hero, pack.learnedSpells.spells), UIHelper::getSpellsComponents(pack.learnedSpells.spells), soundBase::soundID(0));
@@ -836,7 +836,7 @@ void ApplyClientNetPackVisitor::visitBattleResultsApplied(BattleResultsApplied &
 
 
 	if(!pack.movingArtifacts.empty())
 	if(!pack.movingArtifacts.empty())
 	{
 	{
-		const auto artSet = GAME->interface()->cb->getArtSet(ArtifactLocation(pack.movingArtifacts.front().dstArtHolder));
+		const auto * artSet = cl.gameState().getArtSet(ArtifactLocation(pack.movingArtifacts.front().dstArtHolder));
 		assert(artSet);
 		assert(artSet);
 		std::vector<Component> artComponents;
 		std::vector<Component> artComponents;
 		for(const auto & artPack : pack.movingArtifacts)
 		for(const auto & artPack : pack.movingArtifacts)