[Commits] [wesnoth/wesnoth] 1f3b23: add [do_command] wml action tag

GitHub noreply at github.com
Sun May 11 03:18:14 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 1f3b23ea1a9e821e1efeab2260467123774bc9f7
      https://github.com/wesnoth/wesnoth/commit/1f3b23ea1a9e821e1efeab2260467123774bc9f7
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-05-10 (Sat, 10 May 2014)

  Changed paths:
    M src/game_events/action_wml.cpp

  Log Message:
  -----------
  add [do_command] wml action tag

[do_command] executes commands like attack, move, recruit, etc.,
similar to those that may be found in [command] tags in replays.
These are executed in game immediately in a synchronized context,
similarly to as if a human or ai controller had ordered them.

It is also possible to use the command to fire a WML game event,
or to execute lua code from a synchronized context.

Only some of the children of [command] are valid in this tag.

With this tag, [issue_attack_command] and [issue_move_command] are
both deprecated and will be removed shortly.

Thanks to gfgtdf for both the idea and the implementation.


  Commit: 654c066550bcec571d0210457acd6ebcbe9e0ab1
      https://github.com/wesnoth/wesnoth/commit/654c066550bcec571d0210457acd6ebcbe9e0ab1
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-05-10 (Sat, 10 May 2014)

  Changed paths:
    M data/test/scenarios/unit_test_6.cfg

  Log Message:
  -----------
  refactor test #6 to use [do_command]


  Commit: ab0b63dc589d870c4b562e8d9252d73f74e94e82
      https://github.com/wesnoth/wesnoth/commit/ab0b63dc589d870c4b562e8d9252d73f74e94e82
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-05-10 (Sat, 10 May 2014)

  Changed paths:
    M src/synced_commands.cpp

  Log Message:
  -----------
  change a warning to a log message, related to [attack] command

The core code seems to handle it just find when defender_weapon
is not present, so this warning seems unnecessary. This will make
it easier to use [do_command].


  Commit: a37ec8bbdbee3bc7f2d576bf50778fcbff0012b7
      https://github.com/wesnoth/wesnoth/commit/a37ec8bbdbee3bc7f2d576bf50778fcbff0012b7
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-05-10 (Sat, 10 May 2014)

  Changed paths:
    M data/test/scenarios/unit_test_6.cfg
    M src/synced_commands.cpp

  Log Message:
  -----------
  make [command] [attack] handler a bit friendlier

Now, it won't warn about mismatch with gamestate when you don't
specify attacker_type or defender_type.

Simplify unit test 6 accordingly.


  Commit: 5cfdb137b3937467264ec67fe03b9dbee156ddf8
      https://github.com/wesnoth/wesnoth/commit/5cfdb137b3937467264ec67fe03b9dbee156ddf8
  Author: Chris Beck <render787 at gmail.com>
  Date:   2014-05-10 (Sat, 10 May 2014)

  Changed paths:
    M src/game_events/action_wml.cpp

  Log Message:
  -----------
  remove [issue_attack_command], [issue_move_command]

also add some comments to [do_command] which replaces them.


Compare: https://github.com/wesnoth/wesnoth/compare/f08db9b3a4d0...5cfdb137b393


More information about the Commits mailing list