mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Zones will now not bounce off map edges too much, should allow more space in the middle of a map.
This commit is contained in:
parent
9eeea7299a
commit
dd0033b5a4
@ -151,11 +151,11 @@ void CZonePlacer::placeZones(const CMapGenOptions * mapGenOptions, CRandomGenera
|
||||
//do not scale boundary distance - zones tend to get squashed
|
||||
float size = zone.second->getSize() / mapSize;
|
||||
|
||||
auto pushAwayFromBoundary = [&forceVector, pos, &getDistance](float x, float y)
|
||||
auto pushAwayFromBoundary = [&forceVector, pos, &getDistance, size](float x, float y)
|
||||
{
|
||||
float3 boundary = float3 (x, y, pos.z);
|
||||
float distance = pos.dist2d(boundary);
|
||||
forceVector -= (boundary - pos) / getDistance(distance); //negative value
|
||||
forceVector -= (boundary - pos) * (size - distance) / getDistance(distance); //negative value
|
||||
};
|
||||
if (pos.x < size)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user