Skip to content
Permalink
Browse files

Remove unused code

  • Loading branch information...
UnknownShadow200 committed Jun 24, 2017
1 parent 823186c commit 4df9aa5f8c9a6163b576992ca3d19011bf40401c
@@ -678,17 +678,13 @@ static void SaveHandler(Player player, CommandReader cmd)
}
if( oldIP == null ) {
player.Message( "SetInfo: LastIP for {0} set to \"{1}&S\"",
info.Name,
valName.ToString() );
info.Name, valName );
} else if( valName == null ) {
player.Message( "SetInfo: LastIP for {0} was reset (was \"{1}&S\")",
info.Name,
oldIP.ToString() );
info.Name, oldIP.ToString() );
} else {
player.Message( "SetInfo: LastIP for {0} changed from \"{1}&S\" to \"{2}&S\"",
info.Name,
oldIP.ToString(),
valName.ToString() );
info.Name, oldIP.ToString(), valName );
}
break;
default:
@@ -92,7 +92,7 @@ public Block[] FindBestMatch(RgbColor color)
}
if (bestMatch == null)
{
throw new Exception("Could not find match: palette is empty!");
throw new InvalidOperationException("Could not find match: palette is empty!");
}
return bestMatch;
}
@@ -22,8 +22,7 @@ public sealed class CopyState : ICloneable {
/// <summary> Duplicates the given CopyState.
/// Note that this is a deep copy -- Blocks array and everything else is duplicated too. </summary>
public CopyState([NotNull] CopyState original) {
if (original == null)
throw new ArgumentNullException();
if (original == null) throw new ArgumentNullException("original");
Blocks = (Block[, ,])original.Blocks.Clone();
Bounds = new BoundingBox(original.Bounds);
Orientation = original.Orientation;
@@ -36,8 +35,7 @@ public sealed class CopyState : ICloneable {
/// <summary> Duplicates the given CopyState, but does not copy the Blocks array.
/// Updates Bounds to match the new buffer's size, but preserves original Orientation. </summary>
public CopyState([NotNull] CopyState original, [NotNull] Block[, ,] buffer) {
if (original == null)
throw new ArgumentNullException();
if (original == null) throw new ArgumentNullException("original");
Blocks = buffer;
Bounds = new BoundingBox(original.Bounds.MinVertex,
buffer.GetLength(0),
@@ -98,66 +98,6 @@ public int Mask()
{
return 0x1 << _d;
}

public delegate void WallCallbackDelegate(
ref int longSide1, ref int longSide2, int long1From, int long2From);

internal void ArrangeCoords(ref int x, ref int y, ref int z, int xFrom, int yFrom, int zFrom, int cellSize, WallCallbackDelegate fun)
{
switch (_d)
{
case 0:
x = xFrom + cellSize;
fun(ref y, ref z, yFrom, zFrom);
break;
case 1:
y = yFrom + cellSize;
fun(ref x, ref z, xFrom, zFrom);
break;
case 2:
x = xFrom - 1;
fun(ref y, ref z, yFrom, zFrom);
break;
case 3:
y = yFrom - 1;
fun(ref x, ref z, xFrom, zFrom);
break;
case 4:
z = zFrom - 1;
fun(ref x, ref y, xFrom, yFrom);
break;
case 5:
z = zFrom + cellSize;
fun(ref x, ref y, xFrom, yFrom);
break;
}
}
public delegate void StickCallbackDelegate(
ref int coord, int coordFrom);
internal void ArrangeCoords(ref int x, ref int y, ref int z, int xFrom, int yFrom, int zFrom, int cellSize, StickCallbackDelegate fun)
{
switch (_d)
{
case 0:
case 2:
y = yFrom - 1;
z = zFrom - 1;
fun(ref x, xFrom);
break;
case 1:
case 3:
x = xFrom - 1;
z = zFrom - 1;
fun(ref y, yFrom);
break;
case 4:
case 5:
x = xFrom - 1;
y = yFrom - 1;
fun(ref z, zFrom);
break;
}
}
}

internal class Cell
@@ -181,11 +121,6 @@ public bool Wall(Direction d)
{
return (_walls & d.Mask()) != 0;
}

internal bool IsOnSolutionPath()
{
return (Path.ReachedDestination && IndexInPath <= Path.GoesToDestinationUpTo);
}
}

internal class Path
@@ -1299,55 +1299,6 @@ bool LoginSequence()
Send(Packet.SetWeather(World.Weather));
}
}

bool GetHacksFromMotd(out bool canFly, out bool canNoClip, out bool canSpeed, out bool canRespawn) {
bool useMotd = false;
canFly = false; canNoClip = false; canSpeed = false; canRespawn = false;
if (String.IsNullOrEmpty(World.MOTD)) return false;

foreach (string s in World.MOTD.ToLower().Split()) {
switch (s) {
case "-fly":
case "+fly":
canFly = s == "+fly";
useMotd = true;
break;
case "-noclip":
case "+noclip":
canNoClip = s == "+noclip";
useMotd = true;
break;
case "-speed":
case "+speed":
canSpeed = s == "+speed";
useMotd = true;
break;
case "-respawn":
case "+respawn":
canRespawn = s == "+respawn";
useMotd = true;
break;
case "-hax":
case "+hax":
canFly = s == "+hax";
canNoClip = s == "+hax";
canSpeed = s == "+hax";
canRespawn = s == "+hax";
useMotd = true;
break;
case "+ophax":
canFly = IsStaff;
canNoClip = IsStaff;
canSpeed = IsStaff;
canRespawn = IsStaff;
useMotd = true;
break;
default:
break;
}
}
return useMotd;
}

#endregion

0 comments on commit 4df9aa5

Please sign in to comment.
You can’t perform that action at this time.