Skip to content

Commit

Permalink
jme3-core: Throw IllegalArgumentException in setMaxTransitionWeight i…
Browse files Browse the repository at this point in the history
…nstead of assert
  • Loading branch information
mrxz committed Dec 19, 2022
1 parent 5d1ee26 commit 2d6ebc4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ protected float getTransitionWeight() {
}

/**
* @param maxTransitionWeight The max transition weight. Must be >0 and <1 (default=1)
* @param maxTransitionWeight The max transition weight. Must be >=0 and <=1 (default=1)
* @throws IllegalArgumentException If maxTransitionWeight is not between 0 and 1.
*/
public void setMaxTransitionWeight(double maxTransitionWeight) {
assert maxTransitionWeight >= 0 && maxTransitionWeight <= 1;
if (maxTransitionWeight < 0.0 || maxTransitionWeight > 1.0) {
throw new IllegalArgumentException("maxTransitionWeight must be between 0 and 1");
}

this.maxTransitionWeight = maxTransitionWeight;
}
Expand Down

0 comments on commit 2d6ebc4

Please sign in to comment.