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);
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);
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);
}
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);
u8 cmd = readU8(is);
// Move
- if(cmd == 0)
+ if(cmd == AO_Message_type::SetPosition)
{
// pos
m_position = readV3F1000(is);
updateNodePos();
}
// Damage
- else if(cmd == 1)
+ else if(cmd == AO_Message_type::TakeDamage)
{
//u16 damage = readU16(is);
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);
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);
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;
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);
updateNodePos();
}
- else if(cmd == 1) // punched
+ else if(cmd == AO_Message_type::Punched) // punched
{
// damage
s16 damage = readS16(is);
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);
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;