From 5146c826be9386cc2adeb8f678063a2f9cfc1dee Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 14 Jul 2011 16:17:50 +0200 Subject: * possibly improved water flow, by flyx86 - When flowing liquid starts to flow down, it stops contributing to its neighboring nodes' liquid level (possibly transforming it back to air) - Flowing liquid turns into a source if there are at least 2 adjacent liquid source nodes - If a new liquid flow reaches existing flowing liquid, the existing liquid is now updated properly. --- src/mapnode.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mapnode.h') diff --git a/src/mapnode.h b/src/mapnode.h index d975a50c4..d4ba0fed5 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -141,8 +141,10 @@ struct ContentFeatures NodeMetadata *initial_metadata; // If the content is liquid, this is the flowing version of the liquid. - // If content is liquid, this is the same content. + // If content is flowing liquid, this is the same content. u8 liquid_alternative_flowing; + // If the content is liquid, this is the source version of the liquid. + u8 liquid_alternative_source; // Amount of light the node emits u8 light_source; -- cgit v1.2.3 From f1e8ff22459bcd4fdbbe855a031d29744640ea99 Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Sat, 16 Jul 2011 16:01:37 +0200 Subject: * refactored liquid transformation code (has some flaws) Completely rewrote the liquid transformation. The algorithm now exclusively modifies the current node in one iteration. Another change is that MapNode.param2 now stores a bit that tells other nodes if a flowing liquid node flows downwards. This is accomplished by two masks on param2 for the "flow down" bit and the "liquid level" bits. This will be the base of future improvements to the liquid flow. However, in the current state flowing liquid does not always disappear when cut off its source. Be aware that this branch is work in progress. --- src/mapnode.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mapnode.h') diff --git a/src/mapnode.h b/src/mapnode.h index 8bbd4eb79..33128049a 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -404,10 +404,17 @@ enum LightBank LIGHTBANK_NIGHT }; +/* + Masks for MapNode.param2 of flowing liquids + */ +#define LIQUID_LEVEL_MASK 0x07 +#define LIQUID_FLOW_DOWN_MASK 0x08 + /* This is the stuff what the whole world consists of. */ + struct MapNode { /* -- cgit v1.2.3