mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
fix object message type sent
This commit is contained in:
parent
65ac1d46b3
commit
e3122ae727
8 changed files with 14 additions and 14 deletions
|
@ -132,7 +132,7 @@ public:
|
||||||
std::istringstream is(data, std::ios::binary);
|
std::istringstream is(data, std::ios::binary);
|
||||||
// command
|
// command
|
||||||
u8 cmd = readU8(is);
|
u8 cmd = readU8(is);
|
||||||
if(cmd == 0)
|
if(cmd == AO_Message_type::SetPosition)
|
||||||
{
|
{
|
||||||
// pos
|
// pos
|
||||||
m_position = readV3F1000(is);
|
m_position = readV3F1000(is);
|
||||||
|
|
|
@ -175,7 +175,7 @@ public:
|
||||||
std::istringstream is(data, std::ios::binary);
|
std::istringstream is(data, std::ios::binary);
|
||||||
// command
|
// command
|
||||||
u8 cmd = readU8(is);
|
u8 cmd = readU8(is);
|
||||||
if(cmd == 0)
|
if(cmd == AO_Message_type::SetPosition)
|
||||||
{
|
{
|
||||||
// pos
|
// pos
|
||||||
m_position = readV3F1000(is);
|
m_position = readV3F1000(is);
|
||||||
|
|
|
@ -353,7 +353,7 @@ public:
|
||||||
std::istringstream is(data, std::ios::binary);
|
std::istringstream is(data, std::ios::binary);
|
||||||
// command
|
// command
|
||||||
u8 cmd = readU8(is);
|
u8 cmd = readU8(is);
|
||||||
if(cmd == 0) // update position
|
if(cmd == AO_Message_type::SetPosition) // update position
|
||||||
{
|
{
|
||||||
// do_interpolate
|
// do_interpolate
|
||||||
bool do_interpolate = readU8(is);
|
bool do_interpolate = readU8(is);
|
||||||
|
@ -378,12 +378,12 @@ public:
|
||||||
}
|
}
|
||||||
updateNodePos();
|
updateNodePos();
|
||||||
}
|
}
|
||||||
else if(cmd == 1) // set texture modification
|
else if(cmd == AO_Message_type::SetTextureMod) // set texture modification
|
||||||
{
|
{
|
||||||
std::string mod = deSerializeString(is);
|
std::string mod = deSerializeString(is);
|
||||||
updateTextures(mod);
|
updateTextures(mod);
|
||||||
}
|
}
|
||||||
else if(cmd == 2) // set sprite
|
else if(cmd == AO_Message_type::SetSprite) // set sprite
|
||||||
{
|
{
|
||||||
v2s16 p = readV2S16(is);
|
v2s16 p = readV2S16(is);
|
||||||
int num_frames = readU16(is);
|
int num_frames = readU16(is);
|
||||||
|
|
|
@ -283,7 +283,7 @@ public:
|
||||||
u8 cmd = readU8(is);
|
u8 cmd = readU8(is);
|
||||||
|
|
||||||
// Move
|
// Move
|
||||||
if(cmd == 0)
|
if(cmd == AO_Message_type::SetPosition)
|
||||||
{
|
{
|
||||||
// pos
|
// pos
|
||||||
m_position = readV3F1000(is);
|
m_position = readV3F1000(is);
|
||||||
|
@ -297,7 +297,7 @@ public:
|
||||||
updateNodePos();
|
updateNodePos();
|
||||||
}
|
}
|
||||||
// Damage
|
// Damage
|
||||||
else if(cmd == 1)
|
else if(cmd == AO_Message_type::TakeDamage)
|
||||||
{
|
{
|
||||||
//u16 damage = readU16(is);
|
//u16 damage = readU16(is);
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ public:
|
||||||
m_damage_visual_timer = 0.2;*/
|
m_damage_visual_timer = 0.2;*/
|
||||||
}
|
}
|
||||||
// Trigger shooting
|
// Trigger shooting
|
||||||
else if(cmd == 2)
|
else if(cmd == AO_Message_type::Shoot)
|
||||||
{
|
{
|
||||||
// length
|
// length
|
||||||
m_shooting_unset_timer = readF1000(is);
|
m_shooting_unset_timer = readF1000(is);
|
||||||
|
|
|
@ -215,7 +215,7 @@ public:
|
||||||
std::istringstream is(data, std::ios::binary);
|
std::istringstream is(data, std::ios::binary);
|
||||||
// command
|
// command
|
||||||
u8 cmd = readU8(is);
|
u8 cmd = readU8(is);
|
||||||
if(cmd == 0)
|
if(cmd == AO_Message_type::SetPosition)
|
||||||
{
|
{
|
||||||
// pos
|
// pos
|
||||||
m_position = readV3F1000(is);
|
m_position = readV3F1000(is);
|
||||||
|
@ -224,7 +224,7 @@ public:
|
||||||
m_yaw = readF1000(is);
|
m_yaw = readF1000(is);
|
||||||
updateNodePos();
|
updateNodePos();
|
||||||
}
|
}
|
||||||
else if(cmd == 1)
|
else if(cmd == AO_Message_type::TakeDamage)
|
||||||
{
|
{
|
||||||
//u16 damage = readU8(is);
|
//u16 damage = readU8(is);
|
||||||
m_damage_visual_timer = 1.0;
|
m_damage_visual_timer = 1.0;
|
||||||
|
|
|
@ -230,7 +230,7 @@ public:
|
||||||
std::istringstream is(data, std::ios::binary);
|
std::istringstream is(data, std::ios::binary);
|
||||||
// command
|
// command
|
||||||
u8 cmd = readU8(is);
|
u8 cmd = readU8(is);
|
||||||
if(cmd == 0) // update position
|
if(cmd == AO_Message_type::SetPosition) // update position
|
||||||
{
|
{
|
||||||
// pos
|
// pos
|
||||||
m_position = readV3F1000(is);
|
m_position = readV3F1000(is);
|
||||||
|
@ -241,7 +241,7 @@ public:
|
||||||
|
|
||||||
updateNodePos();
|
updateNodePos();
|
||||||
}
|
}
|
||||||
else if(cmd == 1) // punched
|
else if(cmd == AO_Message_type::Punched) // punched
|
||||||
{
|
{
|
||||||
// damage
|
// damage
|
||||||
s16 damage = readS16(is);
|
s16 damage = readS16(is);
|
||||||
|
|
|
@ -135,7 +135,7 @@ public:
|
||||||
std::istringstream is(data, std::ios::binary);
|
std::istringstream is(data, std::ios::binary);
|
||||||
// command
|
// command
|
||||||
u8 cmd = readU8(is);
|
u8 cmd = readU8(is);
|
||||||
if(cmd == 0)
|
if(cmd == AO_Message_type::SetPosition)
|
||||||
{
|
{
|
||||||
// pos
|
// pos
|
||||||
m_position = readV3F1000(is);
|
m_position = readV3F1000(is);
|
||||||
|
|
|
@ -125,7 +125,7 @@ public:
|
||||||
std::istringstream is(data, std::ios::binary);
|
std::istringstream is(data, std::ios::binary);
|
||||||
u16 cmd;
|
u16 cmd;
|
||||||
is>>cmd;
|
is>>cmd;
|
||||||
if(cmd == 0)
|
if(cmd == AO_Message_type::SetPosition)
|
||||||
{
|
{
|
||||||
v3f newpos;
|
v3f newpos;
|
||||||
is>>newpos.X;
|
is>>newpos.X;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue