1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix and improve Server's privilege get/setters

This commit is contained in:
Perttu Ahola 2012-03-15 15:27:16 +02:00
parent 6298878bfa
commit 5957fed9a7
3 changed files with 40 additions and 37 deletions

View file

@ -3551,10 +3551,7 @@ static int l_get_player_privs(lua_State *L)
// Do it
lua_newtable(L);
int table = lua_gettop(L);
u64 privs_i = server->getPlayerAuthPrivs(name);
// Special case for the "name" setting (local player / server owner)
if(name == g_settings->get("name"))
privs_i = PRIV_ALL;
u64 privs_i = server->getPlayerEffectivePrivs(name);
std::set<std::string> privs_s = privsToSet(privs_i);
for(std::set<std::string>::const_iterator
i = privs_s.begin(); i != privs_s.end(); i++){