DANGER!!! The player suffocates inside all blocks, unless noclip is enabled

master
MoNTE48 2019-06-03 20:53:11 +02:00
parent 02e0ffb756
commit 8edbb66a05
6 changed files with 15 additions and 18 deletions

View File

@ -715,7 +715,7 @@ core.nodedef_default = {
liquid_alternative_flowing = "",
liquid_alternative_source = "",
liquid_viscosity = 0,
drowning = 0,
drowning = 4,
light_source = 0,
damage_per_second = 0,
selection_box = {type="regular"},

View File

@ -181,9 +181,8 @@ core.register_entity(":__builtin:item", {
return
end
-- If node is nil (unloaded area), or node is not registered, or node is
-- walkably solid and item is resting on nodebox
local nn = node.name
-- If node is not registered or node is walkably solid and resting on nodebox
local v = self.object:get_velocity()
if not core.registered_nodes[nn] or (core.registered_nodes[nn].walkable and
core.get_item_group(nn, "slippery") == 0) and v.y == 0 then
@ -223,7 +222,7 @@ core.register_entity(":__builtin:item", {
end
end
end
local node = minetest.get_node_or_nil(self.object:get_pos())
if not node then
return

View File

@ -45,14 +45,14 @@ core.register_on_joinplayer(function(player)
local player_name = player:get_player_name()
player_list[player_name] = player
if not minetest.is_singleplayer() then
core.chat_send_all("*** " .. player_name .. " joined the game.")
core.chat_send_all("=> " .. player_name .. " has joined the server")
end
end)
core.register_on_leaveplayer(function(player, timed_out)
local player_name = player:get_player_name()
player_list[player_name] = nil
local announcement = "*** " .. player_name .. " left the game."
local announcement = "<= " .. player_name .. " left the server"
if timed_out then
announcement = announcement .. " (timed out)"
end

View File

@ -351,6 +351,7 @@ core.register_node(":air", {
floodable = true,
air_equivalent = true,
drop = "",
drowning = 0,
groups = {not_in_creative_inventory=1},
})
@ -367,6 +368,7 @@ core.register_node(":ignore", {
buildable_to = true, -- A way to remove accidentally placed ignores
air_equivalent = true,
drop = "",
drowning = 0,
groups = {not_in_creative_inventory=1},
})

View File

@ -921,7 +921,8 @@ void PlayerSAO::step(float dtime, bool send_recommended)
MapNode n = m_env->getMap().getNodeNoEx(p);
const ContentFeatures &c = m_env->getGameDef()->ndef()->get(n);
// If node generates drown
if (c.drowning > 0 && m_hp > 0) {
bool noclip = m_privs.count("noclip") && g_settings->getBool("noclip");
if (c.drowning > 0 && m_hp > 0 &&!noclip) {
if (m_breath > 0)
setBreath(m_breath - 1);

View File

@ -965,7 +965,7 @@ static inline void create_formspec_menu(GUIFormSpecMenu **cur_formspec,
}
#define SIZE_TAG "size[11,5.5,true]"
#define SIZE_TAG "size[11,5.5]"
/******************************************************************************/
static void updateChat(Client &client, f32 dtime, bool show_debug,
@ -4741,7 +4741,7 @@ void Game::showPauseMenu()
#elif __IOS__
float ypos = 1.5;
#else
float ypos = simple_singleplayer_mode ? 0.7f : 0.1f;
float ypos = simple_singleplayer_mode ? 0.5f : 0.1f;
#endif
std::ostringstream os;
@ -4749,17 +4749,12 @@ void Game::showPauseMenu()
<< "bgcolor[#00000060;true]"
<< "button_exit[3.5," << (ypos++) << ";4,0.5;btn_continue;"
<< strgettext("Continue") << "]";
#if !defined(__ANDROID__) && !defined(__IOS__)
if (!simple_singleplayer_mode) {
#if !defined(__ANDROID__) && !defined(__IOS__)
os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_change_password;"
<< strgettext("Change Password") << "]";
#endif
} else {
os << "field[5.1,0;4,1.0;;" << strgettext("Pause") << ";]";
os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_change_password;"
<< strgettext("Change Password") << "]";
}
#if !defined(__ANDROID__) && !defined(__IOS__)
os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_sound;"
<< strgettext("Sound Volume") << "]";
os << "button_exit[3.5," << (ypos++) << ";4,0.5;btn_key_config;"