I'm not very good with lua, and worse with the unit type, but...
Assuming that's pass by value, "unit" is local to guarantee_hit, is it not?
I think I would take the contents of guarantee_hit() and move it directly into attack_start_event/remove_tmp_hits temporarily. This may be completely wrong and a waste of time for someone who knows lua, but it's what I would do in trying to isolate the issue. If that works, maybe you need to wesnoth.get_unit(unit) in guarantee_hit????
Assuming that's pass by value, "unit" is local to guarantee_hit, is it not?
I think I would take the contents of guarantee_hit() and move it directly into attack_start_event/remove_tmp_hits temporarily. This may be completely wrong and a waste of time for someone who knows lua, but it's what I would do in trying to isolate the issue. If that works, maybe you need to wesnoth.get_unit(unit) in guarantee_hit????
Statistics: Posted by white_haired_uncle — Yesterday, 3:45 pm