Update of bug #16089 (project wesnoth):

                  Status:                    None => Confirmed              
                 Summary: varaible unit is empty if killed previously in an
event => variable unit is empty if killed previously in an event

    _______________________________________________________

Follow-up Comment #2:

Yes, you got it right: magic variables are lazily created the first time one
of their attributes is accessed. I guess it was implemented in order to try
to speed up WML a bit. The downside is obvious: you can therefore get the
wrong unit, or in your case no unit at all.

On the WML side, the solution is to always perform a dummy access to the
magic variables that one is interested in at the beginning of an event (e.g.
add 0 to hp).

As for $x1 being filled, it's not really inconsistent, when you know that
units are located by their coordinates. So, while the unit disappeared, the
coordinates themselves didn't vanish.

I'm not closing it though, since I consider it a real bug, but don't hold
your breath.

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?16089>

_______________________________________________
  Message posté via/par Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to