Login
User Name:

Password:



Register

Forgot your password?
 I3 and IMC
Dec 26, 2024 3:27 am
By GatewaySysop
Hi - Clean SmaugFuss map/description issue..
Dec 15, 2024 7:29 pm
By Samson
AFKMud 2.2.4
Dec 10, 2024 4:09 pm
By Samson
Ubuntu 22.04.5 LTS
Dec 5, 2024 5:10 pm
By Remcon
SmaugFUSS 1.8/1.9
Nov 29, 2024 11:46 am
By Remcon
LOP 1.6
Author: Remcon
Submitted by: Remcon
SWFOTEFUSS 1.5.1
Author: Various
Submitted by: Samson
SWRFUSS 1.4.1
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.5
Author: Various
Submitted by: Samson
AFKMud 2.2.4
Author: AFKMud Team
Submitted by: Samson
Users Online
Bing, Yandex

Members: 0
Guests: 65
Stats
Files
Topics
Posts
Members
Newest Member
496
3,808
19,708
594
MaisieMacl

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Codebases » LoP Codebase » Need help with LOP
Forum Rules | Mark all | Recent Posts

Need help with LOP
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2 next >>
Post is unread #1 Jan 26, 2012 12:29 am   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
I am trying to add in mpsleep snippet found here
And I have a few problems that I am unsure how to go about fixing.


Compiling o/mud_prog.o....
mud_prog.c: In function âvoid mprog_driver(char*, CHAR_DATA*, CHAR_DATA*, OBJ_DATA*, void*, bool)â:
mud_prog.c:2214: error: incompatible types in assignment of âchar*â to âchar [4096]â
mud_prog.c: In function âvoid mpsleep_update()â:
mud_prog.c:2556: error: âobj_extractedâ was not declared in this scope
make[1]: *** [o/mud_prog.o] Error 1


First Error:
cmnd = one_argument( cmnd, arg);
Second Error:
delete_it = obj_extracted(mpsleep->obj);

Post is unread #2 Jan 26, 2012 5:14 pm   
Go to the top of the page
Go to the bottom of the page

Remcon

GroupAdministrators
Posts1,946
JoinedJul 26, 2005

 
Hmm the first one shouldn't give you that error, might need to recheck what is giving the issue lol looks right to me.

The second one is caused by obj_extracted no longer being in the code. I would add in a pointer from the obj back to the mpsleep so that in the event the object gets deleted it can go to the mpsleep and make the mpsleep->obj NULL. It is that or on extracting an object have it check all the mpsleep data to see if the object is being used and then NULL it that way but that is going to make it take a good bit more cpu etc...

Post is unread #3 Jan 26, 2012 7:35 pm   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
So I tried to add in the mapper system from smaugfuss1.9 to LOP and I got this error.

Instead of giving me the whole map and desc for the room it does this.

Well Kept Yard
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=
different animals each more amazing than the next.
| *-*-@-*-* |
| | | | |
| *-*-* |
| |
| |
+-----------+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=

and it refuses to give the rest of the map or desc. I'm guessing the desc is too long, and I know the easy way to fix this would be by making the desc shorter, but I feel I need to increase the size of the desc or decrease the allowed number dfor the editor. Any suggestions?

Post is unread #4 Jan 26, 2012 7:39 pm   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
Actually I figured it out it has to do with the color in my descs. Anyway to fix that?

Post is unread #5 Jan 26, 2012 7:45 pm   
Go to the top of the page
Go to the bottom of the page

Remcon

GroupAdministrators
Posts1,946
JoinedJul 26, 2005

 
Granted it has been a long time since i looked at that code, but what is in the description of the room should have no affect on the room mapper.

Post is unread #6 Jan 26, 2012 7:53 pm   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
It does though because if I take the color code out of the room desc it works perfectly fine, but if I keep it in there it bugs out.

Post is unread #7 Jan 26, 2012 7:55 pm   
Go to the top of the page
Go to the bottom of the page

Remcon

GroupAdministrators
Posts1,946
JoinedJul 26, 2005

 
can you post all the stuff thats in the room description when its buggy and when its not (probably best when it has color codes to get it out of the area file). also a copy of what you have it doing to it etc...

