Explosions and TNT block and entity
#15
If you want to do it as an IF statement:
BLOCKTYPE BlockType = GetBlock(a_BlockX, a_BlockY, a_BlockZ);
if ((BlockType == E_BLOCK_WATER) || (BlockType == E_BLOCK_STATIONARY_WATER) || (BlockType == ...))

If you want to do it more intelligently, do a switch:
switch (GetBlock(a_BlockX, a_BlockY, a_BlockZ)
{
	case E_BLOCK_STATIONARY_WATER:
	case E_BLOCK_WATER:
	{
		// TNT in these blocks doesn\'t do environmental damage
		break;
	}

	default:
	{
		// Destroy the neighboring blocks:
		for (int y = 0; y < ExplosionSizeInt; y++) ...
	}
}
Reply
Thanks given by:


Messages In This Thread
Explosions and TNT block and entity - by keyboard - 04-18-2013, 12:54 PM
RE: Explosions and TNT block and entity - by xoft - 04-18-2013, 05:45 PM
RE: Explosions and TNT block and entity - by xoft - 04-18-2013, 11:32 PM
RE: Explosions and TNT block and entity - by xoft - 04-19-2013, 06:28 PM
RE: Explosions and TNT block and entity - by xoft - 04-21-2013, 05:49 AM
RE: Explosions and TNT block and entity - by xoft - 04-21-2013, 06:14 AM
RE: Explosions and TNT block and entity - by xoft - 04-21-2013, 06:46 AM
RE: Explosions and TNT block and entity - by xoft - 03-09-2014, 04:03 AM
RE: Explosions and TNT block and entity - by xoft - 03-09-2014, 06:27 AM



Users browsing this thread: 1 Guest(s)