From 137eef6590205b7bcdf5273221bc22c17b218f6e Mon Sep 17 00:00:00 2001 From: sfan5 Date: Wed, 8 Jun 2022 19:33:46 +0200 Subject: Move f1000 sanitizing to the places that still use this type --- src/player.h | 1 - src/server/luaentity_sao.cpp | 2 +- src/server/player_sao.cpp | 6 ------ src/staticobject.cpp | 4 ++-- src/staticobject.h | 2 +- src/util/serialize.h | 10 ++++------ 6 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/player.h b/src/player.h index cc1357010..beca82f66 100644 --- a/src/player.h +++ b/src/player.h @@ -141,7 +141,6 @@ public: void setSpeed(v3f speed) { - clampToF1000(speed); m_speed = speed; } diff --git a/src/server/luaentity_sao.cpp b/src/server/luaentity_sao.cpp index a0a8aede0..ab4a9e3f2 100644 --- a/src/server/luaentity_sao.cpp +++ b/src/server/luaentity_sao.cpp @@ -290,7 +290,7 @@ void LuaEntitySAO::getStaticData(std::string *result) const os<setDirty(true); diff --git a/src/staticobject.cpp b/src/staticobject.cpp index 1160ec68f..f92995d0b 100644 --- a/src/staticobject.cpp +++ b/src/staticobject.cpp @@ -28,12 +28,12 @@ StaticObject::StaticObject(const ServerActiveObject *s_obj, const v3f &pos_): s_obj->getStaticData(&data); } -void StaticObject::serialize(std::ostream &os) +void StaticObject::serialize(std::ostream &os) const { // type writeU8(os, type); // pos - writeV3F1000(os, pos); + writeV3F1000(os, clampToF1000(pos)); // data os<