[wesnoth-commits] [wesnoth/wesnoth] 97a581: wb: fix moved becoming invalid after recruit is ex...

GitHub noreply at github.com
Sat May 5 19:31:14 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 97a5810f2d048b3da4dc2e5ab656d94a41b0e106
      https://github.com/wesnoth/wesnoth/commit/97a5810f2d048b3da4dc2e5ab656d94a41b0e106
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-05-06 (Sun, 06 May 2018)

  Changed paths:
    M src/whiteboard/action.hpp
    M src/whiteboard/mapbuilder.cpp
    M src/whiteboard/recall.cpp
    M src/whiteboard/recall.hpp
    M src/whiteboard/recruit.cpp
    M src/whiteboard/recruit.hpp

  Log Message:
  -----------
  wb: fix moved becoming invalid after recruit is executed  2

turned out 8bdccca7 was not enough because the mapbuilder erroneously
reset the units movement to full directly before it was applied. Since
the `resetters_` code in mapbuilder.cpp does not apply to
recruited/recalled units, we also have to reset the units mp in
remove_temp_modifier.


  Commit: 19e123e38b804f052648f1e2dbe8f534ae0978cf
      https://github.com/wesnoth/wesnoth/commit/19e123e38b804f052648f1e2dbe8f534ae0978cf
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-05-06 (Sun, 06 May 2018)

  Changed paths:
    M src/units/unit.hpp
    M src/whiteboard/recall.cpp
    M src/whiteboard/recall.hpp

  Log Message:
  -----------
  wb: fix recall actions changing gamestate

The firstproblem was that:
apply_temp_modifier adds the temp_unit_ to the map, then
remove_temp_modifier adds the temp_unit_ from the map to the recall
list, which resulted in the original recall unit beeing replaced by the
temp_unit_ of the recall_action We fix that by making sure that
temp_unit_ is always the same as athe recall unti not just a copy.

The second problem was that remove_temp_modifier reset the unit mp/ap to
a value differnt form the original mp/ap which could casue OOS later
since the ap/mp might be changed form that unsynced context, we fix that
by resetting the mp/ap in remove_temp_modifier


  Commit: 14a0e3744fb887e58ac75d378666f834ead6c30f
      https://github.com/wesnoth/wesnoth/commit/14a0e3744fb887e58ac75d378666f834ead6c30f
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-05-06 (Sun, 06 May 2018)

  Changed paths:
    M src/recall_list_manager.cpp
    M src/recall_list_manager.hpp
    M src/whiteboard/recall.cpp
    M src/whiteboard/recall.hpp

  Log Message:
  -----------
  wb: fix rare OOS caused by recall action

previously having a planned recall action could change the order of
units in the recall list, which might for example change which unit is
recalled by a [recall].


  Commit: 5a3eec539877bef661cca91223770baae28829f5
      https://github.com/wesnoth/wesnoth/commit/5a3eec539877bef661cca91223770baae28829f5
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-05-06 (Sun, 06 May 2018)

  Changed paths:
    M src/units/unit.hpp

  Log Message:
  -----------
  fix comment


  Commit: 51189881dc41ea1058e9b20fef59e8b040a65c37
      https://github.com/wesnoth/wesnoth/commit/51189881dc41ea1058e9b20fef59e8b040a65c37
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-05-06 (Sun, 06 May 2018)

  Changed paths:
    M src/whiteboard/manager.cpp

  Log Message:
  -----------
  wb: silence "Unable to build future map" warning


  Commit: aa3a357bfce3dd59cfea9dc1d0e7eee55764cf1c
      https://github.com/wesnoth/wesnoth/commit/aa3a357bfce3dd59cfea9dc1d0e7eee55764cf1c
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-05-06 (Sun, 06 May 2018)

  Changed paths:
    M src/units/unit.cpp

  Log Message:
  -----------
  wb: fix planned units under fog cannot be selected


  Commit: 4725ba9f353ea431fe453016b41493c093ffcbf7
      https://github.com/wesnoth/wesnoth/commit/4725ba9f353ea431fe453016b41493c093ffcbf7
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-05-06 (Sun, 06 May 2018)

  Changed paths:
    M src/mouse_events.cpp

  Log Message:
  -----------
  add todo


  Commit: 2635c7014fa754def5e6d3263781084880316fc4
      https://github.com/wesnoth/wesnoth/commit/2635c7014fa754def5e6d3263781084880316fc4
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-05-06 (Sun, 06 May 2018)

  Changed paths:
    M src/whiteboard/move.cpp

  Log Message:
  -----------
  wb: more detailed error message


  Commit: cdb98f75a471698e5138dccd427556a9c348ed75
      https://github.com/wesnoth/wesnoth/commit/cdb98f75a471698e5138dccd427556a9c348ed75
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-05-06 (Sun, 06 May 2018)

  Changed paths:
    M src/pathfind/pathfind.cpp
    M src/pathfind/pathfind.hpp
    M src/whiteboard/move.cpp

  Log Message:
  -----------
  wb: fix 'insufficient movement' wanring when a move is interrupted


  Commit: 8b745095aba977d51218cd95b80168f40fb0b870
      https://github.com/wesnoth/wesnoth/commit/8b745095aba977d51218cd95b80168f40fb0b870
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-05-06 (Sun, 06 May 2018)

  Changed paths:
    M src/whiteboard/side_actions.cpp

  Log Message:
  -----------
  add a comment


  Commit: 775f3ec995943285109596c988f4735b251584d9
      https://github.com/wesnoth/wesnoth/commit/775f3ec995943285109596c988f4735b251584d9
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-05-06 (Sun, 06 May 2018)

  Changed paths:
    M src/play_controller.cpp

  Log Message:
  -----------
  wb: prevent unit id conflics

the wb recruit actions store temp units with fake ids and live longer
than a turn, so resetting the underlying id counter between turns might
result in dublicate id errors in wb recruit actions ( #1517 ), which
might lead to errors later.

With this it is of course possible to get erros when more than 2^31 (or
2^63 on a 64 bit wesnoth version.) fake units are generated during a
game, but that is less likely.


Compare: https://github.com/wesnoth/wesnoth/compare/6c5fc82b1baa...775f3ec99594
      **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the Commits mailing list