aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Krause <flyx@isobeef.org>2011-07-17 13:15:33 +0200
committerNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2011-07-18 02:38:48 +0200
commita1e2a8bec6a7815987f2f8d841842a5eb207585d (patch)
treedda0765549350bc616b0029720457d591fa97fd9 /src
parentf34a9b6a71f44e590b57d69cccb5e246acc597ca (diff)
downloadminetest-a1e2a8bec6a7815987f2f8d841842a5eb207585d.tar.gz
minetest-a1e2a8bec6a7815987f2f8d841842a5eb207585d.tar.bz2
minetest-a1e2a8bec6a7815987f2f8d841842a5eb207585d.zip
fixes to liquid transformation
Diffstat (limited to 'src')
-rw-r--r--src/map.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 19ed32317..1596f12ef 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1651,7 +1651,7 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
case LIQUID_FLOWING:
// if this node is not (yet) of a liquid type, choose the first liquid type we encounter
// (while ignoring flowing liquids at the lowest level, which cannot flow into this node)
- if (liquid_kind == CONTENT_AIR && ((nb.n.param2 & LIQUID_LEVEL_MASK) > 0))
+ if (liquid_kind == CONTENT_AIR)
liquid_kind = content_features(nb.n.d).liquid_alternative_flowing;
if (content_features(nb.n.d).liquid_alternative_flowing != liquid_kind) {
neutrals[num_neutrals++] = nb;
@@ -1746,7 +1746,7 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
n0.d = new_node_content;
if (content_features(n0.d).liquid_type == LIQUID_FLOWING) {
// set level to last 3 bits, flowing down bit to 4th bit
- n0.param2 = (flowing_down ? LIQUID_FLOW_DOWN_MASK : 0x00) | (new_node_level & LIQUID_LEVEL_MASK);
+ n0.param2 = (flowing_down ? LIQUID_FLOW_DOWN_MASK : 0x00) | (new_node_level & LIQUID_LEVEL_MASK);
} else {
n0.param2 = 0;
}
@@ -1776,10 +1776,10 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
break;
case LIQUID_FLOWING:
for (u16 i = 0; i < num_flows; i++) {
- u8 flow_level = (flows[i].n.param2 & LIQUID_LEVEL_MASK);
+ /*u8 flow_level = (flows[i].n.param2 & LIQUID_LEVEL_MASK);
// liquid_level is still the ORIGINAL level of this node.
if (flows[i].t != NEIGHBOR_UPPER && ((flow_level < liquid_level || flow_level < new_node_level) ||
- flow_down_enabled))
+ flow_down_enabled))*/
m_transforming_liquid.push_back(flows[i].p);
}
for (u16 i = 0; i < num_airs; i++) {
@@ -1791,7 +1791,7 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
loopcount++;
//if(loopcount >= 100000)
- if(loopcount >= initial_size * 1) {
+ if(loopcount >= initial_size * 10) {
break;
}
}
l kwa">false; } GUIFileSelectMenu::~GUIFileSelectMenu() { removeChildren(); } void GUIFileSelectMenu::removeChildren() { const core::list<gui::IGUIElement*> &children = getChildren(); core::list<gui::IGUIElement*> children_copy; for (core::list<gui::IGUIElement*>::ConstIterator i = children.begin(); i != children.end(); i++) { children_copy.push_back(*i); } for (core::list<gui::IGUIElement*>::Iterator i = children_copy.begin(); i != children_copy.end(); i++) { (*i)->remove(); } } void GUIFileSelectMenu::regenerateGui(v2u32 screensize) { removeChildren(); m_fileOpenDialog = 0; core::dimension2du size(600,400); core::rect < s32 > rect(0,0,screensize.X,screensize.Y); DesiredRect = rect; recalculateAbsolutePosition(false); m_fileOpenDialog = Environment->addFileOpenDialog(m_title.c_str(),false,this,-1); core::position2di pos = core::position2di(screensize.X/2 - size.Width/2,screensize.Y/2 -size.Height/2); m_fileOpenDialog->setRelativePosition(pos); m_fileOpenDialog->setMinSize(size); } void GUIFileSelectMenu::drawMenu() { gui::IGUISkin* skin = Environment->getSkin(); if (!skin) return; gui::IGUIElement::draw(); } void GUIFileSelectMenu::acceptInput() { if ((m_text_dst != 0) && (this->m_formname != "")){ std::map<std::string, std::string> fields; if (m_accepted) fields[m_formname + "_accepted"] = wide_to_narrow(m_fileOpenDialog->getFileName()); else fields[m_formname + "_canceled"] = m_formname; this->m_text_dst->gotText(fields); } } bool GUIFileSelectMenu::OnEvent(const SEvent& event) { if (event.EventType == irr::EET_GUI_EVENT) { switch (event.GUIEvent.EventType) { case gui::EGET_ELEMENT_CLOSED: case gui::EGET_FILE_CHOOSE_DIALOG_CANCELLED: m_accepted=false; acceptInput(); quitMenu(); return true; break; case gui::EGET_DIRECTORY_SELECTED: case gui::EGET_FILE_SELECTED: m_accepted=true; acceptInput(); quitMenu(); return true; break; default: //ignore this event break; } } return Parent ? Parent->OnEvent(event) : false; }