Follow-up Comment #2, bug #13734 (project wesnoth):
I did a little testing of this as well, and discovered the following:
If you {CLEAR_VARIABLE unit.one} just before attempting to display the
lengths, everything displays as being empty for both units (unit.one.length
0, all other lengths empty strings). However, if you {CLEAR_VARIABLE
unit.one} (or {CLEAR_VARIABLE unit.one.two}) just after displaying the
lengths, it has no effect on the lengths (incorrectly) displayed for the
second unit.
So, it looks like what is happening is this: the length of the sub-array gets
stored when it is accessed. However, the stored value of the length is never
cleared, only overwritten - and if the sub-array you're checking the length
of hasn't been re-initialized after being cleared, it retrieves the old value
without overwriting it.
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?13734>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs