[Commits] [wesnoth/wesnoth] 5374ab: fix replay buttons not disapearing

GitHub noreply at github.com
Tue May 17 23:11:49 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 5374abef51d9fa6e504bc81dcdb712c569a30745
      https://github.com/wesnoth/wesnoth/commit/5374abef51d9fa6e504bc81dcdb712c569a30745
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2016-05-18 (Wed, 18 May 2016)

  Changed paths:
    M src/replay_controller.cpp

  Log Message:
  -----------
  fix replay buttons not disapearing

when pressing 'continue play'.

This worked when the continue play button was implemented, but somwhow
it got broken since then.


  Commit: 3dbafac913087506c9eb596bec49055a2bb27397
      https://github.com/wesnoth/wesnoth/commit/3dbafac913087506c9eb596bec49055a2bb27397
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2016-05-18 (Wed, 18 May 2016)

  Changed paths:
    M src/variable_info.cpp

  Log Message:
  -----------
  refactor variable_info.cpp

prepares a fix for https://gna.org/bugs/?24671


  Commit: 6d7549ed99668415c91b72f6582edb49ae3ddb39
      https://github.com/wesnoth/wesnoth/commit/6d7549ed99668415c91b72f6582edb49ae3ddb39
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2016-05-18 (Wed, 18 May 2016)

  Changed paths:
    M src/variable_info.cpp

  Log Message:
  -----------
  fix mode=replace in [set_variables]

http://gna.org/bugs/?24671

There was a problem in the code that made sure that the destiation
config is already avaiable when doing a [set_variables]:

The code consists of 2 parts: the first one (as_range_visitor_base)
determines the destination range operated on (a.b or a.b[n]), while the
second one (the .._h classes) implemented the actual operation.

Before this commit the first part also made sure that the destination
range exists before calling the second part, however this is not the
correct way to do it becasue the first part cannot know what part 2
actuall needs: a 'replace' operation at arr[1] needs arr to have at
least 2 elements while an insert operation in aa[1] only needs arr to
have 1 elements. So fixing the 'insert' function
(https://gna.org/bugs/?24412) broke the 'replace' function.

This commit moves the "make sure that the destination range exists" to
the second part, in order to to this we have to split
variable_as_array_h to a seperate visitor because we cannot  easily
implement the "make sure that the destination range exists" in th second
part in a vit_const case.

Maybe this code can be simplified further, in particular i think that we
should maybe remove the 'as_range_visitor_base' completeley since it now
handles just 4 operations (the 4 [set_variables] modes: replace, insert,
append,  merge) from which only 'replace' really operates on a destination
ranges (meaning for those others a.b is just an alias for a.b[0] while in
'replace' a.b means 'replace the whole range' unlike a.b[0] which means
'replace just the first element').


Compare: https://github.com/wesnoth/wesnoth/compare/52cba5fc639a...6d7549ed9966


More information about the Commits mailing list