Prevent player from walking while sleeping
This commit is contained in:
parent
3121ab7c2d
commit
fd73c81d23
4 changed files with 10 additions and 6 deletions
|
@ -73,6 +73,7 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
|||
player:set_look_horizontal(math.random(1, 180) / 100)
|
||||
mcl_player.player_attached[name] = false
|
||||
player:set_physics_override(1, 1, 1)
|
||||
player:set_attribute("mcl_beds:sleeping", "false")
|
||||
hud_flags.wielditem = true
|
||||
mcl_player.player_set_animation(player, "stand" , 30)
|
||||
|
||||
|
@ -88,6 +89,8 @@ local function lay_down(player, pos, bed_pos, state, skip)
|
|||
player:set_look_horizontal(yaw)
|
||||
local dir = minetest.facedir_to_dir(param2)
|
||||
local p = {x = bed_pos.x + dir.x / 2, y = bed_pos.y, z = bed_pos.z + dir.z / 2}
|
||||
-- Set player attribute so other mods know they should not touch set_physics_override
|
||||
player:set_attribute("mcl_beds:sleeping", "true")
|
||||
player:set_physics_override(0, 0, 0)
|
||||
player:setpos(p)
|
||||
mcl_player.player_attached[name] = true
|
||||
|
|
|
@ -174,7 +174,7 @@ armor.set_player_armor = function(self, player)
|
|||
armor_groups.radiation = 100 - armor_radiation
|
||||
end
|
||||
player:set_armor_groups(armor_groups)
|
||||
player:set_physics_override(physics_o)
|
||||
-- Physics override intentionally removed because of possible conflicts
|
||||
self.textures[name].armor = armor_texture
|
||||
self.textures[name].preview = preview
|
||||
self.def[name].state = state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue