Code Cleanup & Fixes Warnings (#74)

This commit is contained in:
Kamron Batman 2020-01-18 14:56:45 -08:00 committed by GitHub
parent e11d1f3ad9
commit 57b14ad690
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
143 changed files with 2960 additions and 3427 deletions

View file

@ -191,14 +191,10 @@ namespace Server
if (x < 0 || y < 0 || x >= BlockWidth || y >= BlockHeight)
return;
if (m_StaticTiles[x] == null)
m_StaticTiles[x] = new StaticTile[BlockHeight][][][];
m_StaticTiles[x] ??= new StaticTile[BlockHeight][][][];
m_StaticTiles[x][y] = value;
if (m_StaticPatches[x] == null)
m_StaticPatches[x] = new int[BlockHeight + 31 >> 5];
m_StaticPatches[x] ??= new int[BlockHeight + 31 >> 5];
m_StaticPatches[x][y >> 5] |= 1 << (y & 0x1F);
}
@ -208,8 +204,7 @@ namespace Server
if (x < 0 || y < 0 || x >= BlockWidth || y >= BlockHeight || DataStream == null || IndexStream == null)
return EmptyStaticBlock;
if (m_StaticTiles[x] == null)
m_StaticTiles[x] = new StaticTile[BlockHeight][][][];
m_StaticTiles[x] ??= new StaticTile[BlockHeight][][][];
StaticTile[][][] tiles = m_StaticTiles[x][y];
@ -287,14 +282,10 @@ namespace Server
if (x < 0 || y < 0 || x >= BlockWidth || y >= BlockHeight)
return;
if (m_LandTiles[x] == null)
m_LandTiles[x] = new LandTile[BlockHeight][];
m_LandTiles[x] ??= new LandTile[BlockHeight][];
m_LandTiles[x][y] = value;
if (m_LandPatches[x] == null)
m_LandPatches[x] = new int[BlockHeight + 31 >> 5];
m_LandPatches[x] ??= new int[BlockHeight + 31 >> 5];
m_LandPatches[x][y >> 5] |= 1 << (y & 0x1F);
}
@ -304,8 +295,7 @@ namespace Server
if (x < 0 || y < 0 || x >= BlockWidth || y >= BlockHeight || MapStream == null)
return m_InvalidLandBlock;
if (m_LandTiles[x] == null)
m_LandTiles[x] = new LandTile[BlockHeight][];
m_LandTiles[x] ??= new LandTile[BlockHeight][];
LandTile[] tiles = m_LandTiles[x][y];