Remove collision boxes of dead players (#468)

This commit is contained in:
MinetestSam 2019-10-09 19:19:03 +05:30 committed by ANAND
parent 0eb5b71648
commit 2d6b16de43
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,17 @@
local collision_box = {}
minetest.register_on_dieplayer(function(player)
local name = player:get_player_name()
if not collision_box[name] then
collision_box[name] = player:get_properties().collisionbox
end
player:set_properties({collisionbox = {0,0,0, 0,0,0}})
end)
minetest.register_on_respawnplayer(function(player)
player:set_properties({collisionbox = collision_box[player:get_player_name()]})
end)
minetest.register_on_leaveplayer(function(player)
collision_box[player:get_player_name()] = nil
end)

View file

@ -0,0 +1,2 @@
name = collisionbox
description = Changes the collision box of player on death to allow no obstructions when looting or fighting another player.