[wesnoth-commits] [wesnoth/wesnoth] e8b750: Help: fixed unit section such as the Walking Corps...

GitHub noreply at github.com
Tue Apr 3 09:21:10 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: e8b750f8a7223a17362c105a2ceb9b3709705e14
      https://github.com/wesnoth/wesnoth/commit/e8b750f8a7223a17362c105a2ceb9b3709705e14
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-04-03 (Tue, 03 Apr 2018)

  Changed paths:
    M src/help/section.cpp

  Log Message:
  -----------
  Help: fixed unit section such as the Walking Corpse's not generating

I didn't realize that is_valid_id was only meant to check IDs provided in the help config and
not IDs generated dynamically; the latter are always correct. Granted, the old code did actually
call its analogous codepath for race and era generation, but it did not for unit sections. My
refactor made it so this check happened *any* time a section was created, regardless of its source.

To rectify that, I moved ID validation for sections into the static section generation loop like
for topics. I also moved the topic id validation prior to the ToD generation, tweaked the invalid
id message, and renamed a variable for clarity and consistency.




More information about the Commits mailing list