|
@@ -153,7 +153,6 @@ end
|
|
|
|
|
|
function beds.skip_night()
|
|
|
minetest.set_timeofday(0.23)
|
|
|
- minetest.sound_play('beds_jazz', {gain = 1})
|
|
|
end
|
|
|
|
|
|
function beds.on_rightclick(pos, player)
|
|
@@ -181,6 +180,7 @@ function beds.on_rightclick(pos, player)
|
|
|
update_formspecs(false)
|
|
|
end
|
|
|
|
|
|
+ local player_in_bed = get_player_in_bed_count()
|
|
|
-- skip the night and let all players stand up
|
|
|
if check_in_beds() then
|
|
|
minetest.after(2, function()
|
|
@@ -188,6 +188,10 @@ function beds.on_rightclick(pos, player)
|
|
|
update_formspecs(is_night_skip_enabled())
|
|
|
end
|
|
|
if is_night_skip_enabled() then
|
|
|
+ local ges = #minetest.get_connected_players()
|
|
|
+ if ges == player_in_bed then
|
|
|
+ minetest.sound_play('beds_jazz', {gain = 1})
|
|
|
+ end
|
|
|
beds.skip_night()
|
|
|
beds.kick_players()
|
|
|
end
|