Post is unread #8 Jan 26, 2012 7:59 pm   Last edited Jan 26, 2012 8:11 pm by dbna2
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
Without Color code in desc:
Limbo
-=(DBNU:HB)-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=
'           | You float in a formless void, detached from all sensation of 
'           | physical matter, surrounded by swirling glowing light which 
'     *     | fades into the relative darkness around you without any trace 
'           | of edge or shadow. 
'           | 
'           | 
'           | 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=(DBNU:HB)-=


Same desc just added &[gray] in the beginning.
-=(DBNU:HB)-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=
of edge or shadow. 
'           | 
'           | 
'           | 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=(DBNU:HB)-=
 

It only happens when the color is at the beginning of the desc if its in the end it doesn't seem to do anything haven't tried in the middle though.

Post is unread #9 Jan 26, 2012 8:01 pm   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
ignote the * I guess this editor doesn't see spaces. But basically yeah all the | has spaced before it.

Post is unread #10 Jan 26, 2012 8:02 pm   
Go to the top of the page
Go to the bottom of the page

Remcon

GroupAdministrators
Posts1,946
JoinedJul 26, 2005

 
Can you put tags around it etc... it likes to mess it up other wise so i can't really get a good feel for how it should look verses what its doing. Although I can tell something isn't right want to see how it is showing it correctly.

Post is unread #11 Jan 26, 2012 8:06 pm   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
what is the tag for it?

Post is unread #12 Jan 26, 2012 8:12 pm   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
duh.... Figured it out.

Post is unread #13 Jan 26, 2012 8:22 pm   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
When I said duh, I figured it out I meant the tags not the problem.

Post is unread #14 Jan 26, 2012 8:29 pm   
Go to the top of the page
Go to the bottom of the page

Remcon

GroupAdministrators
Posts1,946
JoinedJul 26, 2005

 
kk mind showing the code that sends the data?

Post is unread #15 Jan 26, 2012 8:34 pm   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
Well to get the room desc in act_info.c for the look code its this:

char *roomdesc( CHAR_DATA * ch )
{
   static char rdesc[MSL];

   rdesc[0] = '\0';

   if( !xIS_SET( ch->act, PLR_BRIEF ) )
   {
     if( ch->in_room->description && ch->in_room->description[0] != '\0' )
         mudstrlcat( rdesc, ch->in_room->description, MSL );
   }
   if( rdesc[0] == '\0' )
      mudstrlcpy( rdesc, "(Not set)", MSL );
   return rdesc;
}


then in the look command:
           draw_room_map(ch, roomdesc( ch ));

now for the mapper.c
/****************************************************************************
 * [S]imulated [M]edieval [A]dventure multi[U]ser [G]ame      |   \\._.//   *
 * -----------------------------------------------------------|   (0...0)   *
 * SMAUG 1.4 (C) 1994, 1995, 1996, 1998  by Derek Snider      |    ).:.(    *
 * -----------------------------------------------------------|    {o o}    *
 * SMAUG code team: Thoric, Altrag, Blodkai, Narn, Haus,      |   / ' ' \   *
 * Scryn, Rennard, Swordbearer, Gorog, Grishnakh, Nivek,      |~'~.VxvxV.~'~*
 * Tricops and Fireblade                                      |             *
 * ------------------------------------------------------------------------ *
 * Merc 2.1 Diku Mud improvments copyright (C) 1992, 1993 by Michael        *
 * Chastain, Michael Quan, and Mitchell Tse.                                *
 * Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,          *
 * Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.     *
 * ------------------------------------------------------------------------ *
 *                           Room Mapper Module                             *
 ****************************************************************************/

/**************************************************************************
*  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,        *
*  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.   *
*                                                                         *
*  Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael          *
*  Chastain, Michael Quan, and Mitchell Tse.                              *
*                                                                         *
*  In order to use any part of this Merc Diku Mud, you must comply with   *
*  both the original Diku license in 'license.doc' as well the Merc       *
*  license in 'license.txt'.  In particular, you may not remove either of *
*  these copyright notices.                                               *
*                                                                         *
*  Dystopia Mud improvements copyright (C) 2000, 2001 by Brian Graversen  *
*                                                                         *
*  Much time and thought has gone into this software and you are          *
*  benefitting.  We hope that you share your changes too.  What goes      *
*  around, comes around.                                                  *
***************************************************************************
*  Converted for AFKMud 1.64 by Zarius (jeff@mindcloud.com)               *
*  Downloaded from http://www.mindcloud.com                               *
*  If you like the snippet let me know                                    *
***************************************************************************/
/**************************************************************************
 * 	                       Version History                              *
 **************************************************************************
 *  (v1.0) - Converted Automapper to AFKMud 1.64 and added additional     *
 *           directions and removed room desc code into a sep func        *
 **************************************************************************/

