Commented out debug statements again
[oweals/minetest.git] / src / content_sao.cpp
index aeeafc2f88d649cecd6e8825a22d007a36d11098..0bb518c165149678a8747acc1b6ff96f6140aa29 100644 (file)
@@ -215,6 +215,23 @@ InventoryItem * ItemSAO::createInventoryItem()
        }
 }
 
+void ItemSAO::rightClick(Player *player)
+{
+       dstream<<__FUNCTION_NAME<<std::endl;
+       InventoryItem *item = createInventoryItem();
+       if(item == NULL)
+               return;
+       
+       bool to_be_deleted = item->use(m_env, player);
+
+       if(to_be_deleted)
+               m_removed = true;
+       else
+               // Reflect changes to the item here
+               m_inventorystring = item->getItemString();
+       
+       delete item;
+}
 
 /*
        RatSAO
@@ -232,7 +249,7 @@ RatSAO::RatSAO(ServerEnvironment *env, u16 id, v3f pos):
 
        m_oldpos = v3f(0,0,0);
        m_last_sent_position = v3f(0,0,0);
-       m_yaw = 0;
+       m_yaw = myrand_range(0,PI*2);
        m_counter1 = 0;
        m_counter2 = 0;
        m_age = 0;
@@ -809,7 +826,7 @@ void FireflySAO::step(float dtime, bool send_recommended)
                Move it, with collision detection
        */
 
-       core::aabbox3d<f32> box(-BS/3.,0.0,-BS/3., BS/3.,BS*2./3.,BS/3.);
+       core::aabbox3d<f32> box(-BS/3.,-BS*2/3.0,-BS/3., BS/3.,BS*4./3.,BS/3.);
        collisionMoveResult moveresult;
        // Maximum movement without glitches
        f32 pos_max_d = BS*0.25;