瀏覽代碼

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 1 年之前
父節點
當前提交
cd7341930e
共有 1 個文件被更改,包括 1 次插入2 次删除
  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 ){