/*
   TO DO
   -----

   1. Add a way of displaying up and down directions effectively
 */
#include 
#include 
#include "h/mud.h"
#include "h/mapper.h"

bool check_blind( CHAR_DATA * ch );

/* The map itself */
MAP_TYPE dmap[MAPX + 1][MAPY + 1];
int colorcode( const char *src, char *dst, DESCRIPTOR_DATA * d, int dstlen, int *vislen );
/* Take care of some repetitive code for later */
void get_exit_dir( int dir, int *x, int *y, int xorig, int yorig )
{
   /*
    * Get the next coord based on direction 
    */
   switch ( dir )
   {
      case DIR_NORTH:  /* North */
         *x = xorig;
         *y = yorig - 1;
         break;

      case DIR_EAST:   /* East */
         *x = xorig + 1;
         *y = yorig;
         break;

      case DIR_SOUTH:  /* South */
         *x = xorig;
         *y = yorig + 1;
         break;

      case DIR_WEST:   /* West */
         *x = xorig - 1;
         *y = yorig;
         break;

      case DIR_UP:  /* UP */
         break;

      case DIR_DOWN:   /* DOWN */
         break;

      case DIR_NORTHEAST: /* NE */
         *x = xorig + 1;
         *y = yorig - 1;
         break;

      case DIR_NORTHWEST: /* NW */
         *x = xorig - 1;
         *y = yorig - 1;
         break;

      case DIR_SOUTHEAST: /* SE */
         *x = xorig + 1;
         *y = yorig + 1;
         break;

      case DIR_SOUTHWEST: /* SW */
         *x = xorig - 1;
         *y = yorig + 1;
         break;

      default:
         *x = -1;
         *y = -1;
         break;
   }
}

char *get_exits( CHAR_DATA * ch )
{
   static char buf[MSL];
   EXIT_DATA *pexit;
   bool found = false;

   buf[0] = '\0';

   if( !check_blind( ch ) )
      return buf;

   set_char_color( AT_EXITS, ch );

   mudstrlcpy( buf, "[Exits:", MSL );

   for( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next )
   {
      if( is_immortal( ch ) )
         /*
          * Immortals see all exits, even secret ones 
          */
      {
         if( pexit->to_room )
         {
            found = true;
            mudstrlcat( buf, " ", MSL );

            mudstrlcat( buf, capitalize( dir_name[pexit->vdir] ), MSL );

            /*
             * New code added to display closed, or otherwise invisible exits to immortals 
             * Installed by Samson 1-25-98 
             */
            if( xIS_SET( pexit->exit_info, EX_CLOSED ) )
               mudstrlcat( buf, "->(Closed)", MSL );
            if( xIS_SET( pexit->exit_info, EX_DIG ) )
               mudstrlcat( buf, "->(Dig)", MSL );
            if( xIS_SET( pexit->exit_info, EX_WINDOW ) )
               mudstrlcat( buf, "->(Window)", MSL );
            if( xIS_SET( pexit->exit_info, EX_HIDDEN ) )
               mudstrlcat( buf, "->(Hidden)", MSL );
            if( xIS_SET( pexit->to_room->room_flags, ROOM_DEATH ) )
               mudstrlcat( buf, "->(Deathtrap)", MSL );
         }
      }
      else
      {
         if( pexit->to_room
             && !xIS_SET( pexit->exit_info, EX_SECRET )
             && ( !xIS_SET( pexit->exit_info, EX_WINDOW ) || xIS_SET( pexit->exit_info, EX_ISDOOR ) )
             && !xIS_SET( pexit->exit_info, EX_HIDDEN ) )
         {
            found = true;
            mudstrlcat( buf, " ", MSL );

            mudstrlcat( buf, capitalize( dir_name[pexit->vdir] ), MSL );

            if( xIS_SET( pexit->exit_info, EX_CLOSED ) )
               mudstrlcat( buf, "->(Closed)", MSL );
            if( IS_AFFECTED( ch, AFF_DETECTTRAPS ) && xIS_SET( pexit->to_room->room_flags, ROOM_DEATH ) )
               mudstrlcat( buf, "->(Deathtrap)", MSL );
         }
      }
   }

   if( !found )
      mudstrlcat( buf, " none]", MSL );
   else
      mudstrlcat( buf, "]", MSL );
   mudstrlcat( buf, "\r\n", MSL );
   return buf;
}

