Skip to content

Commit 4df9aa5

Browse files
Remove unused code
1 parent 823186c commit 4df9aa5

File tree

5 files changed

+6
-126
lines changed

5 files changed

+6
-126
lines changed

fCraft/Commands/MaintenanceCommands.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -678,17 +678,13 @@ static void SetInfoHandler( Player player, CommandReader cmd ) {
678678
}
679679
if( oldIP == null ) {
680680
player.Message( "SetInfo: LastIP for {0} set to \"{1}&S\"",
681-
info.Name,
682-
valName.ToString() );
681+
info.Name, valName );
683682
} else if( valName == null ) {
684683
player.Message( "SetInfo: LastIP for {0} was reset (was \"{1}&S\")",
685-
info.Name,
686-
oldIP.ToString() );
684+
info.Name, oldIP.ToString() );
687685
} else {
688686
player.Message( "SetInfo: LastIP for {0} changed from \"{1}&S\" to \"{2}&S\"",
689-
info.Name,
690-
oldIP.ToString(),
691-
valName.ToString() );
687+
info.Name, oldIP.ToString(), valName );
692688
}
693689
break;
694690
default:

fCraft/Drawing/BlockPalette.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public Block[] FindBestMatch(RgbColor color)
9292
}
9393
if (bestMatch == null)
9494
{
95-
throw new Exception("Could not find match: palette is empty!");
95+
throw new InvalidOperationException("Could not find match: palette is empty!");
9696
}
9797
return bestMatch;
9898
}

fCraft/Drawing/CopyState.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ public CopyState(Vector3I mark1, Vector3I mark2) {
2222
/// <summary> Duplicates the given CopyState.
2323
/// Note that this is a deep copy -- Blocks array and everything else is duplicated too. </summary>
2424
public CopyState([NotNull] CopyState original) {
25-
if (original == null)
26-
throw new ArgumentNullException();
25+
if (original == null) throw new ArgumentNullException("original");
2726
Blocks = (Block[, ,])original.Blocks.Clone();
2827
Bounds = new BoundingBox(original.Bounds);
2928
Orientation = original.Orientation;
@@ -36,8 +35,7 @@ public CopyState([NotNull] CopyState original) {
3635
/// <summary> Duplicates the given CopyState, but does not copy the Blocks array.
3736
/// Updates Bounds to match the new buffer's size, but preserves original Orientation. </summary>
3837
public CopyState([NotNull] CopyState original, [NotNull] Block[, ,] buffer) {
39-
if (original == null)
40-
throw new ArgumentNullException();
38+
if (original == null) throw new ArgumentNullException("original");
4139
Blocks = buffer;
4240
Bounds = new BoundingBox(original.Bounds.MinVertex,
4341
buffer.GetLength(0),

fCraft/Drawing/DrawOps/Maze.cs

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -98,66 +98,6 @@ public int Mask()
9898
{
9999
return 0x1 << _d;
100100
}
101-
102-
public delegate void WallCallbackDelegate(
103-
ref int longSide1, ref int longSide2, int long1From, int long2From);
104-
105-
internal void ArrangeCoords(ref int x, ref int y, ref int z, int xFrom, int yFrom, int zFrom, int cellSize, WallCallbackDelegate fun)
106-
{
107-
switch (_d)
108-
{
109-
case 0:
110-
x = xFrom + cellSize;
111-
fun(ref y, ref z, yFrom, zFrom);
112-
break;
113-
case 1:
114-
y = yFrom + cellSize;
115-
fun(ref x, ref z, xFrom, zFrom);
116-
break;
117-
case 2:
118-
x = xFrom - 1;
119-
fun(ref y, ref z, yFrom, zFrom);
120-
break;
121-
case 3:
122-
y = yFrom - 1;
123-
fun(ref x, ref z, xFrom, zFrom);
124-
break;
125-
case 4:
126-
z = zFrom - 1;
127-
fun(ref x, ref y, xFrom, yFrom);
128-
break;
129-
case 5:
130-
z = zFrom + cellSize;
131-
fun(ref x, ref y, xFrom, yFrom);
132-
break;
133-
}
134-
}
135-
public delegate void StickCallbackDelegate(
136-
ref int coord, int coordFrom);
137-
internal void ArrangeCoords(ref int x, ref int y, ref int z, int xFrom, int yFrom, int zFrom, int cellSize, StickCallbackDelegate fun)
138-
{
139-
switch (_d)
140-
{
141-
case 0:
142-
case 2:
143-
y = yFrom - 1;
144-
z = zFrom - 1;
145-
fun(ref x, xFrom);
146-
break;
147-
case 1:
148-
case 3:
149-
x = xFrom - 1;
150-
z = zFrom - 1;
151-
fun(ref y, yFrom);
152-
break;
153-
case 4:
154-
case 5:
155-
x = xFrom - 1;
156-
y = yFrom - 1;
157-
fun(ref z, zFrom);
158-
break;
159-
}
160-
}
161101
}
162102

163103
internal class Cell
@@ -181,11 +121,6 @@ public bool Wall(Direction d)
181121
{
182122
return (_walls & d.Mask()) != 0;
183123
}
184-
185-
internal bool IsOnSolutionPath()
186-
{
187-
return (Path.ReachedDestination && IndexInPath <= Path.GoesToDestinationUpTo);
188-
}
189124
}
190125

191126
internal class Path

fCraft/Network/Player.Networking.cs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,55 +1299,6 @@ internal void SendEnvSettings() {
12991299
Send(Packet.SetWeather(World.Weather));
13001300
}
13011301
}
1302-
1303-
bool GetHacksFromMotd(out bool canFly, out bool canNoClip, out bool canSpeed, out bool canRespawn) {
1304-
bool useMotd = false;
1305-
canFly = false; canNoClip = false; canSpeed = false; canRespawn = false;
1306-
if (String.IsNullOrEmpty(World.MOTD)) return false;
1307-
1308-
foreach (string s in World.MOTD.ToLower().Split()) {
1309-
switch (s) {
1310-
case "-fly":
1311-
case "+fly":
1312-
canFly = s == "+fly";
1313-
useMotd = true;
1314-
break;
1315-
case "-noclip":
1316-
case "+noclip":
1317-
canNoClip = s == "+noclip";
1318-
useMotd = true;
1319-
break;
1320-
case "-speed":
1321-
case "+speed":
1322-
canSpeed = s == "+speed";
1323-
useMotd = true;
1324-
break;
1325-
case "-respawn":
1326-
case "+respawn":
1327-
canRespawn = s == "+respawn";
1328-
useMotd = true;
1329-
break;
1330-
case "-hax":
1331-
case "+hax":
1332-
canFly = s == "+hax";
1333-
canNoClip = s == "+hax";
1334-
canSpeed = s == "+hax";
1335-
canRespawn = s == "+hax";
1336-
useMotd = true;
1337-
break;
1338-
case "+ophax":
1339-
canFly = IsStaff;
1340-
canNoClip = IsStaff;
1341-
canSpeed = IsStaff;
1342-
canRespawn = IsStaff;
1343-
useMotd = true;
1344-
break;
1345-
default:
1346-
break;
1347-
}
1348-
}
1349-
return useMotd;
1350-
}
13511302

13521303
#endregion
13531304

0 commit comments

Comments
 (0)