private unsafe void ParseExistsTable(byte* mh2oChunk, SMLiquidInstance* instance)
{
if (instance->existsTable != 0 && UseExistsTable(instance->liquidObjectId, instance->liquidType))
{
var table = mh2oChunk + instance->existsTable;
ExistsTable = new bool[TilesPerRow, TilesPerRow];
for (int x = MinX; x < MaxX; x++)
{
for (int y = MinY; y < MaxY; y++)
{
int index = y*(MaxX - MinX) + x;
ExistsTable[y, x] = (table[index/8] & (1 << (index & 7))) != 0;
}
}
}
else
{
ExistsTable = FullExistsTable;
}
}