Pages:<< prev 1 next >>
#1 Dec 2, 2007 9:06 pm
Last edited Dec 2, 2007 9:10 pm by Samson
Black Hand
GroupAdministrators
Posts3,697
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:
Change to:
Locate:
Change to:
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.
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 >>