diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2018-03-08 22:03:45 +0100 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2018-03-08 23:00:17 +0100 |
commit | 373f1bfb4ab5e48a9538e5ee561eb41174725c1c (patch) | |
tree | 1775b54fcf0ecd800f03ef842c11a05de27a1bc8 /src | |
parent | f35236afea5c23c9aa3a038aac8562c509ad39c2 (diff) | |
download | minetest-373f1bfb4ab5e48a9538e5ee561eb41174725c1c.tar.gz minetest-373f1bfb4ab5e48a9538e5ee561eb41174725c1c.tar.bz2 minetest-373f1bfb4ab5e48a9538e5ee561eb41174725c1c.zip |
Cleanup: drop Server::hudGetHotbarItemcount()
Call directly accessible RemotePlayer::getHotbarItemcount() from server api
Diffstat (limited to 'src')
-rw-r--r-- | src/script/lua_api/l_object.cpp | 4 | ||||
-rw-r--r-- | src/server.cpp | 7 | ||||
-rw-r--r-- | src/server.h | 1 |
3 files changed, 2 insertions, 10 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index 3afd21ec3..ce2bce85e 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -1462,9 +1462,7 @@ int ObjectRef::l_hud_get_hotbar_itemcount(lua_State *L) if (player == NULL) return 0; - s32 hotbar_itemcount = getServer(L)->hudGetHotbarItemcount(player); - - lua_pushnumber(L, hotbar_itemcount); + lua_pushnumber(L, player->getHotbarItemcount()); return 1; } diff --git a/src/server.cpp b/src/server.cpp index 24fbb38c8..aa0961f9a 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -317,7 +317,7 @@ Server::~Server() { MutexAutoLock envlock(m_env_mutex); - + infostream << "Server: Saving players" << std::endl; m_env->saveLoadedPlayers(); @@ -3090,11 +3090,6 @@ bool Server::hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount) return true; } -s32 Server::hudGetHotbarItemcount(RemotePlayer *player) const -{ - return player->getHotbarItemcount(); -} - void Server::hudSetHotbarImage(RemotePlayer *player, std::string name) { if (!player) diff --git a/src/server.h b/src/server.h index 13c21067c..c189860a5 100644 --- a/src/server.h +++ b/src/server.h @@ -290,7 +290,6 @@ public: bool hudChange(RemotePlayer *player, u32 id, HudElementStat stat, void *value); bool hudSetFlags(RemotePlayer *player, u32 flags, u32 mask); bool hudSetHotbarItemcount(RemotePlayer *player, s32 hotbar_itemcount); - s32 hudGetHotbarItemcount(RemotePlayer *player) const; void hudSetHotbarImage(RemotePlayer *player, std::string name); std::string hudGetHotbarImage(RemotePlayer *player); void hudSetHotbarSelectedImage(RemotePlayer *player, std::string name); |