From ccef87f423a8088d887d1d2035befa8861dab2d3 Mon Sep 17 00:00:00 2001 From: kseny Date: Sun, 22 Oct 2023 11:57:52 +0300 Subject: [PATCH] fix move object rotation when optional args are not set --- Server/Components/Objects/object.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Server/Components/Objects/object.hpp b/Server/Components/Objects/object.hpp index a40f324f9..b84a8be91 100644 --- a/Server/Components/Objects/object.hpp +++ b/Server/Components/Objects/object.hpp @@ -213,9 +213,11 @@ class BaseObject : public ObjectType, public PoolIDProvider, public NoCopy moving_ = true; moveData_ = data; - /// targetRot being NAN will result in rotSpeed being NAN resulting in no rotation if (moveData_.targetRot.x == -1000.0f && moveData_.targetRot.y == -1000.0f && moveData_.targetRot.z == -1000.0f) { + /// Send client current object rotation. + moveData_.targetRot = this->rot_; + /// targetRot being NAN will result in rotSpeed being NAN resulting in no server side rotation rotSpeed_ = NAN; } else