aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-08-22 22:55:17 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-08-22 22:55:17 +0300
commitd4df20a913c6663a4f42294e06e8c482fc947259 (patch)
treeefda0fa401100670c85649c53692b641c208c4d8
parentdb495668aeed333c881d8c2ef62b72b3cd1bf1ce (diff)
downloadminetest-d4df20a913c6663a4f42294e06e8c482fc947259.tar.gz
minetest-d4df20a913c6663a4f42294e06e8c482fc947259.tar.bz2
minetest-d4df20a913c6663a4f42294e06e8c482fc947259.zip
if creative mode and player has no build privileges, cannot drop items.
-rw-r--r--src/server.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 97eaa3a3e..a8eb68c55 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -2923,6 +2923,18 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
return;
}
+ /*
+ If in creative mode, item dropping is disabled unless
+ player has build privileges
+ */
+ if(g_settings.getBool("creative_mode") &&
+ (getPlayerPrivs(player) & PRIV_BUILD) == 0)
+ {
+ derr_server<<"Not allowing player to drop item: "
+ "creative mode and no build privs"<<std::endl;
+ return;
+ }
+
dout_server<<"Placing a miscellaneous item on map"
<<std::endl;