1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

#3142 - fi custom campaign selection screen

This commit is contained in:
Andrii Danylchenko
2023-11-04 14:34:07 +02:00
parent a8cc5e1d60
commit d50ebd7d58
2 changed files with 5 additions and 3 deletions

View File

@@ -1530,7 +1530,7 @@ void CGHeroInstance::afterAddToMap(CMap * map)
{
auto existingHero = std::find_if(map->objects.begin(), map->objects.end(), [&](const CGObjectInstance * o) ->bool
{
return (o->ID == Obj::HERO || o->ID == Obj::PRISON) && o->subID == subID && o != this;
return o && (o->ID == Obj::HERO || o->ID == Obj::PRISON) && o->subID == subID && o != this;
});
if(existingHero != map->objects.end())