Remove collision boxes of dead players (#468)
This commit is contained in:
parent
0eb5b71648
commit
2d6b16de43
2 changed files with 19 additions and 0 deletions
17
mods/pvp/collisionbox/init.lua
Normal file
17
mods/pvp/collisionbox/init.lua
Normal 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)
|
2
mods/pvp/collisionbox/mod.conf
Normal file
2
mods/pvp/collisionbox/mod.conf
Normal 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.
|
Loading…
Reference in a new issue