Skip to content

Commit 478af32

Browse files
authored
BlendableAction: Fix JavaDoc for setMaxTransitionWeight & replace assert with IllegalArgumentException (#1881)
1 parent 5d1ee26 commit 478af32

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

jme3-core/src/main/java/com/jme3/anim/tween/action/BlendableAction.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,13 @@ protected float getTransitionWeight() {
114114
}
115115

116116
/**
117-
* @param maxTransitionWeight The max transition weight. Must be >0 and <1 (default=1)
117+
* @param maxTransitionWeight The max transition weight. Must be >=0 and <=1 (default=1)
118+
* @throws IllegalArgumentException If maxTransitionWeight is not between 0 and 1.
118119
*/
119120
public void setMaxTransitionWeight(double maxTransitionWeight) {
120-
assert maxTransitionWeight >= 0 && maxTransitionWeight <= 1;
121+
if (maxTransitionWeight < 0.0 || maxTransitionWeight > 1.0) {
122+
throw new IllegalArgumentException("maxTransitionWeight must be between 0 and 1");
123+
}
121124

122125
this.maxTransitionWeight = maxTransitionWeight;
123126
}

0 commit comments

Comments
 (0)