forked from metin2/server
Removed MIN/MAX/MINMAX functions, upgraded to C++17, code cleanup
This commit is contained in:
@@ -60,7 +60,7 @@ bool ITEM_MANAGER::ReadCommonDropItemFile(const char * c_pszFileName)
|
||||
if (!p2)
|
||||
break;
|
||||
|
||||
strncpy(szTemp, p, MIN(sizeof(szTemp), (p2 - p) + 1));
|
||||
strncpy(szTemp, p, std::min<size_t>(sizeof(szTemp), (p2 - p) + 1));
|
||||
p = p2 + 1;
|
||||
|
||||
switch (j)
|
||||
@@ -610,7 +610,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
|
||||
|
||||
int iRarePct = 0;
|
||||
str_to_number(iRarePct, pTok->at(3).c_str());
|
||||
iRarePct = MINMAX(0, iRarePct, 100);
|
||||
iRarePct = std::clamp(iRarePct, 0, 100);
|
||||
|
||||
sys_log(0," %s count %d rare %d", name.c_str(), iCount, iRarePct);
|
||||
pkGroup->AddItem(dwVnum, iCount, iPartPct, iRarePct);
|
||||
|
Reference in New Issue
Block a user