Explorar o código

Fixed Capping of Values (#8257)

- Values that are added together will now be correctly capped to their max value
- Status resistance can no longer exceed 100% (made negative success rates become positive)
Playtester hai 1 ano
pai
achega
cd7341930e
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      src/common/utilities.hpp

+ 1 - 2
src/common/utilities.hpp

@@ -278,9 +278,8 @@ namespace rathena {
 
 			if( rathena::util::safe_addition( a, b, result ) ){
 				return cap;
-			}else{
-				return result;
 			}
+			return std::min(result, cap);
 		}
 
 		template <typename T> void tolower( T& string ){