mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-13 13:18:43 +02:00
Merge pull request #4538 from kaja47/fix-crash-when-losing
fix crash when computer player loses
This commit is contained in:
commit
07ce8ae1ab
@ -1066,10 +1066,13 @@ void CGameHandler::setOwner(const CGObjectInstance * obj, const PlayerColor owne
|
||||
|
||||
if ((obj->ID == Obj::CREATURE_GENERATOR1 || obj->ID == Obj::CREATURE_GENERATOR4))
|
||||
{
|
||||
for (const CGTownInstance * t : getPlayerState(owner)->getTowns())
|
||||
if (owner.isValidPlayer())
|
||||
{
|
||||
if (t->hasBuilt(BuildingSubID::PORTAL_OF_SUMMONING))
|
||||
setPortalDwelling(t);//set initial creatures for all portals of summoning
|
||||
for (const CGTownInstance * t : getPlayerState(owner)->getTowns())
|
||||
{
|
||||
if (t->hasBuilt(BuildingSubID::PORTAL_OF_SUMMONING))
|
||||
setPortalDwelling(t);//set initial creatures for all portals of summoning
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user