[no squash] Minor fixes to DigtronLayout:write_layout_image and node_callbacks - #132
Merged
Merged
Conversation
core.node_dig calls node's after_dig_node before registered_on_dignodes and core.item_place_node calls node's after_place_node before registered_on_place_nodes.
Reset dug_nodes_count and placed_nodes_count to zero even in the case of an aborted writ (which never happens, AFAICT).
Member
|
Odd how the "after" callbacks are called before the main one. Well. It can't hurt to have it the same way as in builtin. Seems fine by me. Thanks. Will merge in a few days unless there are objections. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I don't know of any issue this is fixing, but it still seems like a good idea to correct sometime:
invoke
after_dig_nodeandafter_place_nodebefore calling the registered on_dignode/on_placenode callbacks (like builtin core.node_dig and core.item_place_node are doing - as well as digtron's builder code); AFAICT this only affects the digtron nodes themselves and isn't likely to make any difference at allreset static
dug_nodes_countandplaced_nodes_countat the beginning ofwrite_layout_imageto be safe even in the case of an aborted earlier write; AFAICT such an abort doesn't ever happen and if it did still would not really cause much problems (in comparison to the broken half written digtron left by the aborted write) due to the additional node callbacksI also standardized the variable names in
node_callbacks(in a separate commit, so that the individual diffs are easier to read).