projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
218b626
)
Allow server-side teleporting
author
Perttu Ahola
<celeron55@gmail.com>
Sun, 27 Nov 2011 03:14:46 +0000
(
05:14
+0200)
committer
Perttu Ahola
<celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:55 +0000
(19:13 +0200)
src/servercommand.cpp
patch
|
blob
|
history
diff --git
a/src/servercommand.cpp
b/src/servercommand.cpp
index 3c6868e36d8392818e09999b477ced1b15676fc5..f415c86ce34b459401cb911465a5646a6cafcb71 100644
(file)
--- 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.";