aboutsummaryrefslogtreecommitdiff
path: root/src/database/database-postgresql.cpp
diff options
context:
space:
mode:
authorCoderForTheBetter <marcumjp@gmail.com>2018-11-28 03:38:50 -0500
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-11-28 09:38:50 +0100
commitfaa358e797128ab07bb5644ce305a832d59e5596 (patch)
treedcf05ef0611b839503c4845fd89ad9519ee1c4bb /src/database/database-postgresql.cpp
parent9519d57017cfa28eb4f2fbf3c780f826017bbb00 (diff)
downloaddragonfireclient-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-postgresql.cpp')
-rw-r--r--src/database/database-postgresql.cpp8
1 files changed, 4 insertions, 4 deletions
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),