mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
vcmi: remove unused functions now
This commit is contained in:
@@ -96,7 +96,18 @@ TGoalVec GatherTroops::getAllPossibleSubgoals()
|
||||
auto creature = VLC->creatures()->getByIndex(objid);
|
||||
if(t->subID == creature->getFaction()) //TODO: how to force AI to build unupgraded creatures? :O
|
||||
{
|
||||
auto creatures = vstd::tryAt(t->town->creatures, creature->getLevel() - 1);
|
||||
auto tryFindCreature = [&]() -> std::optional<std::vector<CreatureID>>
|
||||
{
|
||||
if(vstd::isValidIndex(t->town->creatures, creature->getLevel() - 1))
|
||||
{
|
||||
auto itr = t->town->creatures.begin();
|
||||
std::advance(itr, creature->getLevel() - 1);
|
||||
return make_optional(*itr);
|
||||
}
|
||||
return std::nullopt;
|
||||
};
|
||||
|
||||
auto creatures = tryFindCreature();
|
||||
if(!creatures)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user