Torque 3D Beta 4,5: TerrainEditor duplicated code
by Fyodor -bank- Osokin · in Torque 3D Professional · 07/18/2009 (11:40 am) · 2 replies
As far I see this code contains something that never called:
If we failed on first "if" check AND second, means there are no SI_SHIFT modifier, so the last check is just... copy-paste bug?
void TerrainEditor::on3DMouseWheelDown( const Gui3DMouseEvent & event )
{
if ( event.modifier & SI_CTRL && event.modifier & SI_SHIFT )
setBrushPressure( mBrushPressure - 0.1f );
else if ( event.modifier & SI_SHIFT )
setBrushSoftness( mBrushSoftness + 0.05f );
else if ( event.modifier & SI_CTRL )
{
Point2I newBrush = getBrushSize() - Point2I(1,1);
setBrushSize( newBrush.x, newBrush.y );
}
else if ( event.modifier & SI_SHIFT )
setBrushSoftness( mBrushSoftness - 0.05f );
}The last "else if()" part is not needed at all.If we failed on first "if" check AND second, means there are no SI_SHIFT modifier, so the last check is just... copy-paste bug?
About the author
Game developer.
Torque 3D Owner Kenneth Holst
Default Studio Name