Index: data_loader.cpp =================================================================== --- data_loader.cpp (revision 4080) +++ data_loader.cpp (working copy) @@ -233,7 +233,13 @@ PPlayer->race = (uint8) Sql_GetIntData(SqlHandle, 9); PPlayer->rank = (uint8) Sql_GetIntData(SqlHandle, 6 + PPlayer->nation); - PPlayer->slvl = (PPlayer->slvl > (PPlayer->mlvl >> 1) ? (PPlayer->mlvl == 1 ? 1 : (PPlayer->mlvl >> 1)) : PPlayer->slvl); + if (search_config.SJ_CAP == 1) PPlayer->slvl = (PPlayer->slvl > (PPlayer->mlvl >> 1) ? (PPlayer->mlvl == 1 ? 1 : (PPlayer->mlvl >> 1)) : PPlayer->slvl); + else if (search_config.SJ_CAP == 2) PPlayer->slvl = (PPlayer->slvl > ((PPlayer->mlvl) / 3) ? (PPlayer->mlvl == 1 ? 1 : ((PPlayer->mlvl) / 3)) : PPlayer->slvl); + else if (search_config.SJ_CAP == 3) PPlayer->slvl = (PPlayer->slvl > (((PPlayer->mlvl) * 2) / 3) ? (PPlayer->mlvl == 1 ? 1 : (((PPlayer->mlvl) * 2) / 3)) : PPlayer->slvl); + else if (search_config.SJ_CAP == 4) PPlayer->slvl = (PPlayer->slvl > PPlayer->mlvl ? (PPlayer->mlvl == 1 ? 1 : PPlayer->mlvl) : PPlayer->slvl); + else if (search_config.SJ_CAP >= 5) PPlayer->slvl = 0; + else if (search_config.SJ_CAP <= 0) PPlayer->slvl = 0; + PPlayer->zone = (PPlayer->zone == 0 ? PPlayer->prevzone : PPlayer->zone); uint32 partyid = (uint32)Sql_GetUIntData(SqlHandle, 1); @@ -333,7 +339,12 @@ PPlayer->race = (uint8) Sql_GetIntData(SqlHandle, 8); PPlayer->rank = (uint8) Sql_GetIntData(SqlHandle, 5 + PPlayer->nation); - PPlayer->slvl = (PPlayer->slvl > (PPlayer->mlvl >> 1) ? (PPlayer->mlvl == 1 ? 1 : (PPlayer->mlvl >> 1)) : PPlayer->slvl); + if (search_config.SJ_CAP == 1) PPlayer->slvl = (PPlayer->slvl > (PPlayer->mlvl >> 1) ? (PPlayer->mlvl == 1 ? 1 : (PPlayer->mlvl >> 1)) : PPlayer->slvl); + else if (search_config.SJ_CAP == 2) PPlayer->slvl = (PPlayer->slvl > ((PPlayer->mlvl) / 3) ? (PPlayer->mlvl == 1 ? 1 : ((PPlayer->mlvl) / 3)) : PPlayer->slvl); + else if (search_config.SJ_CAP == 3) PPlayer->slvl = (PPlayer->slvl > (((PPlayer->mlvl) * 2) / 3) ? (PPlayer->mlvl == 1 ? 1 : (((PPlayer->mlvl) * 2) / 3)) : PPlayer->slvl); + else if (search_config.SJ_CAP == 4) PPlayer->slvl = (PPlayer->slvl > PPlayer->mlvl ? (PPlayer->mlvl == 1 ? 1 : PPlayer->mlvl) : PPlayer->slvl); + else if (search_config.SJ_CAP >= 5) PPlayer->slvl = 0; + else if (search_config.SJ_CAP <= 0) PPlayer->slvl = 0; uint32 nameflag = (uint32)Sql_GetUIntData(SqlHandle, 9); @@ -394,8 +405,14 @@ PPlayer->race = (uint8) Sql_GetIntData(SqlHandle, 8); PPlayer->rank = (uint8) Sql_GetIntData(SqlHandle, 5 + PPlayer->nation); PPlayer->linkshell = (uint8) Sql_GetIntData(SqlHandle, 35); - PPlayer->slvl = (PPlayer->slvl > (PPlayer->mlvl >> 1) ? (PPlayer->mlvl == 1 ? 1 : (PPlayer->mlvl >> 1)) : PPlayer->slvl); + if (search_config.SJ_CAP == 1) PPlayer->slvl = (PPlayer->slvl > (PPlayer->mlvl >> 1) ? (PPlayer->mlvl == 1 ? 1 : (PPlayer->mlvl >> 1)) : PPlayer->slvl); + else if (search_config.SJ_CAP == 2) PPlayer->slvl = (PPlayer->slvl > ((PPlayer->mlvl) / 3) ? (PPlayer->mlvl == 1 ? 1 : ((PPlayer->mlvl) / 3)) : PPlayer->slvl); + else if (search_config.SJ_CAP == 3) PPlayer->slvl = (PPlayer->slvl > (((PPlayer->mlvl) * 2) / 3) ? (PPlayer->mlvl == 1 ? 1 : (((PPlayer->mlvl) * 2) / 3)) : PPlayer->slvl); + else if (search_config.SJ_CAP == 4) PPlayer->slvl = (PPlayer->slvl > PPlayer->mlvl ? (PPlayer->mlvl == 1 ? 1 : PPlayer->mlvl) : PPlayer->slvl); + else if (search_config.SJ_CAP >= 5) PPlayer->slvl = 0; + else if (search_config.SJ_CAP <= 0) PPlayer->slvl = 0; + uint32 partyid = (uint32)Sql_GetUIntData(SqlHandle, 1); uint32 nameflag = (uint32)Sql_GetUIntData(SqlHandle, 9); Index: search.cpp =================================================================== --- search.cpp (revision 4080) +++ search.cpp (working copy) @@ -324,6 +324,7 @@ search_config.mysql_password = "root"; search_config.mysql_database = "dspdb"; search_config.mysql_port = 3306; + search_config.SJ_CAP = 1; } /************************************************************************ @@ -379,6 +380,10 @@ { search_config.mysql_database = aStrdup(w2); } + else if (strcmp(w1,"SJ_CAP") == 0) + { + search_config.SJ_CAP = atoi(w2); + } else { ShowWarning(CL_YELLOW"Unknown setting '%s' in file %s\n" CL_RESET, w1, file); Index: search.h =================================================================== --- search.h (revision 4080) +++ search.h (working copy) @@ -31,6 +31,7 @@ const int8* mysql_login; // mysql login -> default root const int8* mysql_password; // mysql pass -> default root const int8* mysql_database; // mysql database -> default dspdb + int8 SJ_CAP; // enable alternate sj calculations }; struct search_req