Skip to content
Permalink
Browse files

Cleanup: drop Server::hudGetHotbarSelectedImage()

Call directly accessible RemotePlayer::getHotbarSelectedImage() from server api
  • Loading branch information
nerzhul committed Mar 8, 2018
1 parent 4be46ae commit c7656edaa57a951f2496d454a42cdf899459b572
Showing with 1 addition and 7 deletions.
  1. +1 −1 src/script/lua_api/l_object.cpp
  2. +0 −5 src/server.cpp
  3. +0 −1 src/server.h
@@ -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;
}
@@ -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);
@@ -292,7 +292,6 @@ class Server : public con::PeerHandler, public MapEventReceiver,
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);

0 comments on commit c7656ed

Please sign in to comment.
You can’t perform that action at this time.