From 623a11e24ab7ad8bec533869e277c84d63fd4194 Mon Sep 17 00:00:00 2001 From: darkrose Date: Wed, 23 Aug 2017 14:51:41 +1000 Subject: [PATCH] less likely to destroy dropped stuff --- src/environment.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/environment.cpp b/src/environment.cpp index cc5896b..5cee451 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -900,15 +900,19 @@ bool ServerEnvironment::dropToParcel(v3s16 pos, InventoryItem *item) // if underground, go up to first air_equivalent and buildable_to if (!content_features(m_map->getNodeNoEx(pos).getContent()).air_equivalent) { if (!getCollidedPosition(pos,v3s16(0,1,0),&ppos)) { - delete item; - return false; + if (!searchNear(pos,v3s16(2,0,2),CONTENT_AIR,&ppos)) { + delete item; + return false; + } } pos = ppos; // otherwise go down to first non-air_equivalent and buildable_to }else{ if (!getCollidedPosition(pos,v3s16(0,-1,0),&ppos)) { - delete item; - return false; + if (!searchNear(pos,v3s16(2,0,2),CONTENT_AIR,&ppos)) { + delete item; + return false; + } } pos = ppos; }