aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-27 05:14:46 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:55 +0200
commit8492796a5c45787810aad7fe08fc63cadc0c96b5 (patch)
tree1503b4f634c5d74392f5a03817e872f8b8dc8baf /src
parent218b62601698c5282487819ca7d0762c1c006103 (diff)
downloadminetest-8492796a5c45787810aad7fe08fc63cadc0c96b5.tar.gz
minetest-8492796a5c45787810aad7fe08fc63cadc0c96b5.tar.bz2
minetest-8492796a5c45787810aad7fe08fc63cadc0c96b5.zip
Allow server-side teleporting
Diffstat (limited to 'src')
-rw-r--r--src/servercommand.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/servercommand.cpp b/src/servercommand.cpp
index 3c6868e36..f415c86ce 100644
--- a/src/servercommand.cpp
+++ b/src/servercommand.cpp
@@ -222,7 +222,11 @@ void cmd_teleport(std::wostringstream &os,
<<PP(ctx->player->getPosition()/BS)<<" to "
<<PP(dest/BS)<<std::endl;
- ctx->player->setPosition(dest);
+ //ctx->player->setPosition(dest);
+
+ // Use the ServerActiveObject interface of ServerRemotePlayer
+ ServerRemotePlayer *srp = (ServerRemotePlayer*)ctx->player;
+ srp->setPos(dest);
ctx->server->SendMovePlayer(ctx->player);
os<< L"-!- Teleported.";