From d5ce32d7bf9453f6ef6f2c1fea527b9da94a9475 Mon Sep 17 00:00:00 2001 From: Daegaladh Date: Tue, 27 Aug 2024 23:15:28 +0200 Subject: [PATCH] More fixes --- src/map/clif.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 870f7ac202..050689ee7a 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -1768,13 +1768,13 @@ void clif_homunculus_updatestatus(map_session_data& sd, _sp type) { p.value = static_cast( std::minhomunculus.exp)>( sd.hd->homunculus.exp, std::numeric_limits::max() ) ); break; case SP_HP: - if (status->max_hp > (std::numeric_limits::type>::max() / 100)) + if (status->max_hp > (std::is_same::value ? INT16_MAX : std::numeric_limits::type>::max() / 100)) p.value = status->hp / (status->max_hp / 100); else p.value = static_cast(status->hp); break; case SP_SP: - if (status->max_sp > (std::numeric_limits::type>::max() / 100)) + if (status->max_sp > (std::is_same::value ? INT16_MAX : std::numeric_limits::type>::max() / 100)) p.value = status->sp / (status->max_sp / 100); else p.value = static_cast(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::numeric_limits::max() / 200 ) ){ + if( status->max_hp > ( std::is_same::value ? INT16_MAX : std::numeric_limits::type>::max() / 100 ) ){ p.hp = status->hp / ( status->max_hp / 100 ); p.maxHp = 100; }else{ p.hp = static_cast(status->hp); p.maxHp = static_cast(status->max_hp); } - if( status->max_sp > ( std::numeric_limits::max() / 200) ){ + if( status->max_sp > ( std::is_same::value ? INT16_MAX : std::numeric_limits::type>::max() / 100 ) ){ p.sp = status->sp / ( status->max_sp / 100 ); p.maxSp = 100; }else{