Follow-up Comment #4, patch #1808 (project wesnoth):
There are a few issues left.
1. children_handled should not be a parameter of handle_child, it should be a
local variable of handle_child. Otherwise you will get strange results for the
[a][b][/b][/a][c][b][/b][/c] case.
2. store_unit shouldn't be passed a parsed config, it should get the original
"filter" child. Otherwise variable substitution will happen at the wrong time
if the filter happens to reference variables like $this_unit.
3. Point 2 means that get_child+remove won't work anymore since the original
object is read-only (unless you first do get_child and then
get_child+remove). I wasn't really fond of the new get_child anyway. So, in
your case, you could solve it by adding a helper.remove_child function.
Another way to solve would be to just ignore [filter] children at the
toplevel when you encounter them in handle_child.
That's it for the correctness issues. Here is an efficiency issue.
4. I'm not sure you need both current_unit and name arguments. It seems like
both of them could be merged into a single one. But I may be wrong.
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?1808>
_______________________________________________
Message posté via/par Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs