[Commits] [wesnoth/wesnoth] 1b6f99: Resolve crash when unit is killed before its plann...

GitHub noreply at github.com
Sat Sep 24 13:14:22 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 1b6f997834bf17a450671f741ce3fb8e6f49bdce
      https://github.com/wesnoth/wesnoth/commit/1b6f997834bf17a450671f741ce3fb8e6f49bdce
  Author: Wedge009 <wedge009 at wedge009.net>
  Date:   2016-09-21 (Wed, 21 Sep 2016)

  Changed paths:
    M src/whiteboard/highlighter.cpp

  Log Message:
  -----------
  Resolve crash when unit is killed before its planned actions are completed (Bug #20071)

Attempt to resolve bug #20071 where a unit with planned actions is killed before those actions can be completed. This would otherwise result in an assertion failure or crash to desktop because sa.find_last_action_of() would be making a null pointer reference (get_unit() returns null when the unit is killed).

I have tested this with one unit killed before planned actions are completed, two units killed before planned actions are completed, and a mixture of live units with planned actions completed, live units with planned actions incomplete, and units killed before planned actions are completed. The catch is that planned actions painted on the screen get left behind after their respective units are killed off, until the mouse cursor hovers over the actions and triggers a redraw. But it is better than nothing and at the very least the game should not crash any more.

I'm not familiar with all the code, but at a high level I suppose a solution to the above is to do a check on side_actions whenever a unit is killed. (I think last_action_redraw() is only called when the mouse cursor hovers over a planned action or its unit.) I think this would be more work, in places outside of the whiteboard area of code used for action planning.


  Commit: ad9e5e022a9a1e7d5a5534dabdb71163868f17c5
      https://github.com/wesnoth/wesnoth/commit/ad9e5e022a9a1e7d5a5534dabdb71163868f17c5
  Author: Wedge009 <wedge009 at wedge009.net>
  Date:   2016-09-21 (Wed, 21 Sep 2016)

  Changed paths:
    M changelog

  Log Message:
  -----------
  Update change log.


  Commit: 9d27ff45c533da74ef40034271a7aa2e650fd12d
      https://github.com/wesnoth/wesnoth/commit/9d27ff45c533da74ef40034271a7aa2e650fd12d
  Author: Celtic Minstrel <CelticMinstrel at users.noreply.github.com>
  Date:   2016-09-24 (Sat, 24 Sep 2016)

  Changed paths:
    M changelog
    M src/whiteboard/highlighter.cpp

  Log Message:
  -----------
  Merge pull request #496 from Wedge009/bug_20071_fix

Resolve crash on unit killed before planned actions are completed (bug #20071)


Compare: https://github.com/wesnoth/wesnoth/compare/99a713c5e334...9d27ff45c533


More information about the Commits mailing list