Adjust EXP storage to uint64 (#4377)
* Updates EXP table to 200/70 * Always store exp as uint64 no matter the client date. * Adjusts guild exp to uint64. Co-authored-by: Aleos <aleos89@users.noreply.github.com> Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
@@ -69,28 +69,6 @@ int levenshtein(const std::string &s1, const std::string &s2)
|
||||
return result;
|
||||
}
|
||||
|
||||
bool rathena::util::safe_addition( int64 a, int64 b, int64& result ){
|
||||
#if __has_builtin( __builtin_add_overflow ) || ( defined( __GNUC__ ) && !defined( __clang__ ) && defined( GCC_VERSION ) && GCC_VERSION >= 50100 )
|
||||
return __builtin_add_overflow( a, b, &result );
|
||||
#else
|
||||
bool overflow = false;
|
||||
|
||||
if( b < 0 ){
|
||||
if( a < ( INT64_MIN - b ) ){
|
||||
overflow = true;
|
||||
}
|
||||
}else{
|
||||
if( a > ( INT64_MAX - b ) ){
|
||||
overflow = true;
|
||||
}
|
||||
}
|
||||
|
||||
result = a + b;
|
||||
|
||||
return overflow;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool rathena::util::safe_substraction( int64 a, int64 b, int64& result ){
|
||||
#if __has_builtin( __builtin_sub_overflow ) || ( defined( __GNUC__ ) && !defined( __clang__ ) && defined( GCC_VERSION ) && GCC_VERSION >= 50100 )
|
||||
return __builtin_sub_overflow( a, b, &result );
|
||||
|
||||
Reference in New Issue
Block a user