/* Clear one map coord */
void clear_coord( int x, int y )
{
   dmap[x][y].tegn = ' ';
   dmap[x][y].vnum = 0;
   dmap[x][y].depth = 0;
   dmap[x][y].sector = -1;
//   xCLEAR_BITS( dmap[x][y].info );
   dmap[x][y].can_see = true;
}

/* Clear all exits for one room */
void clear_room( int x, int y )
{
   int dir, exitx, exity;

   /*
    * Cycle through the four directions 
    */
   for( dir = 0; dir < 4; ++dir )
   {
      /*
       * Find next coord in this direction 
       */
      get_exit_dir( dir, &exitx, &exity, x, y );

      /*
       * If coord is valid, clear it 
       */
      if( !BOUNDARY( exitx, exity ) )
         clear_coord( exitx, exity );
   }
}

/* This function is recursive, ie it calls itself */
void map_exits( CHAR_DATA * ch, ROOM_INDEX_DATA * pRoom, int x, int y, int depth )
{
   static char map_chars[11] = "|-|-UD/\\\\/";
   int door;
   int exitx = 0, exity = 0;
   int roomx = 0, roomy = 0;
   EXIT_DATA *pExit;

   /*
    * Setup this coord as a room - Change any symbols that can't be displayed here 
    */
   dmap[x][y].sector = pRoom->sector_type;
   switch ( pRoom->sector_type )
   {
      case SECT_INSIDE:
         dmap[x][y].tegn = 'O';
         dmap[x][y].sector = -1;
         break;

      case SECT_CITY:
         dmap[x][y].tegn = ':';
         break;

      case SECT_FIELD:
      case SECT_FOREST:
      case SECT_HILLS:
         dmap[x][y].tegn = '*';
         break;

      case SECT_MOUNTAIN:
         dmap[x][y].tegn = '@';
         break;

      case SECT_WATER_SWIM:
      case SECT_WATER_NOSWIM:
         dmap[x][y].tegn = '=';
         break;

      case SECT_AIR:
         dmap[x][y].tegn = '~';
         break;

      case SECT_DESERT:
         dmap[x][y].tegn = '+';
         break;

      default:
         dmap[x][y].tegn = 'O';
         dmap[x][y].sector = -1;
         bug( "%s: Bad sector type (%d) in room %d.", __FUNCTION__, pRoom->sector_type, pRoom->vnum );
         break;
   }

   dmap[x][y].vnum = pRoom->vnum;
   dmap[x][y].depth = depth;
//   dmap[x][y].info = pRoom->room_flags;
   dmap[x][y].can_see = room_is_dark( pRoom );

   /*
    * Limit recursion 
    */
   if( depth > MAXDEPTH )
      return;

   /*
    * This room is done, deal with it's exits 
    */
   for( door = 0; door < 10; ++door )
   {
      /*
       * Skip if there is no exit in this direction 
       */
      if( !( pExit = get_exit( pRoom, door ) ) )
         continue;

      /*
       * Skip up and down until I can figure out a good way to display it 
       */
      if( door == 4 || door == 5 )
         continue;

      /*
       * Get the coords for the next exit and room in this direction 
       */
      get_exit_dir( door, &exitx, &exity, x, y );
      get_exit_dir( door, &roomx, &roomy, exitx, exity );

      /*
       * Skip if coords fall outside map 
       */
      if( BOUNDARY( exitx, exity ) || BOUNDARY( roomx, roomy ) )
         continue;

      /*
       * Skip if there is no room beyond this exit 
       */
      if( !pExit->to_room )
         continue;

      /*
       * Ensure there are no clashes with previously defined rooms 
       */
      if( ( dmap[roomx][roomy].vnum != 0 ) && ( dmap[roomx][roomy].vnum != pExit->to_room->vnum ) )
      {
         /*
          * Use the new room if the depth is higher 
          */
         if( dmap[roomx][roomy].depth <= depth )
            continue;

         /*
          * It is so clear the old room 
          */
         clear_room( roomx, roomy );
      }

      /*
       * No exits at MAXDEPTH 
       */
      if( depth == MAXDEPTH )
         continue;

      /*
       * No need for exits that are already mapped 
       */
      if( dmap[exitx][exity].depth > 0 )
         continue;

      /*
       * Fill in exit 
       */
      dmap[exitx][exity].depth = depth;
      dmap[exitx][exity].vnum = pExit->to_room->vnum;
//      dmap[exitx][exity].info = pExit->exit_info;
      dmap[exitx][exity].tegn = map_chars[door];
      dmap[exitx][exity].sector = -1;

      /*
       * More to do? If so we recurse 
       */
      if( depth < MAXDEPTH && ( ( dmap[roomx][roomy].vnum == pExit->to_room->vnum ) || ( dmap[roomx][roomy].vnum == 0 ) ) )
      {
         /*
          * Depth increases by one each time 
          */
         map_exits( ch, pExit->to_room, roomx, roomy, depth + 1 );
      }
   }
}

/* Reformat room descriptions to exclude undesirable characters */
void reformat_desc( char *desc )
{
   /*
    * Index variables to keep track of array/pointer elements 
    */
   unsigned int i = 0;
   int j = 0;
   char buf[MSL], *p;

   buf[0] = '\0';

   if( !desc )
      return;

   /*
    * Replace all "\n" and "\r" with spaces 
    */
   for( i = 0; i <= strlen( desc ); ++i )
   {
      if( ( desc[i] == '\r' ) || ( desc[i] == '\n' ) )
         desc[i] = ' ';
   }

   /*
    * Remove multiple spaces 
    */
   for( p = desc; *p != '\0'; ++p )
   {
      buf[j] = *p;
      ++j;

      /*
       * Two or more consecutive spaces? 
       */
      if( ( *p == ' ' ) && ( *( p + 1 ) == ' ' ) )
      {
         do
         {
            ++p;
         }
         while( *( p + 1 ) == ' ' );
      }
   }

   buf[j] = '\0';

   /*
    * Copy to desc 
    */
   mudstrlcpy( desc, buf, MSL );
}

int get_line( char *desc, size_t max_len )
{
   size_t i, j = 0;

   /*
    * Return if it's short enough for one line 
    */
   if( strlen( desc ) <= max_len )
      return 0;

   /*
    * Calculate end point in string without color 
    */
   for( i = 0; i <= strlen( desc ); ++i )
   {
      char dst[20];
      int vislen;

      switch ( desc[i] )
      {
         case '&':  /* NORMAL, Foreground colour */
         case '^':  /* BACKGROUND colour */
         case '}':  /* BLINK Foreground colour */
            *dst = '\0';
            vislen = 0;
            i += colorcode( &desc[i], dst, NULL, 20, &vislen ); /* Skip input token */
            j += vislen; /* Count output token length */
            break;   /* this was missing - if you have issues, remove it */

         default:   /* No conversion, just count */
            ++j;
            break;
      }
      
      if( j > max_len )
         break;
   }

   

   /*
    * End point is now in i, find the nearest space 
    */
   for( j = i; j > 0; --j )
   {
      if( desc[j] == ' ' )
         break;
   }

   /*
    * There could be a problem if there are no spaces on the line 
    */
   return j + 1;
}

char *whatColor( char *str, char *pos )
{
   static char col[2];

   col[0] = '\0';
   while( str != pos )
   {
      if( *str == '&' || *str == '^' || *str == '}' )
      {
         col[0] = *str;

         ++str;
         if( !str )
         {
            col[1] = '\0';
            break;
         }
         col[1] = *str;
      }
      ++str;
   }
   return col;
}

