From e50cd13643fc43da16154aa650d585756fa96c4a Mon Sep 17 00:00:00 2001 From: elexis Date: Mon, 29 Jan 2018 00:58:00 +0000 Subject: [PATCH] Fix camouflaged paintRiver sign error of doom in e596ef6011 that resulted in rivers always being parallel and Danubius placing "left" patrol trigger points on both riversides. Add missing map rotation for Danubius shoreline triggerpoints in 3d65bfe555. This was SVN commit r21055. --- binaries/data/mods/public/maps/random/danubius.js | 5 +++-- binaries/data/mods/public/maps/random/rmgen/gaia_terrain.js | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/binaries/data/mods/public/maps/random/danubius.js b/binaries/data/mods/public/maps/random/danubius.js index c71919b667..103201a516 100644 --- a/binaries/data/mods/public/maps/random/danubius.js +++ b/binaries/data/mods/public/maps/random/danubius.js @@ -378,10 +378,11 @@ paintRiver({ "meanderShort": 30, "meanderLong": 0, "waterFunc": (position, height, riverFraction) => { + let origPos = position.clone().rotateAround(-startAngle, mapCenter); // Distinguish left and right shoreline if (0 < height && height < 1 && - position.y > ShorelineDistance && position.y < mapSize - ShorelineDistance) - clShore[position.x < mapCenter.x ? 0 : 1].add(position); + origPos.y > ShorelineDistance && origPos.y < mapSize - ShorelineDistance) + clShore[origPos.x < mapCenter.x ? 0 : 1].add(position); }, "landFunc": (position, shoreDist1, shoreDist2) => { diff --git a/binaries/data/mods/public/maps/random/rmgen/gaia_terrain.js b/binaries/data/mods/public/maps/random/rmgen/gaia_terrain.js index fdf1822ae7..62eb89af87 100644 --- a/binaries/data/mods/public/maps/random/rmgen/gaia_terrain.js +++ b/binaries/data/mods/public/maps/random/rmgen/gaia_terrain.js @@ -392,9 +392,8 @@ function paintRiver(args) let deviation = args.deviation * randFloat(-1, 1); // Compute the distance to the shoreline. - let sign = Math.sign(distanceToRiver || 1); - let shoreDist1 = sign * riverCurve1 + Math.abs(distanceToRiver) - deviation - args.width / 2; - let shoreDist2 = sign * riverCurve2 + Math.abs(distanceToRiver) - deviation + args.width / 2; + let shoreDist1 = riverCurve1 + distanceToRiver - deviation - args.width / 2; + let shoreDist2 = riverCurve2 + distanceToRiver - deviation + args.width / 2; // Create the elevation for the water and the slopy shoreline and call the user functions. if (shoreDist1 < 0 && shoreDist2 > 0)