Re: [NEWBIE][CODE] Syslog Errors

From: Jarhad Idanno (Jarhad@webmail.merging.org)
Date: 02/14/03


>Feb 11 18:07:15 :: SYSERR: Mob using
>'((ch)->player_specials->saved.skills[141])' at fight.c:1018.
>Feb 11 18:07:15 :: SYSERR: Mob using
>'((ch)->player_specials->saved.skills[142])' at fight.c:1024.

Basically, this error means that a mob is trying to access player-only data.

>line 1018 -  if ( rand_number( 1, 100 ) < GET_SKILL( ch, KILL_ATTACK2 )
>/ 2 && !IS_NPC(ch) )
>{
> hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
>
>}
>line 1024 - if ( rand_number( 1, 100 ) < GET_SKILL( ch, SKILL_ATTACK3 )
>/ 4 && !IS_NPC(ch) )
>{
>    hit(ch, FIGHTING(ch), TYPE_UNDEFINED);

You should put the IS_NPC check before even checking for the skills, because currently, if it is a mob, the GET_SKILL() check tries to access player_specials (which is player-only data and mobs don't have that structure), thus the syserrs.

To solve the problem, you might want to try the following:

if (!IS_NPC(ch)) {
  if (rand_number(1, 100) < GET_SKILL(ch, SKILL_ATTACK2))
    hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
  if (rand_number(1, 100) < GET_SKILL(ch, SKILL_ATTACK3))
    hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
}



_____________________________________________________________
Play at A Merging of Fates MUD and get free E-Mail too! http://www.merging.org

_____________________________________________________________
Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/26/03 PDT