mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Mantis#1544. Thank you kindly, Jonc, for a patch that:
Terrain revert using the PaintBrushes appears to work OK, however when using 'apply to selection' the RevertArea FloodEffect calculates the revert height incorrectly unless the strength passed in from the viewer is 1.0 Attaching a patch to correctly reset the selected area to the heights in the revertmap.
This commit is contained in:
@@ -40,6 +40,12 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FloodBrushes
|
||||
|
||||
#region ITerrainFloodEffect Members
|
||||
|
||||
/// <summary>
|
||||
/// reverts an area of the map to the heightfield stored in the revertmap
|
||||
/// </summary>
|
||||
/// <param name="map">the current heightmap</param>
|
||||
/// <param name="fillArea">array indicating which sections of the map are to be reverted</param>
|
||||
/// <param name="strength">unused</param>
|
||||
public void FloodEffect(ITerrainChannel map, bool[,] fillArea, double strength)
|
||||
{
|
||||
int x;
|
||||
@@ -50,7 +56,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FloodBrushes
|
||||
{
|
||||
if (fillArea[x, y])
|
||||
{
|
||||
map[x, y] = (map[x, y] * (1.0 - strength)) + (m_revertmap[x, y] * strength);
|
||||
map[x, y] = m_revertmap[x, y];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,4 +64,4 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FloodBrushes
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user