1
0
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:
Ivan Savenko
2014-06-03 22:45:18 +03:00
143 changed files with 8788 additions and 8457 deletions

View File

@ -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
}
}