diff options
author | Ciaran Gultnieks <ciaran@ciarang.com> | 2011-05-16 11:32:49 +0100 |
---|---|---|
committer | Ciaran Gultnieks <ciaran@ciarang.com> | 2011-05-16 11:32:49 +0100 |
commit | 50c48219a7ee6fe11566779f03e5e80361155b3f (patch) | |
tree | 8c94965d7e78a616154836920ba492d683342f72 | |
parent | 248d7c8469f8cb37406ea0ce56d0945e38334cfb (diff) | |
download | minetest-50c48219a7ee6fe11566779f03e5e80361155b3f.tar.gz minetest-50c48219a7ee6fe11566779f03e5e80361155b3f.tar.bz2 minetest-50c48219a7ee6fe11566779f03e5e80361155b3f.zip |
Allow "all" to be specified in player config file for privileges
-rw-r--r-- | src/player.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/player.cpp b/src/player.cpp index a6ddeee64..2ebf158a6 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -144,7 +144,16 @@ void Player::deSerialize(std::istream &is) hp = 20; } try{ - privs = args.getU64("privs"); + std::string sprivs = args.get("privs"); + if(sprivs == "all") + { + privs = PRIV_ALL; + } + else + { + std::istringstream ss(sprivs); + ss>>privs; + } }catch(SettingNotFoundException &e){ privs = PRIV_DEFAULT; } |