Guest User

Fix

a guest
Oct 9th, 2016
61
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void GenericCAO::refresh(const std::string &data)
  2. {
  3.     infostream<<"GenericCAO: Got init data"<<std::endl;
  4.     std::istringstream is(data, std::ios::binary);
  5.     int num_messages = 0;
  6.     // version
  7.     u8 version = readU8(is);
  8.     // check version
  9.     if(version == 1) // In PROTOCOL_VERSION 14
  10.     {
  11.         m_name = deSerializeString(is);
  12.         m_is_player = readU8(is);
  13.         m_id = readS16(is);
  14.         m_position = readV3F1000(is);
  15.         m_yaw = readF1000(is);
  16.         m_hp = readS16(is);
  17.         num_messages = readU8(is);
  18.     }
  19.     else if(version == 0) // In PROTOCOL_VERSION 13
  20.     {
  21.         m_name = deSerializeString(is);
  22.         m_is_player = readU8(is);
  23.         m_position = readV3F1000(is);
  24.         m_yaw = readF1000(is);
  25.         m_hp = readS16(is);
  26.         num_messages = readU8(is);
  27.     }
  28.     else
  29.     {
  30.         errorstream<<"GenericCAO: Unsupported init data version"
  31.                 <<std::endl;
  32.         return;
  33.     }
  34.  
  35.     for(int i=0; i<num_messages; i++)
  36.     {
  37.         std::string message = deSerializeLongString(is);
  38.         processMessage(message);
  39.     }
  40.  
  41.     pos_translator.init(m_position);
  42.     updateNodePos();
  43. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×