Cleanup: drop Server::hudGetHotbarSelectedImage()
authorLoic Blot <loic.blot@unix-experience.fr>
Thu, 8 Mar 2018 21:06:48 +0000 (22:06 +0100)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Thu, 8 Mar 2018 22:00:17 +0000 (23:00 +0100)
Call directly accessible RemotePlayer::getHotbarSelectedImage() from server api

src/script/lua_api/l_object.cpp
src/server.cpp
src/server.h

index 13b538f0ca0262ff0da1f9eaf6b94b5a66092beb..03bd84d5249e6885188f79cfcf780cfea6f7aedc 100644 (file)
@@ -1519,7 +1519,7 @@ int ObjectRef::l_hud_get_hotbar_selected_image(lua_State *L)
        if (player == NULL)
                return 0;
 
-       const std::string &name = getServer(L)->hudGetHotbarSelectedImage(player);
+       const std::string &name = player->getHotbarSelectedImage();
        lua_pushlstring(L, name.c_str(), name.size());
        return 1;
 }
index fbd656f37ea3127f6e6ddeb2d5648cbc7768d3bb..75547c60bc26bb857a58d8654464f616202de672 100644 (file)
@@ -3108,11 +3108,6 @@ void Server::hudSetHotbarSelectedImage(RemotePlayer *player, std::string name)
        SendHUDSetParam(player->getPeerId(), HUD_PARAM_HOTBAR_SELECTED_IMAGE, name);
 }
 
-const std::string& Server::hudGetHotbarSelectedImage(RemotePlayer *player) const
-{
-       return player->getHotbarSelectedImage();
-}
-
 Address Server::getPeerAddress(session_t peer_id)
 {
        return m_con->GetPeerAddress(peer_id);
index 7b3fe61e2c1277f0b966f96a8140a53255be2983..3b9b72021c603744cd9179d65a8ef623047bbd69 100644 (file)
@@ -292,7 +292,6 @@ public:
        bool hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount);
        void hudSetHotbarImage(RemotePlayer *player, std::string name);
        void hudSetHotbarSelectedImage(RemotePlayer *player, std::string name);
-       const std::string &hudGetHotbarSelectedImage(RemotePlayer *player) const;
 
        Address getPeerAddress(session_t peer_id);