mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-26 08:41:13 +02:00
Merge pull request #3750 from IvanSavenko/fix_quest_crash
Fix crash on accessing nullptr quest
This commit is contained in:
commit
e1581087c3
@ -1199,13 +1199,9 @@ void RemoveObject::applyGs(CGameState *gs)
|
||||
gs->map->quests[quest->quest->qid] = nullptr;
|
||||
for (auto &player : gs->players)
|
||||
{
|
||||
for (auto &q : player.second.quests)
|
||||
{
|
||||
if (q.obj == obj)
|
||||
{
|
||||
q.obj = nullptr;
|
||||
}
|
||||
}
|
||||
vstd::erase_if(player.second.quests, [obj](const QuestInfo & q){
|
||||
return q.obj == obj;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user