BUG: RiverGenerator:FindBestDirectionForMethodC()

Barathor

Emperor
Joined
May 7, 2011
Messages
1,202
A small bug exists within RiverGenerator:FindBestDirectionForMethodC().

It's nothing major, but the wrong adjustment is applied to plots when the Y value is either odd or even. Lines 501 and 503. Just switch the indexes.

Code:
local offset_table = {
	{1, 0, 1},
	{1, 1, 0},
	{1, 0, -1},
	{0, -1, -1},
	{-1, -1, 0},
	{0, -1, 1},
};

Code:
if current_y / 2 > math.floor(current_y / 2) then -- Current Y is odd. Use odd offset.
	next_x = current_x + offset_table[current_direction + 1][[B][COLOR="red"]2[/COLOR][/B]];
else -- Current Y is even. Use even offset.
	next_x = current_x + offset_table[current_direction + 1][[B][COLOR="Red"]1[/COLOR][/B]];

For others reading this, here's how it works, starting from the NE plot. This is my own little diagram which helps to remind me:
Spoiler :


 
Top Bottom