From 8492796a5c45787810aad7fe08fc63cadc0c96b5 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 27 Nov 2011 05:14:46 +0200 Subject: [PATCH] Allow server-side teleporting --- src/servercommand.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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."; -- 2.30.2