mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
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.
This commit is contained in:
parent
605bdb0480
commit
e50cd13643
2 changed files with 5 additions and 5 deletions
|
|
@ -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) => {
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue