Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Today, 9:00 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
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
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, DotBot

Members: 0
Guests: 18
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,237
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » SmaugFUSS Bugfix List » [Bug] Language settings on mo...
Forum Rules | Mark all | Recent Posts

[Bug] Language settings on mobs are not loading properly
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Oct 14, 2007, 11:44 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: Language settings on mobs are not loading properly
Danger: Medium - May lose some languages flags set on them.
Found by: Gerry Calderhead
Fixed by: Gerry Calderhead

---

db.c, load_mobiles

Locate and remove:
            if( x5 >= BV22 )
            {
               bug( "%s: Speaks exceeds language maximum", __FUNCTION__ );
               x5 = 0;
            }

            if( x6 >= BV22 )
            {
               bug( "%s: Speaking exceeds language maximum", __FUNCTION__ );
               x6 = 0;
            }


db.c, fread_fuss_mobile

Locate:
            if( !str_cmp( word, "Speaks" ) )
            {
               char *speaks = fread_flagstring( fp );

               speaks = one_argument( speaks, flag );
               value = get_langnum( flag );
               if( value < 0 || value > 31 )
                  bug( "Unknown speaks language: %s", flag );
               else
                  SET_BIT( pMobIndex->speaks, 1 << value );

               if( !pMobIndex->speaks )
                  pMobIndex->speaks = LANG_COMMON;
               break;
            }

            if( !str_cmp( word, "Speaking" ) )
            {
               char *speaking = fread_flagstring( fp );

               speaking = one_argument( speaking, flag );
               value = get_langnum( flag );
               if( value < 0 || value > 31 )
                  bug( "Unknown speaking language: %s", flag );
               else
                  SET_BIT( pMobIndex->speaking, 1 << value );

               if( !pMobIndex->speaking )
                  pMobIndex->speaking = LANG_COMMON;
               break;
            }


Change to:
            if( !str_cmp( word, "Speaks" ) )
            {
               char *speaks = fread_flagstring( fp );

               while( speaks[0] != '\0' )
               {
                  speaks = one_argument( speaks, flag );
                  value = get_langnum( flag );
                  if( value < 0 || value > 31 )
                     bug( "Unknown speaks language: %s", flag );
                  else
                     SET_BIT( pMobIndex->speaks, 1 << value );
               }

               if( !pMobIndex->speaks )
                  pMobIndex->speaks = LANG_COMMON;
               break;
            }

            if( !str_cmp( word, "Speaking" ) )
            {
               char *speaking = fread_flagstring( fp );

               while( speaking[0] != '\0' )
               {
                  speaking = one_argument( speaking, flag );
                  value = get_langnum( flag );
                  if( value < 0 || value > 31 )
                     bug( "Unknown speaking language: %s", flag );
          	      else
                     SET_BIT( pMobIndex->speaking, 1 << value );
               }

               if( !pMobIndex->speaking )
                  pMobIndex->speaking = LANG_COMMON;
               break;
            }


act_comm.c, lang_names array

Locate:
char *const lang_names[] = {
   "common", "elvish", "dwarven", "pixie",
   "ogre", "orcish", "trollese", "rodent",
   "insectoid", "mammal", "reptile",
   "dragon", "spiritual", "magical",
   "goblin", "god", "ancient", "halfling",
   "clan", "gith", "gnome", ""
};


Change to:
char *const lang_names[] = {
   "common", "elvish", "dwarven", "pixie",
   "ogre", "orcish", "trollese", "rodent",
   "insectoid", "mammal", "reptile",
   "dragon", "spiritual", "magical",
   "goblin", "god", "ancient", "halfling",
   "clan", "gith", "gnome", "", "", "", "",
   "", "", "", "", "", "", "", ""   /* pad to 32 for compat with flag_string */
};


As part of the step up to the new area file format, a couple of conversion checks on the bounds of old language values needed to be done. These were intended to be removed before distribution after the areas were converted.

Also apparently messed up in all this was the ability to read multiple languages in the speaks and speaking field for mobs. Instead loading the file will probably set something that's not expected unless this is fixed.
       
Pages:<< prev 1 next >>