Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Bugs

Archive::Bugs Archive area for Bugs's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #19  
Old 03-17-2003, 03:45 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

Oh Drawde, I figured out whats happening to low end damage... Turns out its a casting problem (surprise surprise)

Heres the offender..

int max_hit = weapon_damage * ((GetSTR() + GetSkill(skillinuse)+ mylevel) / 100);

All these fields are integers.. What happens is that if STR+SKILL+LEVEL < 100, then the total is a 0, and you get 0 * weapon_damage, so your max_hit will always be 0.

What I've done to fix this is to cast the 3 variables to floats, then when they get jammed back into max_hit, it drops the remainder, but you dont lose the <1 case.

The new field is
int max_hit = weapon_damage * (( (float)GetSTR() + (float)GetSkill(skillinuse)+ (float)mylevel) / 100);

A wrote a little driver stub to test this, heres the before and after with a Str of 75, skill of 0, level 1 and weapon_damage of 8.

BEFORE
Damage is : 2
Damage is : 2
Damage is : 2
Damage is : 2
Damage is : 2
Damage is : 2
Damage is : 2
Damage is : 2
Damage is : 2
Damage is : 2
Damage is : 2

AFTER
Damage is : 6
Damage is : 6
Damage is : 2
Damage is : 3
Damage is : 3
Damage is : 6
Damage is : 2
Damage is : 4
Damage is : 4
Damage is : 4
Damage is : 3
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 09:00 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3