diff options
author | CoderForTheBetter <marcumjp@gmail.com> | 2018-11-28 03:38:50 -0500 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2018-11-28 09:38:50 +0100 |
commit | faa358e797128ab07bb5644ce305a832d59e5596 (patch) | |
tree | dcf05ef0611b839503c4845fd89ad9519ee1c4bb /src/database/database-sqlite3.cpp | |
parent | 9519d57017cfa28eb4f2fbf3c780f826017bbb00 (diff) | |
download | dragonfireclient-faa358e797128ab07bb5644ce305a832d59e5596.tar.xz |
Add Lua methods 'set_rotation()' and 'get_rotation()' (#7395)
* Adds Lua methods 'set_rotation()' and 'get_rotation'. Also changed some method names to be more clear. Instead of an f32 being sent over network for yaw, now a v3f is sent for rotation on xyz axes. Perserved Lua method set_yaw/setyaw so that old mods still work, other wise to set yaw they would need to switch to set_rotation(0, yaw, 0).
Diffstat (limited to 'src/database/database-sqlite3.cpp')
-rw-r--r-- | src/database/database-sqlite3.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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); |