Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Exalead, DotBot, Sogou

Members: 0
Guests: 13
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » SmaugFUSS Bugfix List » [Bug] The mapout code is junk!
Forum Rules | Mark all | Recent Posts

[Bug] The mapout code is junk!
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Aug 14, 2005, 9:10 pm   Last edited Mar 10, 2008, 6:52 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: The mapout code is junk!
Danger: None - The previous code never worked
Found by: Remcon and anyone else with any sense
Fixed by: Remcon

---

act_info.c, do_look

Locate and remove:
      if( !IS_NPC( ch ) && xIS_SET( ch->act, PLR_AUTOMAP ) )   /* maps */
      {
         if( ch->in_room->map != NULL )
         {
            do_lookmap( ch, NULL );
         }
      }


act_info.c, do_config

Locate:
      if( IS_IMMORTAL( ch ) )
      {
         set_char_color( AT_DGREEN, ch );
         send_to_char( "\n\r\n\rImmortal toggles:  ", ch );
         set_char_color( AT_GREY, ch );
         ch_printf( ch, "Roomvnum [%s]    Automap [%s]",
                    xIS_SET( ch->act, PLR_ROOMVNUM ) ? "+" : " ", xIS_SET( ch->act, PLR_AUTOMAP ) ? "+" : " " );
      }


Change to:
      if( IS_IMMORTAL( ch ) )
      {
         set_char_color( AT_DGREEN, ch );
         send_to_char( "\n\r\n\rImmortal toggles:  ", ch );
         set_char_color( AT_GREY, ch );
         ch_printf( ch, "Roomvnum [%s]",
                    xIS_SET( ch->act, PLR_ROOMVNUM ) ? "+" : " " );
      }


Locate and remove:
      else if( IS_IMMORTAL( ch ) && !str_prefix( arg + 1, "map" ) )
         bit = PLR_AUTOMAP;   /* maps */


mud.h

Locate:
PLR_AUTOMAP


Change to:
PLR_AVAILABLE_FLAG


Locate and remove:
DECLARE_DO_FUN( do_lookmap );


Locate and remove from struct room_index:
   MAP_DATA *map; /* maps */


Locate and remove:
struct map_data   /* contains per-room data */
{
   int vnum;   /* which map this room belongs to */
   int x;   /* horizontal coordinate */
   int y;   /* vertical coordinate */
   char entry; /* code that shows up on map */
};

struct map_index_data
{
   MAP_INDEX_DATA *next;
   int vnum;   /* vnum of the map */
   int map_of_vnums[49][81];  /* room vnums aranged as a map */
};

MAP_INDEX_DATA *get_map_index( int vnum );
void init_maps( void );


build.c, fold_area

Locate and remove:
      if( room->map )   /* maps */
      {
#ifdef OLDMAPS
         fprintf( fpout, "M\n" );
         fprintf( fpout, "%s~\n", strip_cr( room->map ) );
#else
         fprintf( fpout, "M %d %d %d %c\n", room->map->vnum, room->map->x, room->map->y, room->map->entry );
#endif
      }


db.c, load_rooms

Locate:
         else if( letter == 'M' )   /* maps */
         {
            MAP_DATA *map;
            MAP_INDEX_DATA *map_index;
            int i, j;

            CREATE( map, MAP_DATA, 1 );
            map->vnum = fread_number( fp );
            map->x = fread_number( fp );
            map->y = fread_number( fp );
            map->entry = fread_letter( fp );

            pRoomIndex->map = map;
            if( ( map_index = get_map_index( map->vnum ) ) == NULL )
            {
               CREATE( map_index, MAP_INDEX_DATA, 1 );
               map_index->vnum = map->vnum;
               map_index->next = first_map;
               first_map = map_index;
               for( i = 0; i < 49; i++ )
               {
                  for( j = 0; j < 79; j++ )
                  {
                     map_index->map_of_vnums[i][j] = -1;
                     /*
                      * map_index->map_of_ptrs[i][j] = NULL; 
                      */
                  }
               }
            }
            if( ( map->y < 0 ) || ( map->y > 48 ) )
            {
               bug( "Map y coord out of range.  Room %d\n\r", map->y );

            }
            if( ( map->x < 0 ) || ( map->x > 78 ) )
            {
               bug( "Map x coord out of range.  Room %d\n\r", map->x );

            }
            if( ( map->x > 0 ) && ( map->x < 80 ) && ( map->y > 0 ) && ( map->y < 48 ) )
               map_index->map_of_vnums[map->y][map->x] = pRoomIndex->vnum;
         }


Replace all that with:
         else if( letter == 'M' )   /* old map stuff no longer supported */
         {
            fread_to_eol( fp );
         }


tables.c

Locate and remove:

         if( !str_cmp( name, "do_lookmap" ) )
            return do_lookmap;


and

   if( skill == do_lookmap )
      return "do_lookmap";


Replace your existing mapout.c file with the new one linked here: http://www.smaugmuds.org/mapout.c
Suggested that the following help entry be added for it: http://www.smaugmuds.org/mapout.txt

The concept behind the mapout code was very intriguing and so the functions to support it were left in just in case they could ever be made to work. Well, Remcon decided to give it a go after some discussion and after having found some other bugs in the original code. What he came up with is a viable working method for writing a map into a note using the line editor and then having the mapout command parse that into a working area file that has its rooms created and linked up. Given this was the perceived original intent of the mapout code, this update should fix the code and make it useful.
       
Pages:<< prev 1 next >>