Skip to content
Permalink
Browse files

Remove a few reduntant variables

  • Loading branch information...
UnknownShadow200 committed Jan 10, 2018
1 parent 23fe2c5 commit 4d721ae46868e472e101798bea5c86fffba253cb
Showing with 6 additions and 7 deletions.
  1. +0 −1 fCraft/Commands/CommandReader.cs
  2. +1 −3 fCraft/Network/LineWrapper.cs
  3. +5 −3 fCraft/World/Map.cs
@@ -274,7 +274,6 @@ public sealed class CommandReader : ICloneable {

string jointString = Next();
if (jointString == null) return false;
World world = player == null ? null : player.World;

int slashIndex = jointString.IndexOf('/');
if (slashIndex == -1)
@@ -38,7 +38,7 @@ static LineWrapper()
lastColor; // used to detect duplicate color codes

byte type = 0; // messagetype cpe spec
bool emoteFix = false, hasCP437 = false, useFallbacks = false;
bool emoteFix = false, useFallbacks = false;

bool endsWithSymbol; // used to guarantee suffixes for symbols ("emotes")

@@ -74,7 +74,6 @@ static LineWrapper()
input = GetBytes(message, fullCP437);
prefix = DefaultPrefix;
emoteFix = emotefix;
this.hasCP437 = fullCP437;
this.useFallbacks = fallbackCols;
Reset();
}
@@ -89,7 +88,6 @@ static LineWrapper()
throw new ArgumentNullException( "message" );
input = GetBytes(message, hasCP437);
emoteFix = emotefix;
this.hasCP437 = hasCP437;
this.useFallbacks = fallbackCols;
Reset();
}
@@ -916,19 +916,21 @@ public void ClearUpdateQueue()

unsafe static void MakeFallbacks(byte* fallback, byte maxLegal, World world) {
BlockDefinition[] defs = world.BlockDefs;
bool hasCPEBlocks = maxLegal == (byte)MaxCustomBlockType;

for (int i = 0; i < 256; i++) {
fallback[i] = (byte)FallbackBlocks[i];
if (defs[i] == null) continue;
fallback[i] = defs[i].FallBack;

// Handle CPE defined fallback blocks for custom blocks
if (fallback[i] > (byte)maxLegal)
if (fallback[i] > (byte)maxLegal) {
fallback[i] = (byte)FallbackBlocks[fallback[i]];
}
}
for (int i = 0; i <= (byte)maxLegal; i++)

for (int i = 0; i <= maxLegal; i++) {
fallback[i] = (byte)i;
}
}


0 comments on commit 4d721ae

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