Fix LuaEntitySAO::getClientInitializationData() and bump the related version
authorPerttu Ahola <celeron55@gmail.com>
Mon, 26 Nov 2012 07:10:27 +0000 (09:10 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Mon, 26 Nov 2012 07:10:27 +0000 (09:10 +0200)
src/content_cao.cpp
src/content_sao.cpp

index 339c9f2480de1bc00b6175352980a0de84e99422..ce41c83126577a9eed2d0b87cca2a6d1fe9db371 100644 (file)
@@ -650,7 +650,7 @@ public:
                // version
                u8 version = readU8(is);
                // check version
-               if(version != 0){
+               if(version != 1){
                        errorstream<<"GenericCAO: Unsupported init data version"
                                        <<std::endl;
                        return;
index 406bd9c6856e5d830f4464df56288e76d21358f1..efc14570a5f6a98958ef7f4da5089e42f604081d 100644 (file)
@@ -567,10 +567,10 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
 std::string LuaEntitySAO::getClientInitializationData()
 {
        std::ostringstream os(std::ios::binary);
-       writeU8(os, 0); // version
+       writeU8(os, 1); // version
        os<<serializeString(""); // name
-       writeS16(os, getId()); //id
        writeU8(os, 0); // is_player
+       writeS16(os, getId()); //id
        writeV3F1000(os, m_base_position);
        writeF1000(os, m_yaw);
        writeS16(os, m_hp);
@@ -965,7 +965,7 @@ bool PlayerSAO::unlimitedTransferDistance() const
 std::string PlayerSAO::getClientInitializationData()
 {
        std::ostringstream os(std::ios::binary);
-       writeU8(os, 0); // version
+       writeU8(os, 1); // version
        os<<serializeString(m_player->getName()); // name
        writeU8(os, 1); // is_player
        writeS16(os, getId()); //id