mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fix RMG bug with incorrect town placement (#779)
* Fix RMG bug with incorrect town placement * Readability tweak
This commit is contained in:
		
				
					committed by
					
						 Andrii Danylchenko
						Andrii Danylchenko
					
				
			
			
				
	
			
			
			
						parent
						
							454889598f
						
					
				
				
					commit
					e028875fe3
				
			| @@ -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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user