aboutsummaryrefslogtreecommitdiff
path: root/src/server/player_sao.cpp
diff options
context:
space:
mode:
authorJordan Snelling <jordach.snelling@gmail.com>2020-10-04 14:10:34 +0100
committerGitHub <noreply@github.com>2020-10-04 15:10:34 +0200
commit3068853e8a58ccc7370a5ce977c08223601c497a (patch)
tree07463fe9e41197a743bac3a4cea5d63c22402297 /src/server/player_sao.cpp
parent0f98b54aa4b2361575002d92b29fe222703ba557 (diff)
downloadminetest-3068853e8a58ccc7370a5ce977c08223601c497a.tar.gz
minetest-3068853e8a58ccc7370a5ce977c08223601c497a.tar.bz2
minetest-3068853e8a58ccc7370a5ce977c08223601c497a.zip
Add First Person Attachments (#10360)
Fixes some other third person camera specific attachments. Implements a single new flag for entities to be forced visible in first person mode. Old mods do not need to be updated to use the new flag and are fully backwards compatible.
Diffstat (limited to 'src/server/player_sao.cpp')
-rw-r--r--src/server/player_sao.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/server/player_sao.cpp b/src/server/player_sao.cpp
index 8d4938c3c..344d18a20 100644
--- a/src/server/player_sao.cpp
+++ b/src/server/player_sao.cpp
@@ -122,10 +122,10 @@ std::string PlayerSAO::getClientInitializationData(u16 protocol_version)
msg_os << serializeString32(generateUpdateAnimationCommand()); // 3
for (const auto &bone_pos : m_bone_position) {
msg_os << serializeString32(generateUpdateBonePositionCommand(
- bone_pos.first, bone_pos.second.X, bone_pos.second.Y)); // m_bone_position.size
+ bone_pos.first, bone_pos.second.X, bone_pos.second.Y)); // 3 + N
}
- msg_os << serializeString32(generateUpdateAttachmentCommand()); // 4
- msg_os << serializeString32(generateUpdatePhysicsOverrideCommand()); // 5
+ msg_os << serializeString32(generateUpdateAttachmentCommand()); // 4 + m_bone_position.size
+ msg_os << serializeString32(generateUpdatePhysicsOverrideCommand()); // 5 + m_bone_position.size
int message_count = 5 + m_bone_position.size();
@@ -569,7 +569,8 @@ bool PlayerSAO::checkMovementCheat()
int parent_id;
std::string bone;
v3f attachment_rot;
- getAttachment(&parent_id, &bone, &attachment_pos, &attachment_rot);
+ bool force_visible;
+ getAttachment(&parent_id, &bone, &attachment_pos, &attachment_rot, &force_visible);
}
v3f parent_pos = parent->getBasePosition();