mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Merged changes from upstream and fixed compilation caused by API changes
This commit is contained in:
@ -20,10 +20,7 @@ PlayerInfo::PlayerInfo(): canHumanPlay(false), canComputerPlay(false),
|
||||
aiTactic(EAiTactic::RANDOM), isFactionRandom(false), mainCustomHeroPortrait(-1), mainCustomHeroId(-1), hasMainTown(false),
|
||||
generateHeroAtMainTown(false), team(255), hasRandomHero(false), /* following are unused */ generateHero(false), p7(0), powerPlaceholders(-1)
|
||||
{
|
||||
auto allowed = VLC->townh->getDefaultAllowed();
|
||||
for (size_t i=0; i<allowed.size(); i++)
|
||||
if (allowed[i])
|
||||
allowedFactions.insert(i);
|
||||
allowedFactions = VLC->townh->getAllowedFactions();
|
||||
}
|
||||
|
||||
si8 PlayerInfo::defaultCastle() const
|
||||
@ -427,7 +424,7 @@ const CGObjectInstance * CMap::getObjectiveObjectFrom(int3 pos, Obj::EObj type)
|
||||
bestMatch = object;
|
||||
else
|
||||
{
|
||||
if (object->pos.dist2d(pos) < bestMatch->pos.dist2d(pos))
|
||||
if (object->pos.dist2dSQ(pos) < bestMatch->pos.dist2dSQ(pos))
|
||||
bestMatch = object;// closer than one we already found
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user