1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-04 09:42:40 +02:00

Initialize random dwelling added to map

This commit is contained in:
godric3 2024-11-26 20:42:12 +01:00
parent 4180ea9523
commit fcf3679377

View File

@ -91,6 +91,20 @@ void Initializer::initialize(CGDwelling * o)
if(!o) return;
o->tempOwner = defaultPlayer;
if(o->ID == Obj::RANDOM_DWELLING || o->ID == Obj::RANDOM_DWELLING_LVL || o->ID == Obj::RANDOM_DWELLING_FACTION)
{
o->randomizationInfo = CGDwellingRandomizationInfo();
if(o->ID == Obj::RANDOM_DWELLING_LVL)
{
o->randomizationInfo->minLevel = o->subID;
o->randomizationInfo->maxLevel = o->subID;
}
if(o->ID == Obj::RANDOM_DWELLING_FACTION)
{
o->randomizationInfo->allowedFactions.insert(FactionID(o->subID));
}
}
}
void Initializer::initialize(CGGarrison * o)