1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-21 17:17:06 +02:00

Remove objects deleted by event from owned objects list

This commit is contained in:
Dydzio 2024-09-29 00:10:09 +02:00
parent 3bff68958e
commit 99f49ee6ad

View File

@ -1224,6 +1224,9 @@ void RemoveObject::applyGs(CGameState *gs)
}
}
if(initiator == PlayerColor::NEUTRAL && obj->tempOwner.isValidPlayer())
gs->getPlayerState(obj->tempOwner)->removeOwnedObject(obj); //object removed via map event
gs->map->instanceNames.erase(obj->instanceName);
gs->map->objects[objectID.getNum()].dellNull();
gs->map->calculateGuardingGreaturePositions();//FIXME: excessive, update only affected tiles