Login
User Name:

Password:



Register

Forgot your password?
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
SmaugFUSS 1.9.4
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.3
Author: Various
Submitted by: Samson
Users Online
CommonCrawl, SemrushBot, Sogou, Bing

Members: 0
Guests: 2
Stats
Files
Topics
Posts
Members
Newest Member
486
3,758
19,453
572
Fjolsvith

Today's Birthdays
There are no member birthdays today.
» 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,665
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 >>