[wesnoth-commits] [wesnoth/wesnoth] 99f27b: Make saved_game::expand_scenario() look correct, a...

Steve Cotton noreply at github.com
Mon Nov 16 03:52:39 UTC 2020


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 99f27b7191cdd8175b28d98b7db4b155f39df98a
      https://github.com/wesnoth/wesnoth/commit/99f27b7191cdd8175b28d98b7db4b155f39df98a
  Author: Steve Cotton <steve at octalot.co.uk>
  Date:   2020-11-16 (Mon, 16 Nov 2020)

  Changed paths:
    M src/saved_game.cpp
    M src/saved_game.hpp

  Log Message:
  -----------
  Make saved_game::expand_scenario() look correct, and add a const

This doesn't change the behavior - the changed line is in a conditional block
which tells us exactly which of scenario_id()'s code paths will happen, and it
will still end up using carryover_["next_scenario"]. The change is just making
it consistent with the way that other lines in expand_scenario() find out which
scenario id to use; it's preparing to load the next scenario, so it should use
that scenario's id to load any metadata, not the current scenario's id.

Also, scenario_id() should be const. This helps with refactoring out the
existence of a de-facto singleton instance of saved_game.





More information about the Commits mailing list