diff options
| author | robojumper <robojumper@gmail.com> | 2024-11-06 22:43:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-06 16:43:27 -0500 |
| commit | aaf88fa648557435a2af5c4bc1436507c2b0042c (patch) | |
| tree | 1a512fa1a34da7c02c446f9e58f6cb9fcd0938fb /include/c | |
| parent | 9334796eef3caa2c9ff0bc9c6cfca0677a269a04 (diff) | |
Clean up special item drop mgr (#87)
* Clean up special item drop mgr
* Progress
* Mostly matching
* Docs
Diffstat (limited to 'include/c')
| -rw-r--r-- | include/c/c_math.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/c/c_math.h b/include/c/c_math.h index 8b95bf71..ee21fe0d 100644 --- a/include/c/c_math.h +++ b/include/c/c_math.h @@ -11,7 +11,14 @@ int rndInt(int max); f32 rndF(f32 max); f32 rndFX(f32 amp); -template <typename T> +template <typename T> +T rndRange(T min, T max) { + f32 r = cM::rndF(max - min); + f32 m = min; + m += r; + return m; +} + inline T minMaxLimit(T val, T min, T max) { return (T)((T)val < (T)min ? (T)min : ((T)val > (T)max ? (T)max : (T)val)); } |
