Follow-up Comment #6, patch #2851 (project wesnoth):
brilliand,
I looked at your patch, but I'll wait to apply it until you have sorted out
your linking problems, which is imminent I hope.
The patch looks like it adds a global id, allows for the deletion of ids and
will work.
I'd like to re-explain my comment that the underlying problem is that the
events are in a global namespace, not whether they are called by a name or an
id. A fix with no surprising side-effects is to give them local scope to the
type of the wml object enclosing the instantiation of the event handler.
Right now, all events have a name with global scope. That means that if 2
events are created anywhere in the wml with the same name, then the event is
run twice. Hence the bug with the feeders, where the feed is twice when there
are 2 types of feeders in the scenario. It means that people can't use macros
to create events, because the events get doubled.
If the events had scope local to the enclosing wml, then the two feeding
events would have separate scope. One would be scoped to the Ghast and the
the other to the Necrophage unit type. That is the behavior that coders
expect. It allows people to use macros anywhere. It allows people to copy
paste anywhere.
The old fix effectively created local scope to a single fire event in a
particular turn number.
Any fix that doesn't add scope to the wml events, will always fail for some
combination of copying/macroing a chunk of code that re-creates a id/name and
executes the event twice.
Adding scoping to the events is a bigger undertaking for someone interested
in the syntactic intricacies of an evolving markup language. If this sounds
like you, the line forms to the left.
Thanks for the improved patch.
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?2851>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs