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

                 Summary: Regression in [set_menu_item] redefining behavior
                 Project: Battle for Wesnoth
            Submitted by: fdsfsfdsjkljkl
            Submitted on: Mon 27 Apr 2015 04:53:40 AM UTC
                Category: Bug
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: WML
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.13.0
        Operating System: Linux

    _______________________________________________________

Details:

Consider the following WML snippet:

        [set_menu_item]
          id="buggyitem"
          description="Set up the bug!"
          [command]
            [message]
              speaker = narrator
              message = "Message 1: Now that you've clicked the menu item with
id 'buggyitem' once I'm going to redefine what it does"
            [/message]
            [set_menu_item]
              id="buggyitem"
              description="Trigger the bug!"
              [command]
                [message]
                  speaker = narrator
                  message = "Message 2: This message will not be displayed if
you're using a buggy version of Wesnoth 1.13!"
                [/message]
              [/command]
            [/set_menu_item]
          [/command]
        [/set_menu_item]

In Wesnoth 1.11 from Debian, the following interaction takes place:
* I click the menu item titled "Set up the bug"
* Message 1 is printed
* I click the menu item titled "Trigger the bug"
* Message 2 is printed

In Wesnoth 1.13 (built from source here
http://sourceforge.net/projects/wesnoth/files/wesnoth/wesnoth-1.13.0/wesnoth-1.13.0.tar.bz2/download),
the following interaction takes place:
* I click the menu item titled "Set up the bug"
* Message 1 is printed
* I click the menu item titled "Trigger the bug"
* Message 1 is printed again!

It looks like in Wesnoth 1.13, redefining a menu item with set_menu_item will
change the description of the menu item, but the original command will still
be run.  For now, a valid workaround seems to be the following:

        [set_menu_item]
          id="buggyitem"
          description="Set up the bug!"
          [command]
            [message]
              speaker = narrator
              message = "Message 1: Now that you've clicked the menu item with
id 'buggyitem' once I'm going to redefine what it does"
            [/message]
            [clear_menu_item]
              id="buggyitem"
            [/clear_menu_item]
            [set_menu_item]
              id="buggyitem"
              description="Trigger the bug!"
              [command]
                [message]
                  speaker = narrator
                  message = "Message 2: This message will not be displayed if
you're using a buggy version of Wesnoth 1.13!"
                [/message]
              [/command]
            [/set_menu_item]
          [/command]
        [/set_menu_item]





    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  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