fCraft.TNTTask.TryAddPoint C# (CSharp) Method

TryAddPoint() private method

private TryAddPoint ( int x, int y, int z ) : void
x int
y int
z int
return void
        private void TryAddPoint( int x, int y, int z )
        {
            if ( x < 0 || x >= _map.Width
                || y < 0 || y >= _map.Length
                || z < 0 || z >= _map.Height )
                return;

            Block prevBlock = _map.GetBlock( x, y, z );
            if ( Block.Lava != prevBlock ) {
                //chain explosion
                if ( Block.TNT == prevBlock ) {
                    _world.AddPhysicsTask( new TNTTask( _world, new Vector3I( x, y, z ), _owner, false, _particles ), _r.Next( 150, 300 ) );
                    UpdateMap( new BlockUpdate( null, ( short )x, ( short )y, ( short )z, Block.Air ) );
                }
                if ( ( 0.2 + 0.75 * ( R - _currentR ) / R ) * 0.65 > _r.NextDouble() )
                    _explosion.Add( new BData() { X = x, Y = y, Z = z, PrevBlock = _map.GetBlock( x, y, z ) } );
            }
        }