URL:
<http://gna.org/patch/?2853>
Summary: Patch for bug #14789: Right click during [kill]
animation can cause target unit to be [kill]ed
Project: Battle for Wesnoth
Submitted by: thonsew
Submitted on: Mon 01 Aug 2011 09:46:30 AM GMT
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
The specific bug this patch solves #14789 involves a wml kill event being
handled during which time the right mouse click menu is still capturing
events, which the wml kill handler interprets as filter locations.
The problem was that the old code iterated through the entire map and killed
units as it found units that satisfied the filter. It iterated through the
entire map because the unit_map iterators will reset when you kill units.
Since the death animation can be lengthy it gives users plenty of time to
click on new units, who where not meant to die.
The patch moves the filtering code to the top of the function and finds all
the units that satisfy the filter before any units are killed.
Note this doesn't solve the underlying problem that the gamestatus vconfig
x1,y1 and x2,y2 events are continuously updated while the handlers are run.
If run_wml_actions took and deep copy of the vconfig, there would never be a
problem. However, this might slow down the works.
I skimmed through all of the WML_HANDLER_FUNCTIONS and it doesn't look like
any others process animation in a loop that is also filtering objects.
thonsew
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Mon 01 Aug 2011 09:46:30 AM GMT Name: wml_kill_filter.patch Size: 4kB
By: thonsew
<http://gna.org/patch/download.php?file_id=13711>
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?2853>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs