Tweak IDropAction restriction handling in server.cpp
authorKahrl <kahrl@gmx.net>
Sun, 16 Jun 2013 15:01:21 +0000 (17:01 +0200)
committerKahrl <kahrl@gmx.net>
Sun, 16 Jun 2013 15:01:21 +0000 (17:01 +0200)
src/server.cpp

index 4268bb8098fe3009c5e8a58d81f24b8846249914..7963aeaaee1d7e6c55f5a2db8c5b7642e0f6c18b 100644 (file)
@@ -2401,6 +2401,18 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
 
                        setInventoryModified(da->from_inv);
 
+                       /*
+                               Disable dropping items out of craftpreview
+                       */
+                       if(da->from_list == "craftpreview")
+                       {
+                               infostream<<"Ignoring IDropAction from "
+                                               <<(da->from_inv.dump())<<":"<<da->from_list
+                                               <<" because src is "<<da->from_list<<std::endl;
+                               delete a;
+                               return;
+                       }
+
                        // Disallow dropping items if not allowed to interact
                        if(!checkPriv(player->getName(), "interact"))
                        {