diff options
Diffstat (limited to 'src/database')
-rw-r--r-- | src/database/database-files.cpp | 4 | ||||
-rw-r--r-- | src/database/database-postgresql.cpp | 8 | ||||
-rw-r--r-- | src/database/database-sqlite3.cpp | 12 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/database/database-files.cpp b/src/database/database-files.cpp index 64eca394e..09d76240e 100644 --- a/src/database/database-files.cpp +++ b/src/database/database-files.cpp @@ -41,8 +41,8 @@ void PlayerDatabaseFiles::serialize(std::ostringstream &os, RemotePlayer *player sanity_check(player->getPlayerSAO()); args.setS32("hp", player->getPlayerSAO()->getHP()); args.setV3F("position", player->getPlayerSAO()->getBasePosition()); - args.setFloat("pitch", player->getPlayerSAO()->getPitch()); - args.setFloat("yaw", player->getPlayerSAO()->getYaw()); + args.setFloat("pitch", player->getPlayerSAO()->getLookPitch()); + args.setFloat("yaw", player->getPlayerSAO()->getRotation().Y); args.setS32("breath", player->getPlayerSAO()->getBreath()); std::string extended_attrs; diff --git a/src/database/database-postgresql.cpp b/src/database/database-postgresql.cpp index 2d9c3b49e..eec838ef0 100644 --- a/src/database/database-postgresql.cpp +++ b/src/database/database-postgresql.cpp @@ -454,8 +454,8 @@ void PlayerDatabasePostgreSQL::savePlayer(RemotePlayer *player) verifyDatabase(); v3f pos = sao->getBasePosition(); - std::string pitch = ftos(sao->getPitch()); - std::string yaw = ftos(sao->getYaw()); + std::string pitch = ftos(sao->getLookPitch()); + std::string yaw = ftos(sao->getRotation().Y); std::string posx = ftos(pos.X); std::string posy = ftos(pos.Y); std::string posz = ftos(pos.Z); @@ -545,8 +545,8 @@ bool PlayerDatabasePostgreSQL::loadPlayer(RemotePlayer *player, PlayerSAO *sao) return false; } - sao->setPitch(pg_to_float(results, 0, 0)); - sao->setYaw(pg_to_float(results, 0, 1)); + sao->setLookPitch(pg_to_float(results, 0, 0)); + sao->setRotation(v3f(0, pg_to_float(results, 0, 1), 0)); sao->setBasePosition(v3f( pg_to_float(results, 0, 2), pg_to_float(results, 0, 3), diff --git a/src/database/database-sqlite3.cpp b/src/database/database-sqlite3.cpp index 97b0fd36a..aa156bbbd 100644 --- a/src/database/database-sqlite3.cpp +++ b/src/database/database-sqlite3.cpp @@ -456,8 +456,8 @@ void PlayerDatabaseSQLite3::savePlayer(RemotePlayer *player) if (!playerDataExists(player->getName())) { beginSave(); str_to_sqlite(m_stmt_player_add, 1, player->getName()); - double_to_sqlite(m_stmt_player_add, 2, sao->getPitch()); - double_to_sqlite(m_stmt_player_add, 3, sao->getYaw()); + double_to_sqlite(m_stmt_player_add, 2, sao->getLookPitch()); + double_to_sqlite(m_stmt_player_add, 3, sao->getRotation().Y); double_to_sqlite(m_stmt_player_add, 4, pos.X); double_to_sqlite(m_stmt_player_add, 5, pos.Y); double_to_sqlite(m_stmt_player_add, 6, pos.Z); @@ -468,8 +468,8 @@ void PlayerDatabaseSQLite3::savePlayer(RemotePlayer *player) sqlite3_reset(m_stmt_player_add); } else { beginSave(); - double_to_sqlite(m_stmt_player_update, 1, sao->getPitch()); - double_to_sqlite(m_stmt_player_update, 2, sao->getYaw()); + double_to_sqlite(m_stmt_player_update, 1, sao->getLookPitch()); + double_to_sqlite(m_stmt_player_update, 2, sao->getRotation().Y); double_to_sqlite(m_stmt_player_update, 3, pos.X); double_to_sqlite(m_stmt_player_update, 4, pos.Y); double_to_sqlite(m_stmt_player_update, 5, pos.Z); @@ -542,8 +542,8 @@ bool PlayerDatabaseSQLite3::loadPlayer(RemotePlayer *player, PlayerSAO *sao) sqlite3_reset(m_stmt_player_load); return false; } - sao->setPitch(sqlite_to_float(m_stmt_player_load, 0)); - sao->setYaw(sqlite_to_float(m_stmt_player_load, 1)); + sao->setLookPitch(sqlite_to_float(m_stmt_player_load, 0)); + sao->setPlayerYaw(sqlite_to_float(m_stmt_player_load, 1)); sao->setBasePosition(sqlite_to_v3f(m_stmt_player_load, 2)); sao->setHPRaw((s16) MYMIN(sqlite_to_int(m_stmt_player_load, 5), S16_MAX)); sao->setBreath((u16) MYMIN(sqlite_to_int(m_stmt_player_load, 6), U16_MAX), false); |