summaryrefslogtreecommitdiff
path: root/src/environment.h
diff options
context:
space:
mode:
authorNer'zhul <nerzhul@users.noreply.github.com>2016-10-30 14:53:26 +0100
committerGitHub <noreply@github.com>2016-10-30 14:53:26 +0100
commit9d25242c5c1411d692254cf910345d51c9a24fa3 (patch)
treeedec8475b32562379d463757e77031bdc994e971 /src/environment.h
parentd43326021a9a7def27773ed1f7ec01992ed3abf6 (diff)
downloadminetest-9d25242c5c1411d692254cf910345d51c9a24fa3.tar.gz
minetest-9d25242c5c1411d692254cf910345d51c9a24fa3.tar.bz2
minetest-9d25242c5c1411d692254cf910345d51c9a24fa3.zip
PlayerSAO/LocalPlayer refactor: (#4612)
* Create UnitSAO, a common part between PlayerSAO & LuaEntitySAO * Move breath to PlayerSAO & LocalPlayer * Migrate m_yaw from (Remote)Player & LuaEntitySAO to UnitSAO * Migrate m_yaw from Player to LocalPlayer for client * Move some functions outside of player class to PlayerSAO/RemotePlayer or LocalPlayer depending on which class needs it * Move pitch to LocalPlayer & PlayerSAO * Move m_position from Player to LocalPlayer * Move camera_barely_in_ceiling to LocalPlayer as it's used only there * use PlayerSAO::m_base_position for Server side positions * remove a unused variable * ServerActiveObject::setPos now uses const ref * use ServerEnv::loadPlayer unconditionnaly as it creates RemotePlayer only if it's not already loaded * Move hp from Player to LocalPlayer * Move m_hp from LuaEntitySAO to UnitSAO * Use m_hp from PlayerSAO/UnitSAO instead of RemotePlayer
Diffstat (limited to 'src/environment.h')
-rw-r--r--src/environment.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/environment.h b/src/environment.h
index 3f3c1cf2c..4bee40e57 100644
--- a/src/environment.h
+++ b/src/environment.h
@@ -54,6 +54,7 @@ class ClientMap;
class GameScripting;
class Player;
class RemotePlayer;
+class PlayerSAO;
class Environment
{
@@ -315,7 +316,7 @@ public:
// Save players
void saveLoadedPlayers();
void savePlayer(RemotePlayer *player);
- RemotePlayer *loadPlayer(const std::string &playername);
+ RemotePlayer *loadPlayer(const std::string &playername, PlayerSAO *sao);
void addPlayer(RemotePlayer *player);
void removePlayer(RemotePlayer *player);
@@ -362,7 +363,7 @@ public:
Find out what new objects have been added to
inside a radius around a position
*/
- void getAddedActiveObjects(RemotePlayer *player, s16 radius,
+ void getAddedActiveObjects(PlayerSAO *playersao, s16 radius,
s16 player_radius,
std::set<u16> &current_objects,
std::queue<u16> &added_objects);
@@ -371,7 +372,7 @@ public:
Find out what new objects have been removed from
inside a radius around a position
*/
- void getRemovedActiveObjects(RemotePlayer *player, s16 radius,
+ void getRemovedActiveObjects(PlayerSAO *playersao, s16 radius,
s16 player_radius,
std::set<u16> &current_objects,
std::queue<u16> &removed_objects);