1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Completely remove dead quest instead of leaving nullptr

All code that uses this container assumes non-null content
This commit is contained in:
Ivan Savenko 2024-04-11 23:56:29 +03:00
parent 53fcd3ad26
commit 9cf3db4eb5

View File

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