diff options
Diffstat (limited to 'src/database')
-rw-r--r-- | src/database/database-files.cpp | 15 | ||||
-rw-r--r-- | src/database/database-files.h | 4 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/database/database-files.cpp b/src/database/database-files.cpp index 529fb8763..d9e8f24ea 100644 --- a/src/database/database-files.cpp +++ b/src/database/database-files.cpp @@ -122,18 +122,17 @@ void PlayerDatabaseFiles::serialize(RemotePlayer *p, std::ostream &os) args.set("name", p->m_name); // This should not happen - assert(m_sao); - args.setU16("hp", p->m_sao->getHP()); - args.setV3F("position", p->m_sao->getBasePosition()); - args.setFloat("pitch", p->m_sao->getLookPitch()); - args.setFloat("yaw", p->m_sao->getRotation().Y); - args.setU16("breath", p->m_sao->getBreath()); + PlayerSAO *sao = p->getPlayerSAO(); + assert(sao); + args.setU16("hp", sao->getHP()); + args.setV3F("position", sao->getBasePosition()); + args.setFloat("pitch", sao->getLookPitch()); + args.setFloat("yaw", sao->getRotation().Y); + args.setU16("breath", sao->getBreath()); std::string extended_attrs; { // serializeExtraAttributes - PlayerSAO *sao = p->getPlayerSAO(); - assert(sao); Json::Value json_root; const StringMap &attrs = sao->getMeta().getStrings(); diff --git a/src/database/database-files.h b/src/database/database-files.h index a041cb1ff..e647a2e24 100644 --- a/src/database/database-files.h +++ b/src/database/database-files.h @@ -38,8 +38,8 @@ public: void listPlayers(std::vector<std::string> &res); private: - void deSerialize(RemotePlayer *p, std::istream &is, - const std::string &playername, PlayerSAO *sao); + void deSerialize(RemotePlayer *p, std::istream &is, const std::string &playername, + PlayerSAO *sao); /* serialize() writes a bunch of text that can contain any characters except a '\0', and such an ending that |