diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2020-04-10 19:49:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-10 19:49:20 +0200 |
commit | f648fb76aef96a1da608c64346fc65d4dd44caa8 (patch) | |
tree | 5f46a0d40742c7ae3e81f58728a702c8f3d6035e /src/server.cpp | |
parent | 2349d31bae1bfc4d58fd88efbc88261e69b11dad (diff) | |
download | minetest-f648fb76aef96a1da608c64346fc65d4dd44caa8.tar.gz minetest-f648fb76aef96a1da608c64346fc65d4dd44caa8.tar.bz2 minetest-f648fb76aef96a1da608c64346fc65d4dd44caa8.zip |
Drop genericobject.{cpp,h} (#9629)
* Drop genericobject.{cpp,h}
This file is not for generic object but for ActiveObject message passing.
Put ownership of the various commands to the right objects and cleanup the related code.
* Protect ServerActiveObject::m_messages_out
* typo fix
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/server.cpp b/src/server.cpp index 9eea45b31..062fe0798 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -35,7 +35,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "filesys.h" #include "mapblock.h" #include "serverobject.h" -#include "genericobject.h" #include "settings.h" #include "profiler.h" #include "log.h" @@ -721,7 +720,7 @@ void Server::AsyncRunStep(bool initial_step) // Go through every message for (const ActiveObjectMessage &aom : *list) { // Send position updates to players who do not see the attachment - if (aom.datastring[0] == GENERIC_CMD_UPDATE_POSITION) { + if (aom.datastring[0] == AO_CMD_UPDATE_POSITION) { if (sao->getId() == player->getId()) continue; @@ -1819,9 +1818,7 @@ void Server::SendPlayerHP(session_t peer_id) m_script->player_event(playersao,"health_changed"); // Send to other clients - std::string str = gob_cmd_punched(playersao->getHP()); - ActiveObjectMessage aom(playersao->getId(), true, str); - playersao->m_messages_out.push(aom); + playersao->sendPunchCommand(); } void Server::SendPlayerBreath(PlayerSAO *sao) |