From: sapier Date: Sun, 15 Jan 2012 20:44:51 +0000 (+0100) Subject: fix object message type sent X-Git-Tag: sapier-20120115~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e3122ae727a1c75207051b67249f23d88dbb5c5d;p=oweals%2Fminetest.git fix object message type sent --- diff --git a/src/content_cao_firefly.cpp b/src/content_cao_firefly.cpp index d54e57d35..677bc9ada 100644 --- a/src/content_cao_firefly.cpp +++ b/src/content_cao_firefly.cpp @@ -132,7 +132,7 @@ public: std::istringstream is(data, std::ios::binary); // command u8 cmd = readU8(is); - if(cmd == 0) + if(cmd == AO_Message_type::SetPosition) { // pos m_position = readV3F1000(is); diff --git a/src/content_cao_item.cpp b/src/content_cao_item.cpp index 8d1bfb413..24d47d674 100644 --- a/src/content_cao_item.cpp +++ b/src/content_cao_item.cpp @@ -175,7 +175,7 @@ public: std::istringstream is(data, std::ios::binary); // command u8 cmd = readU8(is); - if(cmd == 0) + if(cmd == AO_Message_type::SetPosition) { // pos m_position = readV3F1000(is); diff --git a/src/content_cao_lua.cpp b/src/content_cao_lua.cpp index 4a047fc58..afb98c2ea 100644 --- a/src/content_cao_lua.cpp +++ b/src/content_cao_lua.cpp @@ -353,7 +353,7 @@ public: std::istringstream is(data, std::ios::binary); // command u8 cmd = readU8(is); - if(cmd == 0) // update position + if(cmd == AO_Message_type::SetPosition) // update position { // do_interpolate bool do_interpolate = readU8(is); @@ -378,12 +378,12 @@ public: } updateNodePos(); } - else if(cmd == 1) // set texture modification + else if(cmd == AO_Message_type::SetTextureMod) // set texture modification { std::string mod = deSerializeString(is); updateTextures(mod); } - else if(cmd == 2) // set sprite + else if(cmd == AO_Message_type::SetSprite) // set sprite { v2s16 p = readV2S16(is); int num_frames = readU16(is); diff --git a/src/content_cao_mobv2.cpp b/src/content_cao_mobv2.cpp index 403b8592e..825abb5e8 100644 --- a/src/content_cao_mobv2.cpp +++ b/src/content_cao_mobv2.cpp @@ -283,7 +283,7 @@ public: u8 cmd = readU8(is); // Move - if(cmd == 0) + if(cmd == AO_Message_type::SetPosition) { // pos m_position = readV3F1000(is); @@ -297,7 +297,7 @@ public: updateNodePos(); } // Damage - else if(cmd == 1) + else if(cmd == AO_Message_type::TakeDamage) { //u16 damage = readU16(is); @@ -313,7 +313,7 @@ public: m_damage_visual_timer = 0.2;*/ } // Trigger shooting - else if(cmd == 2) + else if(cmd == AO_Message_type::Shoot) { // length m_shooting_unset_timer = readF1000(is); diff --git a/src/content_cao_oerkki1.cpp b/src/content_cao_oerkki1.cpp index 920a9890c..891b84b89 100644 --- a/src/content_cao_oerkki1.cpp +++ b/src/content_cao_oerkki1.cpp @@ -215,7 +215,7 @@ public: std::istringstream is(data, std::ios::binary); // command u8 cmd = readU8(is); - if(cmd == 0) + if(cmd == AO_Message_type::SetPosition) { // pos m_position = readV3F1000(is); @@ -224,7 +224,7 @@ public: m_yaw = readF1000(is); updateNodePos(); } - else if(cmd == 1) + else if(cmd == AO_Message_type::TakeDamage) { //u16 damage = readU8(is); m_damage_visual_timer = 1.0; diff --git a/src/content_cao_player.cpp b/src/content_cao_player.cpp index bfa994f80..d5b15c261 100644 --- a/src/content_cao_player.cpp +++ b/src/content_cao_player.cpp @@ -230,7 +230,7 @@ public: std::istringstream is(data, std::ios::binary); // command u8 cmd = readU8(is); - if(cmd == 0) // update position + if(cmd == AO_Message_type::SetPosition) // update position { // pos m_position = readV3F1000(is); @@ -241,7 +241,7 @@ public: updateNodePos(); } - else if(cmd == 1) // punched + else if(cmd == AO_Message_type::Punched) // punched { // damage s16 damage = readS16(is); diff --git a/src/content_cao_rat.cpp b/src/content_cao_rat.cpp index 23bec7fe5..30d07832f 100644 --- a/src/content_cao_rat.cpp +++ b/src/content_cao_rat.cpp @@ -135,7 +135,7 @@ public: std::istringstream is(data, std::ios::binary); // command u8 cmd = readU8(is); - if(cmd == 0) + if(cmd == AO_Message_type::SetPosition) { // pos m_position = readV3F1000(is); diff --git a/src/content_cao_test.cpp b/src/content_cao_test.cpp index f062b73f6..430180529 100644 --- a/src/content_cao_test.cpp +++ b/src/content_cao_test.cpp @@ -125,7 +125,7 @@ public: std::istringstream is(data, std::ios::binary); u16 cmd; is>>cmd; - if(cmd == 0) + if(cmd == AO_Message_type::SetPosition) { v3f newpos; is>>newpos.X;