Removed MIN/MAX/MINMAX functions, upgraded to C++17, code cleanup

This commit is contained in:
2022-11-27 22:18:08 +02:00
parent 3a74dac29e
commit 148223340c
56 changed files with 230 additions and 404 deletions

View File

@@ -64,7 +64,7 @@ namespace marriage
int TMarriage::GetMarriageGrade()
{
int point = MINMAX(50, GetMarriagePoint(), 100);
int point = std::clamp(GetMarriagePoint(), 50, 100);
if (point < 65)
return 0;
else if (point < 80)
@@ -80,7 +80,7 @@ namespace marriage
{
int value = quest::CQuestManager::instance().GetEventFlag("lovepoint");
if (value)
return MINMAX(0, value, 100);
return std::clamp(value, 0, 100);
}
int point_per_day = MARRIAGE_POINT_PER_DAY;
@@ -112,7 +112,7 @@ namespace marriage
// <20><>¥<EFBFBD><C2A5> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 60% <20>Ϸ<EFBFBD><CFB7><EFBFBD> 6%
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 60%
// <20><>Ż 100%
return MIN(50 + MIN(days * point_per_day, max_limit) + MIN(love_point / 1000000, max_limit), 100);
return std::min(50 + std::min(days * point_per_day, max_limit) + std::min(love_point / 1000000, max_limit), 100);
}
bool TMarriage::IsNear()
@@ -433,7 +433,7 @@ namespace marriage
bSave = true;
love_point += point;
love_point = MIN( love_point, 2000000000 );
love_point = std::min( love_point, 2000000000 );
if (test_server)
{