[wesnoth-commits] [wesnoth/wesnoth] b2cb4b: Fix #2615

GitHub noreply at github.com
Sun Mar 11 06:36:54 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: b2cb4be47d245f3baafaf447e862d8cd67c22b38
      https://github.com/wesnoth/wesnoth/commit/b2cb4be47d245f3baafaf447e862d8cd67c22b38
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-03-11 (Sun, 11 Mar 2018)

  Changed paths:
    M src/actions/attack.cpp
    M src/gui/dialogs/attack_predictions.cpp
    M src/reports.cpp
    M src/units/abilities.cpp
    M src/units/attack_type.hpp

  Log Message:
  -----------
  Fix #2615

this changes it so that the during events the attack_type references its
context units always by location, like it was done in 1.12, considering
the soon 1.14 release i think this is the best fix

The problem with the old implementation basically was that if a wml
script replaced the unit in a attack events  the
attack_type::self_/other_ would point to an outdated unit during the
next handler of the same event.


  Commit: a32f6aaf649fdab306a3024034a0e8212901e91e
      https://github.com/wesnoth/wesnoth/commit/a32f6aaf649fdab306a3024034a0e8212901e91e
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-03-11 (Sun, 11 Mar 2018)

  Changed paths:
    M src/actions/advancement.cpp
    M src/actions/attack.cpp
    M src/actions/create.cpp
    M src/actions/unit_creator.cpp
    M src/ai/lua/engine_lua.cpp
    M src/ai/simulated_actions.cpp
    M src/editor/action/action_unit.cpp
    M src/editor/action/action_unit.hpp
    M src/editor/action/mouse/mouse_action_unit.cpp
    M src/editor/map/map_context.cpp
    M src/game_events/action_wml.cpp
    M src/pathfind/pathfind.cpp
    M src/scripting/game_lua_kernel.cpp
    M src/synced_commands.cpp
    M src/teambuilder.cpp
    M src/tests/test_recall_list.cpp
    M src/tests/test_unit_map.cpp
    M src/units/make.cpp
    M src/units/make.hpp
    M src/units/map.cpp
    M src/units/udisplay.cpp
    M src/units/unit.cpp
    M src/units/unit.hpp
    M src/whiteboard/manager.cpp
    M src/whiteboard/move.cpp
    M src/whiteboard/recall.cpp
    M src/whiteboard/recruit.cpp

  Log Message:
  -----------
  make sure units are always stored in unit_ptr step2

previously the unit ctor could invoke arbitrary umc lua code, for
example via advance_to -> add_modification ->
resources::lua_kernel->apply_effect and during that call the unit was
not owned by a unit_ptr, so the code could not use unit_ptr objects at
several places because the unit might not be owned by a unit_ptr object.


  Commit: a8f2500773368555f5592862107e53566dceb9e2
      https://github.com/wesnoth/wesnoth/commit/a8f2500773368555f5592862107e53566dceb9e2
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2018-03-11 (Sun, 11 Mar 2018)

  Changed paths:
    M src/reports.cpp
    M src/units/abilities.cpp
    M src/units/attack_type.hpp

  Log Message:
  -----------
  Use unit_ptr in a few more places for increased consistency


  Commit: afc60b9cc6b5d929445e02b8d82b5524d6a2b1a8
      https://github.com/wesnoth/wesnoth/commit/afc60b9cc6b5d929445e02b8d82b5524d6a2b1a8
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2018-03-11 (Sun, 11 Mar 2018)

  Changed paths:
    M src/actions/advancement.cpp
    M src/ai/lua/engine_lua.cpp
    M src/ai/simulated_actions.cpp
    M src/editor/action/action_unit.hpp
    M src/game_board.cpp
    M src/scripting/game_lua_kernel.cpp
    M src/units/make.cpp
    M src/units/map.cpp
    M src/units/udisplay.cpp
    M src/units/unit.cpp
    M src/units/unit.hpp
    M src/whiteboard/manager.cpp
    M src/whiteboard/move.cpp
    M src/whiteboard/recall.cpp
    M src/whiteboard/recruit.cpp

  Log Message:
  -----------
  Rename the unit copy function (and make it non-static)


  Commit: 6bda3a9b6f319e4010ab4aa663710264f99f7762
      https://github.com/wesnoth/wesnoth/commit/6bda3a9b6f319e4010ab4aa663710264f99f7762
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2018-03-11 (Sun, 11 Mar 2018)

  Changed paths:
    M src/reports.cpp

  Log Message:
  -----------
  Re-indent attack_info report function


Compare: https://github.com/wesnoth/wesnoth/compare/7ed2e57ebcbe...6bda3a9b6f31


More information about the Commits mailing list