URL:
  <http://gna.org/bugs/?21750>

                 Summary: Cannot delete AI candidate action after reload if a
CA was modified previously
                 Project: Battle for Wesnoth
            Submitted by: mattsc
            Submitted on: Mon 03 Mar 2014 07:46:09 PM UTC
                Category: Bug
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Artificial Intelligence
                  Status: None
                 Privacy: Public
             Assigned to: mattsc
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.7.3-1.11.11
        Operating System: OS X 10.9

    _______________________________________________________

Details:

Once the RCA stage candidate actions have been modified with [modify_ai] or
one of the macros using it, it is not possible to delete CAs any more after
reloading a game (other than deleting all of them simultaneously).

To reproduce, put the following two events into any scenario:

    [event]
        name=prestart

        {MODIFY_AI_ADD_CANDIDATE_ACTION 2 main_loop (
            [candidate_action]
                id=move_leader_to_keep
                engine=cpp
                name=ai_default_rca::move_leader_to_keep_phase
                max_score=160011
                score=160011
            [/candidate_action]
        )}
    [/event]

    [event]
        name=side 2 turn 1

        {MESSAGE narrator "" "" _"Trying to delete Goto CA"}

        [modify_ai]
            side = 2
            action = "delete"
            path = "stage[main_loop].candidate_action[goto]"
        [/modify_ai]
    [/event]

Then:
- Start the scenario from the beginning and let Side 2 play its turn
- Check that goto CA was removed, either with :inspect or --log-debug=ai/mod
CL option
- Reload the first turn auto-save and do the same thing again.

The first time the CA gets removed, the second time it is not removed.

Now, doing some tests, this only happens if the CAs were modified previously
outside the [side] tag.  If you put the MODIFY_AI_ADD_CANDIDATE_ACTION macro
into the [side] tag, or omit it entirely, the problem does not occur.  There's
no difference whether that prestart event is done with a custom or default CA,
whether it uses the cpp or lua engine, whether it actually is a prestart
event, etc.

As a result, removing/changing Micro AIs is not possible after a game is
reloaded as reported here
<http://forums.wesnoth.org/viewtopic.php?f=10&p=567212#p567212>.


Note: I know by now what causes this and will fix it shortly, but since this
bug has apparently been present since the RCA mechanism was introduced in
Wesnoth 1.7.3, I thought it should be recorded here.





    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?21750>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to