Skip to content

Commit c7656ed

Browse files
committedMar 8, 2018
Cleanup: drop Server::hudGetHotbarSelectedImage()
Call directly accessible RemotePlayer::getHotbarSelectedImage() from server api
1 parent 4be46ae commit c7656ed

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed
 

‎src/script/lua_api/l_object.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ int ObjectRef::l_hud_get_hotbar_selected_image(lua_State *L)
15191519
if (player == NULL)
15201520
return 0;
15211521

1522-
const std::string &name = getServer(L)->hudGetHotbarSelectedImage(player);
1522+
const std::string &name = player->getHotbarSelectedImage();
15231523
lua_pushlstring(L, name.c_str(), name.size());
15241524
return 1;
15251525
}

‎src/server.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -3108,11 +3108,6 @@ void Server::hudSetHotbarSelectedImage(RemotePlayer *player, std::string name)
31083108
SendHUDSetParam(player->getPeerId(), HUD_PARAM_HOTBAR_SELECTED_IMAGE, name);
31093109
}
31103110

3111-
const std::string& Server::hudGetHotbarSelectedImage(RemotePlayer *player) const
3112-
{
3113-
return player->getHotbarSelectedImage();
3114-
}
3115-
31163111
Address Server::getPeerAddress(session_t peer_id)
31173112
{
31183113
return m_con->GetPeerAddress(peer_id);

‎src/server.h

-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ class Server : public con::PeerHandler, public MapEventReceiver,
292292
bool hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount);
293293
void hudSetHotbarImage(RemotePlayer *player, std::string name);
294294
void hudSetHotbarSelectedImage(RemotePlayer *player, std::string name);
295-
const std::string &hudGetHotbarSelectedImage(RemotePlayer *player) const;
296295

297296
Address getPeerAddress(session_t peer_id);
298297

0 commit comments

Comments
 (0)
Please sign in to comment.