File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -180,14 +180,14 @@ minetest.register_on_dieplayer(function(player)
180
180
local pos = vector .round (player :getpos ())
181
181
local player_name = player :get_player_name ()
182
182
183
- -- check if it's possible to place bones, if not go 1 higher
183
+ -- check if it's possible to place bones, if not find space near player
184
184
if bones_mode == " bones" and not may_replace (pos , player ) then
185
- pos . y = pos . y + 1
186
- end
187
-
188
- -- still cannot place bones? change mode to 'drop'
189
- if bones_mode == " bones " and not may_replace ( pos , player ) then
190
- bones_mode = " drop "
185
+ local air = minetest . find_node_near ( pos , 1 , { " air " })
186
+ if air and not minetest . is_protected ( air , player_name ) then
187
+ pos = air
188
+ else
189
+ bones_mode = " drop "
190
+ end
191
191
end
192
192
193
193
if bones_mode == " drop" then
You can’t perform that action at this time.
0 commit comments