[wesnoth-commits] [wesnoth/wesnoth] 0035b7: Handle empty children in patch_movetype (#5582)

Steve Cotton noreply at github.com
Wed Mar 3 07:57:17 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 0035b776d717010fa7f1c9d72fbba79b56ab653c
      https://github.com/wesnoth/wesnoth/commit/0035b776d717010fa7f1c9d72fbba79b56ab653c
  Author: Steve Cotton <steve at octalot.co.uk>
  Date:   2021-03-03 (Wed, 03 Mar 2021)

  Changed paths:
    M src/units/types.cpp

  Log Message:
  -----------
  Handle empty children in patch_movetype (#5582)

In movetype::write, the children might not be created if that child has an
empty config; there might be no child at all for movetypes such as "none". The
movetype "none" is a real movetype defined in units.cfg for units that
shouldn't be able to move.

The original_cfg local variable was only used once anyway, removing it and the
comment made the code clearer.

This wasn't caught in the 1.15 testing, but with 1.14 it resulted in a
"mandatory WML child missing" warning.





More information about the Commits mailing list