@@ -1296,11 +1296,8 @@ static void ReplaceHandlerInternal([NotNull] IBrushFactory factory, [NotNull] Pl
12961296 throw new ArgumentNullException ( "cmd" ) ;
12971297
12981298 CuboidDrawOperation op = new CuboidDrawOperation ( player ) ;
1299-
13001299 IBrush brush = factory . MakeBrush ( player , cmd ) ;
1301- if ( brush == null )
1302- return ;
1303-
1300+ if ( brush == null ) return ;
13041301 op . Brush = brush ;
13051302
13061303 player . SelectionStart ( 2 , DrawOperationCallback , op , Permission . Draw ) ;
@@ -1323,29 +1320,6 @@ static void ReplaceHandler( Player player, CommandReader cmd ) {
13231320 ReplaceHandlerInternal ( ReplaceBrushFactory . Instance , player , cmd ) ;
13241321 }
13251322
1326- static void ReplaceAllHandlerInternal ( [ NotNull ] IBrushFactory factory , [ NotNull ] Player player ,
1327- [ NotNull ] CommandReader cmd ) {
1328- CuboidDrawOperation op = new CuboidDrawOperation ( player ) ;
1329- IBrush brush = factory . MakeBrush ( player , cmd ) ;
1330- if ( brush == null )
1331- return ;
1332- op . Brush = brush ;
1333-
1334- player . SelectionStart ( 2 , DrawOperationCallback , op , Permission . Draw ) ;
1335- Map map = player . WorldMap ;
1336- Vector3I coordsMin ;
1337- Vector3I coordsMax ;
1338- coordsMin . X = 0 ;
1339- coordsMin . Y = 0 ;
1340- coordsMin . Z = 0 ;
1341- coordsMax . X = map . Width - 1 ;
1342- coordsMax . Y = map . Length - 1 ;
1343- coordsMax . Z = map . Height - 1 ;
1344- player . SelectionResetMarks ( ) ;
1345- player . SelectionAddMark ( coordsMin , false , false ) ;
1346- player . SelectionAddMark ( coordsMax , true , true ) ;
1347- }
1348-
13491323
13501324 static readonly CommandDescriptor CdReplaceAll = new CommandDescriptor {
13511325 Name = "ReplaceAll" ,
@@ -1359,9 +1333,17 @@ static void ReplaceAllHandlerInternal([NotNull] IBrushFactory factory, [NotNull]
13591333 } ;
13601334
13611335 static void ReplaceAllHandler ( Player player , CommandReader cmd ) {
1362- ReplaceAllHandlerInternal ( ReplaceBrushFactory . Instance , player , cmd ) ;
1363- }
1336+ CuboidDrawOperation op = new CuboidDrawOperation ( player ) ;
1337+ IBrush brush = ReplaceBrushFactory . Instance . MakeBrush ( player , cmd ) ;
1338+ if ( brush == null ) return ;
1339+ op . Brush = brush ;
13641340
1341+ player . SelectionStart ( 2 , DrawOperationCallback , op , Permission . Draw ) ;
1342+ Map map = player . WorldMap ;
1343+ player . SelectionResetMarks ( ) ;
1344+ player . SelectionAddMark ( map . Bounds . MinVertex , false , false ) ;
1345+ player . SelectionAddMark ( map . Bounds . MaxVertex , true , true ) ;
1346+ }
13651347
13661348
13671349 static readonly CommandDescriptor CdReplaceNot = new CommandDescriptor {
@@ -1380,7 +1362,6 @@ static void ReplaceNotHandler([NotNull] Player player, [NotNull] CommandReader c
13801362 }
13811363
13821364
1383-
13841365 static readonly CommandDescriptor CdReplaceBrush = new CommandDescriptor {
13851366 Name = "ReplaceBrush" ,
13861367 Aliases = new [ ] { "rb" } ,
0 commit comments