Allow server-side teleporting

experimental
Perttu Ahola 2011-11-27 05:14:46 +02:00
parent 218b626016
commit 8492796a5c
1 changed files with 5 additions and 1 deletions

View File

@ -222,7 +222,11 @@ void cmd_teleport(std::wostringstream &os,
<<PP(ctx->player->getPosition()/BS)<<" to " <<PP(ctx->player->getPosition()/BS)<<" to "
<<PP(dest/BS)<<std::endl; <<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); ctx->server->SendMovePlayer(ctx->player);
os<< L"-!- Teleported."; os<< L"-!- Teleported.";