mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Explicitly ban 'large' dwellings from random selection
Old code was relying on specific sorting order leading to easy to break logic
This commit is contained in:
@@ -146,7 +146,7 @@ void CGDwelling::pickRandomObject(CRandomGenerator & rand)
|
||||
{
|
||||
const auto * handler = dynamic_cast<const DwellingInstanceConstructor *>(VLC->objtypeh->getHandlerFor(primaryID, entry).get());
|
||||
|
||||
if (handler->producesCreature(cid.toCreature()))
|
||||
if (!handler->isBannedForRandomDwelling() && handler->producesCreature(cid.toCreature()))
|
||||
return MapObjectSubID(entry);
|
||||
}
|
||||
return MapObjectSubID();
|
||||
|
||||
Reference in New Issue
Block a user