mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Sanitize player position and speed server-side (#12396)
This commit is contained in:
parent
3107c98591
commit
3ac5a24b12
4 changed files with 25 additions and 6 deletions
|
@ -439,6 +439,18 @@ MAKE_STREAM_WRITE_FXN(video::SColor, ARGB8, 4);
|
|||
//// More serialization stuff
|
||||
////
|
||||
|
||||
inline void clampToF1000(float &v)
|
||||
{
|
||||
v = core::clamp(v, F1000_MIN, F1000_MAX);
|
||||
}
|
||||
|
||||
inline void clampToF1000(v3f &v)
|
||||
{
|
||||
clampToF1000(v.X);
|
||||
clampToF1000(v.Y);
|
||||
clampToF1000(v.Z);
|
||||
}
|
||||
|
||||
// Creates a string with the length as the first two bytes
|
||||
std::string serializeString16(const std::string &plain);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue