Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
AhrefsBot, Google, Bing

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
488
3,788
19,631
595
Khonsu

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Bugfix Lists » LoP Bugfix List » Personals
Forum Rules | Mark all | Recent Posts

Personals
< Newer Topic :: Older Topic > Crashing issue in Personals

Pages:<< prev 1 next >>
Post is unread #1 Oct 11, 2008 11:53 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
in skills.c
find
/* Mana cost */
int mana_cost( CHAR_DATA *ch, int sn )
{
   MCLASS_DATA *mclass;
   int min = ( MAX_LEVEL + 1 ), cost = 0;

   if( !ch || !skill_table[sn] )
      return cost;

   if( ch->pcdata )
   {
      for( mclass = ch->pcdata->first_mclass; mclass; mclass = mclass->next )
      {
         if( mclass->wclass >= 0 && mclass->wclass < MAX_PC_CLASS && class_table[mclass->wclass]
         && skill_table[sn]->skill_level[mclass->wclass] > 0 && min > skill_table[sn]->skill_level[mclass->wclass] )
         {
            min = skill_table[sn]->skill_level[mclass->wclass];
            cost = ( MAX_LEVEL / ( 2 + ( mclass->level - min ) ) );
         }
      }
   }

   if( ch->race >= 0 && race_table[ch->race] && skill_table[sn]->race_level[ch->race] > 0 && min > skill_table[sn]->race_level[ch->race] )
      cost = ( MAX_LEVEL / ( 2 + ( ch->level - skill_table[sn]->race_level[ch->race] ) ) );

   return cost;
}

change it to this
/* Mana cost */
int mana_cost( CHAR_DATA *ch, int sn )
{
   MCLASS_DATA *mclass;
   SKILLTYPE *skill = NULL;
   int min = ( MAX_LEVEL + 1 ), cost = 0;

   if( !ch )
      return cost;

   /* We need to make sure we get a valid spell/skill to use */
   if( sn >= 0 && sn < MAX_SKILL && skill_table[sn] )
   {
      skill = skill_table[sn];
      if( ch->pcdata )
      {
         for( mclass = ch->pcdata->first_mclass; mclass; mclass = mclass->next )
         {
            if( mclass->wclass >= 0 && mclass->wclass < MAX_PC_CLASS && class_table[mclass->wclass]
            && skill->skill_level[mclass->wclass] > 0 && min > skill->skill_level[mclass->wclass] )
            {
               min = skill->skill_level[mclass->wclass];
               cost = ( MAX_LEVEL / ( 2 + ( mclass->level - min ) ) );
            }
         }
      }

      if( ch->race >= 0 && race_table[ch->race] && skill->race_level[ch->race] > 0 && min > skill->race_level[ch->race] )
         cost = ( MAX_LEVEL / ( 2 + ( ch->level - skill->race_level[ch->race] ) ) );
   }
   else if( sn >= TYPE_PERS && sn < ( TYPE_PERS + MAX_PERS ) && pers_table[( sn - TYPE_PERS )] )
   {
      sn -= TYPE_PERS;
      skill = pers_table[sn];

      /* For now we are just going to set it to use what ever the mana is set at */
      cost = skill->min_mana;
   }

   return cost;
}

There was an issue when it would do a personal and checked the skill_table for the mana cost. This seems to fix the issue nicely.

Pages:<< prev 1 next >>