diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-11-12 15:41:29 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-11-29 19:13:40 +0200 |
commit | 0b97ad838466ed44296a2c663b2dc034feb51f67 (patch) | |
tree | 85244222b72015bf9e68dd8f58f6e00a744d3e0b /src/player.h | |
parent | ddaff2d653efb1bebe04b9d316fe1bde26671b82 (diff) | |
download | minetest-0b97ad838466ed44296a2c663b2dc034feb51f67.tar.gz minetest-0b97ad838466ed44296a2c663b2dc034feb51f67.tar.bz2 minetest-0b97ad838466ed44296a2c663b2dc034feb51f67.zip |
ServerRemotePlayer implements ServerActiveObject
Diffstat (limited to 'src/player.h')
-rw-r--r-- | src/player.h | 27 |
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: }; |