function AddRivers()
local gridWidth, gridHeight = Map.GetGridSize();
for y = 0, gridHeight - 1,1 do
for x = 0,gridWidth - 1,1 do
local plot = Map.GetPlot(x, y)
local WOfRiver, NWOfRiver, NEOfRiver = riverMap:GetFlowDirections(x,y)
if WOfRiver == FlowDirectionTypes.NO_FLOWDIRECTION then
plot:SetWOfRiver(false,WOfRiver)
else
local xx,yy = elevationMap:GetNeighbor(x,y,mc.E)
local nPlot = Map.GetPlot(xx,yy)
if plot:IsMountain() and nPlot:IsMountain() then
plot:SetPlotType(PlotTypes.PLOT_LAND,false,true) [COLOR="SeaGreen"]-- Changed second flag to "true"[/COLOR]
end
plot:SetWOfRiver(true,WOfRiver)
--print(string.format("(%d,%d)WOfRiver = true dir=%d",x,y,WOfRiver))
end
if NWOfRiver == FlowDirectionTypes.NO_FLOWDIRECTION then
plot:SetNWOfRiver(false,NWOfRiver)
else
local xx,yy = elevationMap:GetNeighbor(x,y,mc.SE)
local nPlot = Map.GetPlot(xx,yy)
if plot:IsMountain() and nPlot:IsMountain() then
plot:SetPlotType(PlotTypes.PLOT_LAND,false,true) [COLOR="SeaGreen"]-- Changed second flag to "true"[/COLOR]
end
plot:SetNWOfRiver(true,NWOfRiver)
--print(string.format("(%d,%d)NWOfRiver = true dir=%d",x,y,NWOfRiver))
end
if NEOfRiver == FlowDirectionTypes.NO_FLOWDIRECTION then
plot:SetNEOfRiver(false,NEOfRiver)
else
local xx,yy = elevationMap:GetNeighbor(x,y,mc.SW)
local nPlot = Map.GetPlot(xx,yy)
if plot:IsMountain() and nPlot:IsMountain() then
plot:SetPlotType(PlotTypes.PLOT_LAND,false,true) [COLOR="SeaGreen"]-- Changed second flag to "true"[/COLOR]
end
plot:SetNEOfRiver(true,NEOfRiver)
--print(string.format("(%d,%d)NEOfRiver = true dir=%d",x,y,NEOfRiver))
end
end
end
Map.RecalculateAreas(); [COLOR="SeaGreen"]-- This line is just for good measure.[/COLOR]
end