Skip to content
Permalink
Browse files

fixed min/max damage visualization in the statusbar

  • Loading branch information...
turleypol committed Oct 3, 2019
1 parent 818c06a commit 1b6594e5ad30927ac9dadcf53e6db2dd4a6f7db5
@@ -2,9 +2,14 @@
<ESCRIPT>
<header>
<topic>Latest Core Changes</topic>
<datemodified>09-30-2019</datemodified>
<datemodified>10-03-2019</datemodified>
</header>
<version name="POL100">
<entry>
<date>10-03-2019</date>
<author>Turley:</author>
<change type="Fixed">min/max damage visualization in the statbar are now cropped between 0 and 65k like damage calculation.</change>
</entry>
<entry>
<date>09-30-2019</date>
<author>Nando:</author>
@@ -1,4 +1,6 @@
-- POL100 --
10-03-2019 Turley:
Fixed: min/max damage visualization in the statbar are now cropped between 0 and 65k like damage calculation.
09-30-2019 Nando:
Changed: Changed default of GetProcess(pid) from 0 to -1 due to compatibility issues with scripts using CInt()'s result directly.
PIDs are now enforced to never represent negative numbers. Please update your os.em and recompile your scripts.
@@ -3141,12 +3141,22 @@ unsigned short Character::random_weapon_damage() const

unsigned short Character::min_weapon_damage() const
{
return weapon->descriptor().damage_dice.min_value() + weapon->damage_mod();
int dmg = static_cast<int>( weapon->descriptor().damage_dice.min_value() ) + weapon->damage_mod();
if ( dmg < 0 )
return 0;
else if ( dmg <= USHRT_MAX )
return static_cast<unsigned short>( dmg );
return USHRT_MAX;
}

unsigned short Character::max_weapon_damage() const
{
return weapon->descriptor().damage_dice.max_value() + weapon->damage_mod();
int dmg = static_cast<int>( weapon->descriptor().damage_dice.max_value() ) + weapon->damage_mod();
if ( dmg < 0 )
return 0;
else if ( dmg <= USHRT_MAX )
return static_cast<unsigned short>( dmg );
return USHRT_MAX;
}

void Character::damage_weapon()

0 comments on commit 1b6594e

Please sign in to comment.
You can’t perform that action at this time.