View Single Post
  #4  
Old 11-06-2012, 12:44 AM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default

After thinking about it, I can see how it differs from a client. Clients will only call this when the person uses a hotkey or something, so they would already have to have the skill, MaxSkill would never return 0. It may be an issue if they are charmed or something and call if while under AI control, but there aren't many times when a lvl 1 will be charmed. If that would even work.

I'll try to get a commit in soon to fix this.

A simple check to see if MaxSkill > 0 before assigning the skill mod should suffice, although then you'd have to declare skill mod before assigning to it.. Something like:

Code:
if(skill_to_use == FRENZY)
	{
		int AtkRounds = 3;
		int skillmod = 0;

                if(MaxSkill(FRENZY) > 0) 
                        skillmod = 100*GetSkill(FRENZY)/MaxSkill(FRENZY);

		sint32 max_dmg = (26 +  ((((GetLevel()-6) * 2)*skillmod)/100))  * ((100+RuleI(Combat, FrenzyBonus))/100);
		sint32 min_dmg = 0;
		DoAnim(anim2HSlashing);
Although a more thorough check is probably warranted to see if there are any other similar issues.
Reply With Quote