Allow server-side teleporting
authorPerttu Ahola <celeron55@gmail.com>
Sun, 27 Nov 2011 03:14:46 +0000 (05:14 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:55 +0000 (19:13 +0200)
src/servercommand.cpp

index 3c6868e36d8392818e09999b477ced1b15676fc5..f415c86ce34b459401cb911465a5646a6cafcb71 100644 (file)
@@ -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.";