/* Display the map to the player */
void show_map( CHAR_DATA * ch, char *text )
{
   char buf[MSL * 2];
   int x, y, pos;
   char *p;
   bool alldesc = false;   /* Has desc been fully displayed? */

   if( !text )
      alldesc = true;

   pos = 0;
   p = text;
   buf[0] = '\0';

   /*
    * Show exits 
    */
//   if( xIS_SET( ch->act, PLR_AUTOEXIT ) )
     // snprintf( buf, MSL * 2, "%s%s", color_str( AT_EXITS, ch ), get_exits( ch ) );
  // else
    //  mudstrlcpy( buf, "", MSL * 2 );

   /*
    * Top of map frame 
    */
  // mudstrlcat( buf, "&z+-----------+&w ", MSL * 2 );
   /*if( !alldesc )
   {
      pos = get_line( p, 63 );
      if( pos > 0 )
      {
         mudstrlcat( buf, color_str( AT_RMDESC, ch ), MSL * 2 );
         strncat( buf, p, pos );
         p += pos;
      }
      else
      {
         mudstrlcat( buf, color_str( AT_RMDESC, ch ), MSL * 2 );
         mudstrlcat( buf, p, MSL * 2 );
         alldesc = true;
      }
   }*/
  // mudstrlcat( buf, "\r\n", MSL * 2 );

   /*
    * Write out the main map area with text 
    */
   for( y = 1; y <= MAPY; ++y )
   {
    //  mudstrlcat( buf, "&z|&D", MSL * 2 );

      for( x = 0; x <= MAPX; ++x )
      {
         switch ( dmap[x][y].tegn )
         {
            case '-':
            case '|':
            case '\\':
            case '/':
               snprintf( buf + strlen( buf ), ( MSL * 2 ) - strlen( buf ), "&O%c&d", dmap[x][y].tegn );
               break;

            case '@':  // Character is standing here
               snprintf( buf + strlen( buf ), ( MSL * 2 ) - strlen( buf ), "&R%c&d", dmap[x][y].tegn );
               break;

            case 'O':  // Indoors
               snprintf( buf + strlen( buf ), ( MSL * 2 ) - strlen( buf ), "&w%c&d", dmap[x][y].tegn );
               break;

            case '=':
               snprintf( buf + strlen( buf ), ( MSL * 2 ) - strlen( buf ), "&B%c&d", dmap[x][y].tegn );
               break;

            case '~':
               snprintf( buf + strlen( buf ), ( MSL * 2 ) - strlen( buf ), "&C%c&d", dmap[x][y].tegn );
               break;

            case '+':
               snprintf( buf + strlen( buf ), ( MSL * 2 ) - strlen( buf ), "&Y%c&d", dmap[x][y].tegn );
               break;

            case '*':
               snprintf( buf + strlen( buf ), ( MSL * 2 ) - strlen( buf ), "&g%c&d", dmap[x][y].tegn );
               break;

            case 'X':
               snprintf( buf + strlen( buf ), ( MSL * 2 ) - strlen( buf ), "&R%c&d", dmap[x][y].tegn );
               break;

            case ':':
               snprintf( buf + strlen( buf ), ( MSL * 2 ) - strlen( buf ), "&Y%c&d", dmap[x][y].tegn );
               break;

            default:   // Empty space
               snprintf( buf + strlen( buf ), ( MSL * 2 ) - strlen( buf ), "%c", dmap[x][y].tegn );
               break;
         }
      }
      mudstrlcat( buf, "&z|&D ", MSL * 2 );

      /*
       * Add the text, if necessary 
       */
      if( !alldesc )
      {
         pos = get_line( p, 63 );
         char col[10], c[2];

         strcpy( c, whatColor( text, p ) );
         if( c[0] == '\0' )
            mudstrlcpy( col, color_str( AT_RMDESC, ch ), 10 );
         else
            snprintf( col, 10, "%s", c );

         if( pos > 0 )
         {
            mudstrlcat( buf, col, MSL * 2 );
            strncat( buf, p, pos );
            p += pos;
         }
         else
         {
            mudstrlcat( buf, col, MSL * 2 );
            mudstrlcat( buf, p, MSL * 2 );
            alldesc = true;
         }
      }
      mudstrlcat( buf, "\r\n", MSL * 2 );
   }

   /*
    * Finish off map area 
    */
  /* mudstrlcat( buf, "&z+-----------+&D ", MSL * 2 );
   if( !alldesc )
   {
      char col[10], c[2];
      pos = get_line( p, 63 );

      strcpy( c, whatColor( text, p ) );
      if( c[0] == '\0' )
         mudstrlcpy( col, color_str( AT_RMDESC, ch ), 10 );
      else
         snprintf( col, 10, "%s", c );

      if( pos > 0 )
      {
         mudstrlcat( buf, col, MSL * 2 );
         strncat( buf, p, pos );
         p += pos;
         mudstrlcat( buf, "\r\n", MSL * 2 );
      }
      else
      {
         mudstrlcat( buf, col, MSL * 2 );
         mudstrlcat( buf, p, MSL * 2 );
         alldesc = true;
      }
   }
*/
   /*
    * Deal with any leftover text 
    */
   if( !alldesc )
   {
      char col[10], c[2];

      do
      {
         /*
          * Note the number - no map to detract from width 
          */
         pos = get_line( p, 78 );

         strcpy( c, whatColor( text, p ) );
         if( c[0] == '\0' )
            mudstrlcpy( col, color_str( AT_RMDESC, ch ), 10 );
         else
            snprintf( col, 10, "%s", c );

         if( pos > 0 )
         {
            mudstrlcat( buf, col, MSL * 2 );
            strncat( buf, p, pos );
            p += pos;
            mudstrlcat( buf, "\r\n", MSL * 2 );
         }
         else
         {
            mudstrlcat( buf, col, MSL * 2 );
            mudstrlcat( buf, p, MSL * 2 );
            alldesc = true;
         }
      }
      while( !alldesc );
   }
 //  mudstrlcat( buf, "&D\r\n", MSL * 2 );
   send_to_char( buf, ch );
}

