Author: ai0867
Date: Wed Dec  3 14:30:34 2008
New Revision: 31245

URL: http://svn.gna.org/viewcvs/wesnoth?rev=31245&view=rev
Log:
Fix [role] not working without type key. (bug #12660)

Modified:
    trunk/changelog
    trunk/data/scenario-test.cfg
    trunk/src/game_events.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=31245&r1=31244&r2=31245&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Wed Dec  3 14:30:34 2008
@@ -38,6 +38,7 @@
    * Included extra headers for certain g++ versions (patch #1113).
    * Fixed random memory corruption/assertion failure/massive leak due
      to story  screens.
+   * Fixed [role] not working when no type was specified (bug #12660).
 
 Version 1.5.6:
  * Authoring tools:

Modified: trunk/data/scenario-test.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-test.cfg?rev=31245&r1=31244&r2=31245&view=diff
==============================================================================
--- trunk/data/scenario-test.cfg (original)
+++ trunk/data/scenario-test.cfg Wed Dec  3 14:30:34 2008
@@ -1063,6 +1063,26 @@
             y=5
         [/filter]
         {ADVANCE_UNIT x,y=5,5 (Grand Marshal,Yeti,Fire Dragon) }
+    [/event]
+
+    [label]
+        x,y=5,6
+        text="role test"
+    [/label]
+    [event]
+        name=moveto
+        first_time_only=no
+        [filter]
+            x,y=5,6
+        [/filter]
+        [role]
+            x,y=5,6
+            role=talking_guy
+        [/role]
+        [message]
+            role=talking_guy
+            message="I have the role!"
+        [/message]
     [/event]
 
     # Capture connected villages near 13,2 for team 2

Modified: trunk/src/game_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=31245&r1=31244&r2=31245&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Wed Dec  3 14:30:34 2008
@@ -1478,7 +1478,10 @@
                std::vector<std::string>::iterator ti;
                for(ti = types.begin(); ti != types.end(); ++ti) {
                        config item = cfg.get_config();
-                       item["type"] = *ti;
+                       // Do not try to match an empty string
+                       if ( ! (*ti).empty() ) {
+                               item["type"] = *ti;
+                       }
                        item["role"] = "";
                        vconfig filter(&item);
 


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

Reply via email to