1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Merge pull request #1111 from GermanAizek/develop

Code refactor and fix condition bug
This commit is contained in:
Andrii Danylchenko
2022-11-15 09:23:16 +02:00
committed by GitHub
27 changed files with 48 additions and 47 deletions

View File

@ -532,7 +532,7 @@ std::pair<Obj,int> CGameState::pickObject (CGObjectInstance *obj)
if (auto info = dynamic_cast<CCreGenAsCastleInfo*>(dwl->info))
{
faction = getRandomGenerator().nextInt((int)VLC->townh->size() - 1);
if(info->asCastle && info->instanceId != "")
if(info->asCastle && !info->instanceId.empty())
{
auto iter = map->instanceNames.find(info->instanceId);