Skip to content

Commit

Permalink
Remove a few reduntant variables
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Jan 10, 2018
1 parent 23fe2c5 commit 4d721ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion fCraft/Commands/CommandReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions fCraft/Network/LineWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -74,7 +74,6 @@ static LineWrapper()
input = GetBytes(message, fullCP437);
prefix = DefaultPrefix;
emoteFix = emotefix;
this.hasCP437 = fullCP437;
this.useFallbacks = fallbackCols;
Reset();
}
Expand All @@ -89,7 +88,6 @@ static LineWrapper()
throw new ArgumentNullException( "message" );
input = GetBytes(message, hasCP437);
emoteFix = emotefix;
this.hasCP437 = hasCP437;
this.useFallbacks = fallbackCols;
Reset();
}
Expand Down
8 changes: 5 additions & 3 deletions fCraft/World/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}


Expand Down

0 comments on commit 4d721ae

Please sign in to comment.