/* Clear, generate and display the map */
void draw_room_map( CHAR_DATA * ch, const char *desc )
{
   int x, y;
   static char buf[MSL];

   mudstrlcpy( buf, desc, MSL );
   /*
    * Remove undesirable characters 
    */
   reformat_desc( buf );

   /*
    * Clear map 
    */
   for( y = 0; y <= MAPY; ++y )
   {
      for( x = 0; x <= MAPX; ++x )
      {
         clear_coord( x, y );
      }
   }

   /*
    * Start with players pos at centre of map 
    */
   x = MAPX / 2;
   y = MAPY / 2;

   dmap[x][y].vnum = ch->in_room->vnum;
   dmap[x][y].depth = 0;

   /*
    * Generate the map 
    */
   map_exits( ch, ch->in_room, x, y, 0 );

   /*
    * Current position should be a "X" 
    */
   dmap[x][y].tegn = '@';
   dmap[x][y].sector = -1;

   /*
    * Send the map 
    */
   show_map( ch, buf );
}

Post is unread #16 Jan 26, 2012 9:03 pm   
Go to the top of the page
Go to the bottom of the page

Remcon

GroupAdministrators
Posts1,946
JoinedJul 26, 2005

 
Hmm, odd. Considering it only happens at the start if you use color and it strips so much out it would need to have some checks placed at each and see where it is loosing the data (at least thats how i would do it). Just for testing though id see if you turning off ansi etc... makes it show correctly or what.

Post is unread #17 Jan 26, 2012 9:10 pm   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
still does it ####ed up with no ansi.

Post is unread #18 Jan 26, 2012 9:25 pm   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
it doesn't seem to do with the original smaugfuss1.9

Post is unread #19 Jan 26, 2012 9:35 pm   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
Actually I just noticed that it was happening on my edited version of smaug not LOP, but its still a problem. I wonder if its because the roomdesc function isn't a const char?

Post is unread #20 Jan 27, 2012 1:35 am   
Go to the top of the page
Go to the bottom of the page

dbna2

GroupMembers
Posts600
JoinedDec 3, 2008

 
Update: It happens to all smaug1.4a codebase, even one with the update color fix. So I don't think it has anything to do with colors, though I have no idea what would be causing it.

Pages:<< prev 1, 2 next >>