m_block_exits.c

gurba-0.40/lib/std/modules/m_block_exits.c · 628 B

From the archive gurba.tgz

Download the archive   « Back to the archive contents

string *blocks;
string block_action;

int is_blocking( string dir ) {
  int i;
  if( blocks != 0 ) {
    for( i = 0; i < sizeof( blocks ); i++ ) {
      if( blocks[i] == dir )
	return(1);
    }
  }
  return( 0 );
}

int query_blocking( string dir ) {
  return( is_blocking( dir ) );
}

void add_block( string exit ) {
  if( blocks == 0 )
    blocks = ({ });
  blocks -= ({ exit });
  blocks += ({ exit });
  if( block_action == 0 ) {
    block_action = "$N $vstop $t from going $o. \n";
  }
}

void set_block_action( string action ) {
  block_action = action;
}

string query_block_action( void ) {
  return( block_action );
}

Site Stats

Snippets: 1791
Codebases: 571