Skip to content

Commit

Permalink
fix move object rotation when optional args are not set
Browse files Browse the repository at this point in the history
  • Loading branch information
ksenonadv committed Oct 22, 2023
1 parent fe77600 commit ccef87f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Server/Components/Objects/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ccef87f

Please sign in to comment.