summaryrefslogtreecommitdiff
path: root/src/content_sao.cpp
diff options
context:
space:
mode:
authorWeblate <42@minetest.ru>2013-04-07 13:39:28 +0200
committerWeblate <42@minetest.ru>2013-04-07 13:39:28 +0200
commitfeb7de91ec34ef1ca3152270a7bc62b2e308f1bd (patch)
tree65c33378bae9b7ac565b979237b6d594b511171f /src/content_sao.cpp
parent33052abf42886ef03c4f46196cab6f767259a672 (diff)
parent4468ea84e6d0faede5a01e8d97d359c537aa7ec8 (diff)
downloadminetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.tar.gz
minetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.tar.bz2
minetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.zip
Merge remote branch 'origin/master'
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r--src/content_sao.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index ae08b4260..e6c8c725c 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -935,7 +935,11 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, Player *player_, u16 peer_id_,
m_moved(false),
m_inventory_not_sent(false),
m_hp_not_sent(false),
- m_wielded_item_not_sent(false)
+ m_wielded_item_not_sent(false),
+ m_physics_override_speed(1),
+ m_physics_override_jump(1),
+ m_physics_override_gravity(1),
+ m_physics_override_sent(false)
{
assert(m_player);
assert(m_peer_id != 0);
@@ -1019,7 +1023,7 @@ std::string PlayerSAO::getClientInitializationData(u16 protocol_version)
writeF1000(os, m_player->getYaw());
writeS16(os, getHP());
- writeU8(os, 4 + m_bone_position.size()); // number of messages stuffed in here
+ writeU8(os, 5 + m_bone_position.size()); // number of messages stuffed in here
os<<serializeLongString(getPropertyPacket()); // message 1
os<<serializeLongString(gob_cmd_update_armor_groups(m_armor_groups)); // 2
os<<serializeLongString(gob_cmd_update_animation(m_animation_range, m_animation_speed, m_animation_blend)); // 3
@@ -1027,6 +1031,7 @@ std::string PlayerSAO::getClientInitializationData(u16 protocol_version)
os<<serializeLongString(gob_cmd_update_bone_position((*ii).first, (*ii).second.X, (*ii).second.Y)); // m_bone_position.size
}
os<<serializeLongString(gob_cmd_update_attachment(m_attachment_parent_id, m_attachment_bone, m_attachment_position, m_attachment_rotation)); // 4
+ os<<serializeLongString(gob_cmd_update_physics_override(m_physics_override_speed, m_physics_override_jump, m_physics_override_gravity)); // 5
}
else
{
@@ -1196,6 +1201,14 @@ void PlayerSAO::step(float dtime, bool send_recommended)
m_messages_out.push_back(aom);
}
+ if(m_physics_override_sent == false){
+ m_physics_override_sent = true;
+ std::string str = gob_cmd_update_physics_override(m_physics_override_speed, m_physics_override_jump, m_physics_override_gravity);
+ // create message and add to list
+ ActiveObjectMessage aom(getId(), true, str);
+ m_messages_out.push_back(aom);
+ }
+
if(m_animation_sent == false){
m_animation_sent = true;
std::string str = gob_cmd_update_animation(m_animation_range, m_animation_speed, m_animation_blend);