Torque 3D Beta 3 Bug: terrain painter - plugin ID comparision bug+fix
by Fyodor -bank- Osokin · in Torque 3D Professional · 06/24/2009 (4:13 pm) · 2 replies
I've noticed this inside TerrainEditor::onActiveTerrainChange function:
So, here we comparing string with U32, so it always returns false.
The fix is easy:
function TerrainEditor::onBrushChanged( %this )
So, by adding .getId() to the currentEditor we fix this.
Gosh, weird behaviour and easy fix.
function TerrainEditor::onActiveTerrainChange(%this, %newTerrain)
{
// Need to refresh the terrain painter.
if ( EditorGui.currentEditor == TerrainPainterPlugin.getId() )
EPainter.setup(ETerrainEditor.paintIndex);
}The EditorGui.currentEditor equals to the name of plugin, not it's id: "TerrainPainterPlugin", "TerrainPainterPlugin" and so on.So, here we comparing string with U32, so it always returns false.
The fix is easy:
function TerrainEditor::onActiveTerrainChange(%this, %newTerrain)
{
// Need to refresh the terrain painter.
if ( EditorGui.currentEditor.getId() == TerrainPainterPlugin.getId() )
EPainter.setup(ETerrainEditor.paintIndex);
}Same bug is inside:function TerrainEditor::onBrushChanged( %this )
So, by adding .getId() to the currentEditor we fix this.
Gosh, weird behaviour and easy fix.
About the author
Game developer.
Torque 3D Owner Kenneth Holst
Default Studio Name