Пример #1
0
int add_new_room_to_map( CHAR_DATA * ch, char code )
{
	int i;
	ROOM_INDEX_DATA *location;

	/*
	 * Get an unused room to copy to 
	 */
	for ( i = ch->pcdata->area->low_r_vnum; i <= ch->pcdata->area->hi_r_vnum; i++ )
	{
		if ( get_room_index( i ) == NULL )
		{
			if ( !( location = make_room( i, ch->pcdata->area ) ) )
			{
				bug( "%s: make_room failed", __FUNCTION__ );
				return -1;
			}
			/*
			 * Clones current room  (quietly) 
			 */
			location->area = ch->pcdata->area;
			location->name = STRALLOC( "Newly Created Room" );
			location->description = STRALLOC( "Newly Created Room\r\n" );
			xSET_BIT( location->room_flags, ROOM_PROTOTYPE );
			location->light = 0;
			if ( code == 'I' )
				location->sector_type = SECT_INSIDE;
			else if ( code == 'C' )
				location->sector_type = SECT_CITY;
			else if ( code == 'f' )
				location->sector_type = SECT_FIELD;
			else if ( code == 'F' )
				location->sector_type = SECT_FOREST;
			else if ( code == 'H' )
				location->sector_type = SECT_HILLS;
			else if ( code == 'M' )
				location->sector_type = SECT_MOUNTAIN;
			else if ( code == 's' )
				location->sector_type = SECT_WATER_SWIM;
			else if ( code == 'S' )
				location->sector_type = SECT_WATER_NOSWIM;
			else if ( code == 'A' )
				location->sector_type = SECT_AIR;
			else if ( code == 'D' )
				location->sector_type = SECT_DESERT;
			else if ( code == 'U' )
				location->sector_type = SECT_DUNNO;
			else if ( code == 'O' )
				location->sector_type = SECT_OCEANFLOOR;
			else if ( code == 'u' )
				location->sector_type = SECT_UNDERGROUND;
			else if ( code == 'U' )
				location->sector_type = SECT_UNDERWATER;
			else if ( code == 'L' )
				location->sector_type = SECT_LAVA;
			else if ( code == 'W' )
				location->sector_type = SECT_SWAMP;
			else
				location->sector_type = SECT_DUNNO;
			return i;
		}
	}
	send_to_char( "No available room in your vnums!", ch );
	return -1;
}
Пример #2
0
void put_bytes(struct membuffer *b, const char *str, int len)
{
	make_room(b, len);
	memcpy(b->buffer + b->len, str, len);
	b->len += len;
}