Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 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
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, Sogou

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » check_skill is passing wrong ...
Forum Rules | Mark all | Recent Posts

check_skill is passing wrong level values to spell_funs
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 1, 2006, 8:38 pm   Last edited Mar 1, 2006, 8:51 pm by Halcyon
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

Why does check_skill pass ch->top_level to spell_funs? Is it just me, or does that not seem right? I would think it should be passing a player's levels in the skill's assigned guild. It seems a little silly to pass top_level, when top_level could be 100 if the player has 100 engineering levels, but they'd still get a sneak that lasts 2300 rds, despite the fact they've only got 5 smuggling levels.

Hopefully this will be considered a bugfix, but in any case, here's the changes for anyone interested:

Edit: On second thought, let's make sure guild is valid before we pass it, just in case. :D

In skills.c, in function check_skill, find:

bool check_skill( CHAR_DATA * ch, char *command, char *argument )
{
   int sn;
   int first = gsn_first_skill;
   int top = gsn_first_weapon - 1;
   struct timeval time_used;
   int mana;


Directly below that, declare:

   int level;


Further down, find the following:

      if( mana )
      {
         ch->mana -= mana;
      }
      start_timer( &time_used );
      retcode = ( *skill_table[sn]->spell_fun ) ( sn, ch->top_level, ch, vo );
      end_timer( &time_used );
      update_userec( &time_used, &skill_table[sn]->userec );

      if( retcode == rCHAR_DIED || retcode == rERROR )
         return TRUE;


Replace that with:

      if( mana )
      {
         ch->mana -= mana;
      }
      start_timer( &time_used );
	  level = ( ( IS_NPC( ch ) || skill_table[sn]->guild < COMBAT_ABILITY
		  || skill_table[sn]->guild > FORCE_ABILITY ) ? ch->top_level 
		  : ch->skill_level[skill_table[sn]->guild] );
      retcode = ( *skill_table[sn]->spell_fun ) ( sn, level, ch, vo );
      end_timer( &time_used );
      update_userec( &time_used, &skill_table[sn]->userec );

      if( retcode == rCHAR_DIED || retcode == rERROR )
         return TRUE;


There... Now they'll roll 115 rds like they should. :D
       
Pages:<< prev 1 next >>