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:
parent
53fcd3ad26
commit
9cf3db4eb5
@ -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