Login
User Name:

Password:



Register

Forgot your password?
void nanny_get_new_race -- comm.c
Mar 13, 2025 7:08 am
By Elwood
IPv6
Jan 25, 2025 10:45 pm
By Samson
mudstrlcpy and mudstrlcat
Jan 18, 2025 5:23 pm
By Samson
I3 and IMC
Jan 17, 2025 9:35 pm
By Samson
AFKMud 2.5.1
Jan 17, 2025 2:22 pm
By Samson
SWFotEFUSS 1.5.3
Author: Various
Submitted by: Samson
SWRFUSS 1.4.3
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.8
Author: Various
Submitted by: Samson
AFKMud 2.5.2
Author: AFKMud Team
Submitted by: Samson
SmaugFUSS 1.9.7
Author: Various
Submitted by: Samson
Users Online
Anthropic, AhrefsBot, Bing, Bytespider

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
507
3,812
19,722
591
TracySpencer

» SmaugMuds » Bugfix Lists » AFKMud Bugfix List » [Bug] Projectile skills are n...
Forum Rules | Mark all | Recent Posts

[Bug] Projectile skills are not properly learnable
< Newer Topic :: Older Topic > AFKMud 2.02

Pages:<< prev 1 next >>
Post is unread #1 Dec 2, 2007 9:06 pm   Last edited Dec 2, 2007 9:10 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,707
JoinedJan 1, 2002

 
Bug: Projectile skills are not properly learnable
Danger: Low - All projectile skill is being applied to archery alone and not blowguns or slings.
Discovered in: AFKMud 2.02
Found by: Zeno and Kayle
Fixed by: Samson

---

archery.cpp, ranged_got_target

Locate:
   switch ( projectile->value[3] )
   {
      default:
      case 13:
      case 14:
         wtype = gsn_archery;
         break;

      case 15:
         wtype = gsn_blowguns;
         break;

      case 16:
         wtype = gsn_slings;
         break;
   }


Change to:
   switch ( projectile->value[4] )
   {
      default:
      case PROJ_BOLT:
      case PROJ_ARROW:
         wtype = gsn_archery;
         break;

      case PROJ_DART:
         wtype = gsn_blowguns;
         break;

      case PROJ_STONE:
         wtype = gsn_slings;
         break;
   }


Locate:
      switch ( projectile->value[3] )
      {
         default:
         case 13:
         case 14:
            ch->learn_from_failure( gsn_archery );
            break;

         case 15:
            ch->learn_from_failure( gsn_blowguns );
            break;

         case 16:
            ch->learn_from_failure( gsn_slings );
            break;
      }


Change to:
      switch ( projectile->value[4] )
      {
         default:
         case PROJ_BOLT:
         case PROJ_ARROW:
            ch->learn_from_failure( gsn_archery );
            break;

         case PROJ_DART:
            ch->learn_from_failure( gsn_blowguns );
            break;

         case PROJ_STONE:
            ch->learn_from_failure( gsn_slings );
            break;
      }


The projectile/archery code additions were quite complex and changed a number of things. One of which was the meaning of the various values on projectile items. value[3] is the damage type, which is not relevant to the skill being used. The code should have been referencing value[4] which is the PROJECTILE type, which matches up to the type of weapon being used. Further, since it was using hardcoded numerical values, the checks were out of range anyway and would always cause the skill increase to apply to archery even if the person is not using a crossbow or bow.

Pages:<< prev 1 next >>