[wesnoth-commits] [wesnoth/wesnoth] c2ce47: Simplify help's logic for terrain_types that shoul...

Steve Cotton noreply at github.com
Fri Jan 17 10:14:15 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: c2ce47f6a3ffb2dba5d98f49903b8bb2fb193728
      https://github.com/wesnoth/wesnoth/commit/c2ce47f6a3ffb2dba5d98f49903b8bb2fb193728
  Author: Steve Cotton <steve at octalot.co.uk>
  Date:   2020-01-17 (Fri, 17 Jan 2020)

  Changed paths:
    M src/help/help.cpp
    M src/help/help_impl.cpp
    M src/terrain/terrain.cpp
    M src/terrain/terrain.hpp

  Log Message:
  -----------
  Simplify help's logic for terrain_types that should be hidden in help

Even when a terrain has hide_help=yes, its help should still be shown if the
player right-clicks on a hex of that type and selects "Terrain description".

This commit changes lines that have inconsistent logic, and the main reason for
doing it was to work out whether that inconsistency was something that needed
to be kept when refactoring the terrain code.

The inconsistency was a bug, help would fail to open the topic.  However, the
bug is so obscure that I only found it when considering the edge case that the
commit is removing, and there's no terrain in core that would trigger it.  The
edge case requires a terrain to be:

* defined by a [terrain_type] tag, so is_combined()==false
* hide_help=yes
* hidden=no (or is the default value)

To replicate the bug, try changing the definition of Gg to have hide_help=yes.





More information about the Commits mailing list