if creative mode and player has no build privileges, cannot drop items.
authorPerttu Ahola <celeron55@gmail.com>
Mon, 22 Aug 2011 19:55:17 +0000 (22:55 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Mon, 22 Aug 2011 19:55:17 +0000 (22:55 +0300)
src/server.cpp

index 97eaa3a3ea48f12c4f876e917b8014fda07f7869..a8eb68c55a95cc5d1fb9d1dd4f1424404d9cc32c 100644 (file)
@@ -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;