mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-18 17:40:48 +02:00
Fix RMG bug with incorrect town placement (#779)
* Fix RMG bug with incorrect town placement * Readability tweak
This commit is contained in:
parent
30aaee30b4
commit
4844310a89
@ -142,11 +142,11 @@ void registerTypesMapObjectTypes(Serializer &s)
|
||||
s.template registerType<IUpdater, GrowsWithLevelUpdater>();
|
||||
s.template registerType<IUpdater, TimesHeroLevelUpdater>();
|
||||
s.template registerType<IUpdater, TimesStackLevelUpdater>();
|
||||
s.template registerType<IUpdater, OwnerUpdater>();
|
||||
|
||||
s.template registerType<ILimiter, AnyOfLimiter>();
|
||||
s.template registerType<ILimiter, NoneOfLimiter>();
|
||||
s.template registerType<ILimiter, OppositeSideLimiter>();
|
||||
s.template registerType<IUpdater, OwnerUpdater>();
|
||||
//new types (other than netpacks) must register here
|
||||
//order of type registration is critical for loading old savegames
|
||||
}
|
||||
|
@ -138,6 +138,7 @@ int3 TownPlacer::placeMainTown(ObjectManager & manager, CGTownInstance & town)
|
||||
{
|
||||
//towns are big objects and should be centered around visitable position
|
||||
rmg::Object rmgObject(town);
|
||||
rmgObject.setTemplate(zone.getTerrainType());
|
||||
auto position = manager.findPlaceForObject(zone.areaPossible(), rmgObject, [this](const int3 & t)
|
||||
{
|
||||
float distance = zone.getPos().dist2dSQ(t);
|
||||
|
Loading…
Reference in New Issue
Block a user