mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-05 00:49:09 +02:00
Renamed LibClasses * VLC
to GameLibrary * LIBRARY
This commit is contained in:
@ -747,7 +747,7 @@ CGCreature * ObjectManager::chooseGuard(si32 strength, bool zoneGuard)
|
||||
CreatureID creId = CreatureID::NONE;
|
||||
int amount = 0;
|
||||
std::vector<CreatureID> possibleCreatures;
|
||||
for(auto const & cre : VLC->creh->objects)
|
||||
for(auto const & cre : LIBRARY->creh->objects)
|
||||
{
|
||||
if(cre->special)
|
||||
continue;
|
||||
@ -763,17 +763,17 @@ CGCreature * ObjectManager::chooseGuard(si32 strength, bool zoneGuard)
|
||||
if(!possibleCreatures.empty())
|
||||
{
|
||||
creId = *RandomGeneratorUtil::nextItem(possibleCreatures, zone.getRand());
|
||||
amount = strength / creId.toEntity(VLC)->getAIValue();
|
||||
amount = strength / creId.toEntity(LIBRARY)->getAIValue();
|
||||
if (amount >= 4)
|
||||
amount = static_cast<int>(amount * zone.getRand().nextDouble(0.75, 1.25));
|
||||
}
|
||||
else //just pick any available creature
|
||||
{
|
||||
creId = CreatureID::AZURE_DRAGON; //Azure Dragon
|
||||
amount = strength / creId.toEntity(VLC)->getAIValue();
|
||||
amount = strength / creId.toEntity(LIBRARY)->getAIValue();
|
||||
}
|
||||
|
||||
auto guardFactory = VLC->objtypeh->getHandlerFor(Obj::MONSTER, creId);
|
||||
auto guardFactory = LIBRARY->objtypeh->getHandlerFor(Obj::MONSTER, creId);
|
||||
|
||||
auto * guard = dynamic_cast<CGCreature *>(guardFactory->create(map.mapInstance->cb, nullptr));
|
||||
guard->character = CGCreature::HOSTILE;
|
||||
|
Reference in New Issue
Block a user