summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-12 15:41:29 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:40 +0200
commit0b97ad838466ed44296a2c663b2dc034feb51f67 (patch)
tree85244222b72015bf9e68dd8f58f6e00a744d3e0b /src/player.h
parentddaff2d653efb1bebe04b9d316fe1bde26671b82 (diff)
downloadminetest-0b97ad838466ed44296a2c663b2dc034feb51f67.tar.gz
minetest-0b97ad838466ed44296a2c663b2dc034feb51f67.tar.bz2
minetest-0b97ad838466ed44296a2c663b2dc034feb51f67.zip
ServerRemotePlayer implements ServerActiveObject
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/player.h b/src/player.h
index a352c1bd9..c3be07894 100644
--- a/src/player.h
+++ b/src/player.h
@@ -179,11 +179,23 @@ public:
Player on the server
*/
-class ServerRemotePlayer : public Player
+#include "serverobject.h"
+#include "content_object.h" // Object type IDs
+
+class ServerRemotePlayer : public Player, public ServerActiveObject
{
public:
- ServerRemotePlayer()
+ ServerRemotePlayer():
+ ServerActiveObject(NULL, v3f(0,0,0))
+ {
+ }
+ ServerRemotePlayer(ServerEnvironment *env, v3f pos_, u16 peer_id_,
+ const char *name_):
+ ServerActiveObject(env, pos_)
{
+ setPosition(pos_);
+ peer_id = peer_id_;
+ updateName(name_);
}
virtual ~ServerRemotePlayer()
{
@@ -198,6 +210,17 @@ public:
{
}
+ virtual void setPosition(const v3f &position)
+ {
+ Player::setPosition(position);
+ ServerActiveObject::setBasePosition(position);
+ }
+
+ /*
+ ServerActiveObject interface
+ */
+ u8 getType() const
+ {return ACTIVEOBJECT_TYPE_PLAYER;}
private:
};