New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix incorrect formspec-tooltip doc, add detail in 'floodable' & 'on_flood' docs #5660
Conversation
Are there any further trivial errors in the Lua API that should be fixed? It's nonsense to have a pull for each line, just merge them all together into one, as long it doesn't get too large. |
@SmallJoker none that I have noticed so far. I'll remember to collect several at once, next time. |
👍 |
I've added another commit re: floodable property for nodes. |
@paramat can you check second commit too ? |
doc/lua_api.txt
Outdated
floodable = false, -- If true, liquids flow into and replace this node | ||
floodable = false, --[[ | ||
^ If true, liquids flow into and replace this node. However, liquids | ||
^ cannot themselves be floodable. ]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Liquids can be made floodable, it's just a very bad idea. So this needs to be clearer.
If true, liquids flow into and replace this node
On a newline:
Warning: Making liquid nodes floodable causes an extreme load on waterflow processing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the engine ignores the floodable property if the node is also defined as a liquid? At least in my test I could not get water to flow into lava (after marking lava floodable). The on_flood callback wasn't getting called at all (tested by writing to chat inside the callback).
Edit: I think I performed the test incorrect, I'll redo it.
Edit2: test was performed correctly. Liquids indeed do not flood themselves or other liquids. Setting the floodable property for them seems to have no meaning. @paramat ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok i may be wrong.
doc/lua_api.txt
Outdated
@@ -4010,7 +4012,9 @@ Definition tables | |||
^ node placement (i.e. schematics and VoxelManip) or air nodes. If | |||
^ return true the node is not flooded, but on_flood callback will | |||
^ most likely be called over and over again every liquid update | |||
^ interval. Default: nil ]] | |||
^ interval. Note: liquid-type nodes cannot themselves be floodable, else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a newline:
Warning: Making liquid nodes floodable causes an extreme load on waterflow processing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand you right, you're saying the engine does indeed honor the floodable property for nodes also defined as liquids? I did not observe behavior consistent with that, myself.
Sorry for the learner's question, but what does 'on a newline' mean? Should I replace what I wrote there, or put your addition underneath, or ...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean that my suggested text should start on a new line instead of continuing from '^ interval. 'newline' means 'start text on a new line'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the text 'else liquids would continously flood themselves and overload the update queue.' is possibly untrue.
Still a good idea to not set floodable on liquids, in case it is causing load without actually triggering 'on flood'.
So something different is needed like: |
Ok, I understand now. Changes coming shortly. |
The original documentation did not specify that liquids should not themselves be floodable. This is probably something that should be mentioned.
aee930c
to
e0cf700
Compare
👍 |
1 similar comment
👍 |
The C++ source says it's incorrect. This updates the documentation to reflect that.