[0.69.420-PUBLIC#1732] Libido clamp in creature.js code error, always sets libido to minimum

one_two

Well-Known Member
Jan 20, 2022
457
130
A bit of code in libido() function attempts to keep the libidoRaw value within libido min-max range, but badly placed parentheses turn it into a 3-argument call for Math.min(), while Math.max() receives just one argument -- the outcome of Math.min()

As a result, calls to libido() function which are intended to change libido only ever set it to current min level (or less).

currently:

JavaScript:
            this.libidoRaw = Math.max(Math.min(this.libidoRaw, this.libidoMax(true), this.libidoMin()));

should be:

JavaScript:
            this.libidoRaw = Math.max(Math.min(this.libidoRaw, this.libidoMax(true)), this.libidoMin());
 
Last edited: