From 05ff4dc6f3de2d3e9dac92ddca80974b3f461be2 Mon Sep 17 00:00:00 2001 From: CoderGamester Date: Sat, 30 Nov 2024 15:57:58 +0000 Subject: [PATCH] **Fixed**: - Fixed the *RngLogic.Range(float, float, bool)* method to allow having the same min and max values with maxInclusive set to true --- CHANGELOG.md | 5 +++++ Runtime/RngService.cs | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1d8e15..c14482f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [0.14.1] - 2024-11-30 + +**Fixed**: +- Fixed the *RngLogic.Range(float, float, bool)* method to allow having the same min and max values with maxInclusive set to true + ## [0.14.0] - 2024-11-15 **New**: diff --git a/Runtime/RngService.cs b/Runtime/RngService.cs index a7eecbb..b7d583a 100644 --- a/Runtime/RngService.cs +++ b/Runtime/RngService.cs @@ -220,7 +220,7 @@ public static int Range(int min, int max, int[] rndState, bool maxInclusive) /// public static floatP Range(floatP min, floatP max, int[] rndState, bool maxInclusive) { - if (min > max || maxInclusive && Math.Abs(min - max) < floatP.Epsilon) + if (min > max || (!maxInclusive && Math.Abs(min - max) < floatP.Epsilon)) { throw new IndexOutOfRangeException("The min range value must be less the max range value"); } diff --git a/package.json b/package.json index 3576be2..cd85561 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.gamelovers.services", "displayName": "Services", "author": "Miguel Tomas", - "version": "0.14.0", + "version": "0.14.1", "unity": "2022.3", "license": "MIT", "description": "The purpose of this package is to provide a set of services to ease the development of a basic game architecture",