Blocks that cannot be placed/deleted should still be shown in the inventory, only invalid blocks should be hidden. (Thanks gemsgem)

This commit is contained in:
UnknownShadow200 2016-01-14 19:29:11 +11:00
parent 37d055244d
commit c057114de2

View File

@ -197,7 +197,7 @@ namespace ClassicalSharp {
void RecreateBlockTable() {
int blocksCount = 0;
for( int tile = 1; tile < BlockInfo.BlocksCount; tile++ ) {
if( game.Inventory.CanPlace[tile] || game.Inventory.CanDelete[tile] )
if( tile < BlockInfo.CpeBlocksCount || game.BlockInfo.Name[tile] != "Invalid" )
blocksCount++;
}
@ -208,7 +208,7 @@ namespace ClassicalSharp {
int tableIndex = 0;
for( int tile = 1; tile < BlockInfo.BlocksCount; tile++ ) {
if( game.Inventory.CanPlace[tile] || game.Inventory.CanDelete[tile] )
if( tile < BlockInfo.CpeBlocksCount || game.BlockInfo.Name[tile] != "Invalid" )
blocksTable[tableIndex++] = (Block)tile;
}
}