summaryrefslogtreecommitdiff
path: root/src/util/serialize.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-06-08 19:33:46 +0200
committersfan5 <sfan5@live.de>2022-07-14 20:55:45 +0200
commit137eef6590205b7bcdf5273221bc22c17b218f6e (patch)
tree8933aefd5ec6fb351bdf54727f65e379f82ae37c /src/util/serialize.h
parentb204655081f495c9d45fdf7d49d203e910dafc7a (diff)
downloadminetest-137eef6590205b7bcdf5273221bc22c17b218f6e.tar.gz
minetest-137eef6590205b7bcdf5273221bc22c17b218f6e.tar.bz2
minetest-137eef6590205b7bcdf5273221bc22c17b218f6e.zip
Move f1000 sanitizing to the places that still use this type
Diffstat (limited to 'src/util/serialize.h')
-rw-r--r--src/util/serialize.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/util/serialize.h b/src/util/serialize.h
index 2203fff0c..4dc1a54c6 100644
--- a/src/util/serialize.h
+++ b/src/util/serialize.h
@@ -439,16 +439,14 @@ MAKE_STREAM_WRITE_FXN(video::SColor, ARGB8, 4);
//// More serialization stuff
////
-inline void clampToF1000(float &v)
+inline float clampToF1000(float v)
{
- v = core::clamp(v, F1000_MIN, F1000_MAX);
+ return core::clamp(v, F1000_MIN, F1000_MAX);
}
-inline void clampToF1000(v3f &v)
+inline v3f clampToF1000(v3f v)
{
- clampToF1000(v.X);
- clampToF1000(v.Y);
- clampToF1000(v.Z);
+ return {clampToF1000(v.X), clampToF1000(v.Y), clampToF1000(v.Z)};
}
// Creates a string with the length as the first two bytes