Skip to content

Commit 4d721ae

Browse files
Remove a few reduntant variables
1 parent 23fe2c5 commit 4d721ae

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

fCraft/Commands/CommandReader.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ public bool NextBlockWithParam([CanBeNull] Player player, bool allowNoneBlock, o
274274

275275
string jointString = Next();
276276
if (jointString == null) return false;
277-
World world = player == null ? null : player.World;
278277

279278
int slashIndex = jointString.IndexOf('/');
280279
if (slashIndex == -1)

fCraft/Network/LineWrapper.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static LineWrapper()
3838
lastColor; // used to detect duplicate color codes
3939

4040
byte type = 0; // messagetype cpe spec
41-
bool emoteFix = false, hasCP437 = false, useFallbacks = false;
41+
bool emoteFix = false, useFallbacks = false;
4242

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

@@ -74,7 +74,6 @@ static LineWrapper()
7474
input = GetBytes(message, fullCP437);
7575
prefix = DefaultPrefix;
7676
emoteFix = emotefix;
77-
this.hasCP437 = fullCP437;
7877
this.useFallbacks = fallbackCols;
7978
Reset();
8079
}
@@ -89,7 +88,6 @@ static LineWrapper()
8988
throw new ArgumentNullException( "message" );
9089
input = GetBytes(message, hasCP437);
9190
emoteFix = emotefix;
92-
this.hasCP437 = hasCP437;
9391
this.useFallbacks = fallbackCols;
9492
Reset();
9593
}

fCraft/World/Map.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,19 +916,21 @@ internal void CompressAndConvertMap(byte maxLegal, Player dst) {
916916

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

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

926925
// Handle CPE defined fallback blocks for custom blocks
927-
if (fallback[i] > (byte)maxLegal)
926+
if (fallback[i] > (byte)maxLegal) {
928927
fallback[i] = (byte)FallbackBlocks[fallback[i]];
928+
}
929929
}
930-
for (int i = 0; i <= (byte)maxLegal; i++)
930+
931+
for (int i = 0; i <= maxLegal; i++) {
931932
fallback[i] = (byte)i;
933+
}
932934
}
933935

934936

0 commit comments

Comments
 (0)