mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Fix crash on AI capturing artifacts in battle while covered by FoW
This commit is contained in:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user