Reverted to using INT32_MAX
This commit is contained in:
parent
d5ce32d7bf
commit
009ba2c0be
@ -1768,13 +1768,13 @@ void clif_homunculus_updatestatus(map_session_data& sd, _sp type) {
|
||||
p.value = static_cast<decltype(p.value)>( std::min<decltype(sd.hd->homunculus.exp)>( sd.hd->homunculus.exp, std::numeric_limits<decltype(PACKET_ZC_PROPERTY_HOMUN::exp)>::max() ) );
|
||||
break;
|
||||
case SP_HP:
|
||||
if (status->max_hp > (std::is_same<decltype(PACKET_ZC_PROPERTY_HOMUN::hp), uint16>::value ? INT16_MAX : std::numeric_limits<std::make_signed<decltype(PACKET_ZC_PROPERTY_HOMUN::hp)>::type>::max() / 100))
|
||||
if (status->max_hp > (std::is_same<decltype(PACKET_ZC_PROPERTY_HOMUN::hp), uint16>::value ? INT16_MAX : INT32_MAX / 100))
|
||||
p.value = status->hp / (status->max_hp / 100);
|
||||
else
|
||||
p.value = static_cast<decltype(p.value)>(status->hp);
|
||||
break;
|
||||
case SP_SP:
|
||||
if (status->max_sp > (std::is_same<decltype(PACKET_ZC_PROPERTY_HOMUN::sp), uint16>::value ? INT16_MAX : std::numeric_limits<std::make_signed<decltype(PACKET_ZC_PROPERTY_HOMUN::sp)>::type>::max() / 100))
|
||||
if (status->max_sp > (std::is_same<decltype(PACKET_ZC_PROPERTY_HOMUN::sp), uint16>::value ? INT16_MAX : INT32_MAX / 100))
|
||||
p.value = status->sp / (status->max_sp / 100);
|
||||
else
|
||||
p.value = static_cast<decltype(p.value)>(status->sp);
|
||||
@ -1828,14 +1828,14 @@ void clif_hominfo( map_session_data *sd, struct homun_data *hd, int flag ){
|
||||
p.amotion = (flag) ? 0 : status->amotion;
|
||||
// Homunculus HP and SP bars will screw up if the percentage calculation exceeds signed values
|
||||
// Tested maximum: 21474836(=INT32_MAX/100), any value above will screw up the bars
|
||||
if( status->max_hp > ( std::is_same<decltype(p.hp), uint16>::value ? INT16_MAX : std::numeric_limits<std::make_signed<decltype(p.hp)>::type>::max() / 100 ) ){
|
||||
if( status->max_hp > ( std::is_same<decltype(p.hp), uint16>::value ? INT16_MAX : INT32_MAX / 100 ) ){
|
||||
p.hp = status->hp / ( status->max_hp / 100 );
|
||||
p.maxHp = 100;
|
||||
}else{
|
||||
p.hp = static_cast<decltype(p.hp)>(status->hp);
|
||||
p.maxHp = static_cast<decltype(p.maxHp)>(status->max_hp);
|
||||
}
|
||||
if( status->max_sp > ( std::is_same<decltype(p.sp), uint16>::value ? INT16_MAX : std::numeric_limits<std::make_signed<decltype(p.sp)>::type>::max() / 100 ) ){
|
||||
if( status->max_sp > ( std::is_same<decltype(p.sp), uint16>::value ? INT16_MAX : INT32_MAX / 100 ) ){
|
||||
p.sp = status->sp / ( status->max_sp / 100 );
|
||||
p.maxSp = 100;
|
||||
}else{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user