From: Perttu Ahola Date: Sun, 27 Nov 2011 03:14:46 +0000 (+0200) Subject: Allow server-side teleporting X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=8492796a5c45787810aad7fe08fc63cadc0c96b5;p=zefram%2Fminetest%2Fminetest_engine.git Allow server-side teleporting --- diff --git a/src/servercommand.cpp b/src/servercommand.cpp index 3c6868e3..f415c86c 100644 --- a/src/servercommand.cpp +++ b/src/servercommand.cpp @@ -222,7 +222,11 @@ void cmd_teleport(std::wostringstream &os, <player->getPosition()/BS)<<" to " <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.";