Fix some bed bugs
This commit is contained in:
parent
7ebae54cb9
commit
3b6904d9ad
@ -159,9 +159,11 @@ local function on_joinplayer(player)
|
|||||||
if bed.userdata[name].in_bed then
|
if bed.userdata[name].in_bed then
|
||||||
minetest.after(
|
minetest.after(
|
||||||
0.1,
|
0.1,
|
||||||
function()
|
function(player)
|
||||||
put_player_in_bed(player)
|
if player and player:is_player() then
|
||||||
end)
|
put_player_in_bed(player)
|
||||||
|
end
|
||||||
|
end, player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -222,12 +224,12 @@ local function on_globalstep(dtime)
|
|||||||
minetest.chat_send_all(
|
minetest.chat_send_all(
|
||||||
minetest.colorize(
|
minetest.colorize(
|
||||||
"#0ff",
|
"#0ff",
|
||||||
"*** " .. sleeping_players .. " of " .. player_count
|
"*** " .. S("Players have slept, rise and shine!")))
|
||||||
.. " players slept, rise and shine!"))
|
|
||||||
|
|
||||||
minetest.set_timeofday(0.23)
|
minetest.set_timeofday(0.23)
|
||||||
delay_daytime = false
|
delay_daytime = false
|
||||||
|
|
||||||
|
local players = minetest.get_connected_players()
|
||||||
for _, player in ipairs(players) do
|
for _, player in ipairs(players) do
|
||||||
if bed.userdata[player:get_player_name()].in_bed then
|
if bed.userdata[player:get_player_name()].in_bed then
|
||||||
bed.userdata[player:get_player_name()].slept = true
|
bed.userdata[player:get_player_name()].slept = true
|
||||||
@ -241,7 +243,7 @@ local function on_globalstep(dtime)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.after(0, on_load)
|
minetest.register_on_mods_loaded(on_load)
|
||||||
|
|
||||||
minetest.register_on_shutdown(on_shutdown)
|
minetest.register_on_shutdown(on_shutdown)
|
||||||
|
|
||||||
@ -382,8 +384,8 @@ crafting.register_craft(
|
|||||||
player_effects.register_effect(
|
player_effects.register_effect(
|
||||||
"inbed",
|
"inbed",
|
||||||
{
|
{
|
||||||
title = "In bed",
|
title = S("In bed"),
|
||||||
description = "If you're in a bed",
|
description = S("You're in a bed"),
|
||||||
duration = -1,
|
duration = -1,
|
||||||
physics = {
|
physics = {
|
||||||
speed = 0,
|
speed = 0,
|
||||||
|
@ -2,3 +2,6 @@
|
|||||||
Bed=Bett
|
Bed=Bett
|
||||||
Bed Time=Schlafenszeit
|
Bed Time=Schlafenszeit
|
||||||
Craft a bed=Fertigen Sie ein Bett
|
Craft a bed=Fertigen Sie ein Bett
|
||||||
|
Players have slept, rise and shine!=Spieler haben geschlafen, Raus aus den Federn!
|
||||||
|
In bed=Im Bett
|
||||||
|
You're in a bed=Sie sind in einem Bett
|
||||||
|
@ -2,3 +2,6 @@
|
|||||||
Bed=
|
Bed=
|
||||||
Bed Time=
|
Bed Time=
|
||||||
Craft a bed=
|
Craft a bed=
|
||||||
|
Players have slept, rise and shine!=
|
||||||
|
In bed=
|
||||||
|
You're in a bed=
|
||||||
|
Loading…
Reference in New Issue
Block a user