diff options
author | sfan5 <sfan5@live.de> | 2019-07-16 14:00:42 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2019-08-10 19:44:27 +0200 |
commit | cf64054390970f3cf974afb2b174340a3e1da382 (patch) | |
tree | 9f3a62d3f935ae76f00fb1c0002f9ba59e59f219 /src/server.cpp | |
parent | b19400aa74f30ef61ba0c1bb4a25a978e7cf4125 (diff) | |
download | minetest-cf64054390970f3cf974afb2b174340a3e1da382.tar.gz minetest-cf64054390970f3cf974afb2b174340a3e1da382.tar.bz2 minetest-cf64054390970f3cf974afb2b174340a3e1da382.zip |
Implement adding velocity to player from Lua
The intended usecase is knockback, but there's potential for more.
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp index 27388e666..5dd3d0061 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1958,6 +1958,13 @@ void Server::SendCSMRestrictionFlags(session_t peer_id) Send(&pkt); } +void Server::SendPlayerSpeed(session_t peer_id, const v3f &added_vel) +{ + NetworkPacket pkt(TOCLIENT_PLAYER_SPEED, 0, peer_id); + pkt << added_vel; + Send(&pkt); +} + s32 Server::playSound(const SimpleSoundSpec &spec, const ServerSoundParams ¶ms) { |