Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
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, Yahoo!, Google

Members: 0
Guests: 21
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » 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, 9:53 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
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 >>