Author: espreon
Date: Tue Mar  8 00:51:15 2011
New Revision: 48823

URL: http://svn.gna.org/viewcvs/wesnoth?rev=48823&view=rev
Log:
Applied patch #1887 with slight modifications.

Modified:
    trunk/changelog
    
trunk/data/campaigns/Descent_Into_Darkness/scenarios/11_Descent_into_Darkness.cfg
    trunk/data/campaigns/Eastern_Invasion/scenarios/02_The_Escape_Tunnel.cfg
    
trunk/data/campaigns/Heir_To_The_Throne/scenarios/14_Plunging_Into_the_Darkness.cfg
    trunk/data/campaigns/Heir_To_The_Throne/scenarios/15_The_Lost_General.cfg
    trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg
    trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/06_High_Pass.cfg
    
trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/12_The_Underlevels.cfg
    
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/03_Stirring_in_the_Night.cfg
    trunk/src/game_events.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=48823&r1=48822&r2=48823&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Tue Mar  8 00:51:15 2011
@@ -55,6 +55,8 @@
    * Introduced [move_unit]check_passability= (default yes, previously it was
      always yes/non-existent) key to allow disabling the check for suitable 
terrain.
    * Added TAKE_IT_STRING and LEAVE_IT_STRING arguments to PICKUPPABLE_ITEM
+   * The tags [remove_shroud] and [place_shroud] now take comma-separated 
lists of sides.
+     They default to affecting all sides now if no side is set.
  * Miscellaneous and bugfixes:
    * Fixed: g++ compiler warnings.
    * Added: cmake target to build the gui design pdf.

Modified: 
trunk/data/campaigns/Descent_Into_Darkness/scenarios/11_Descent_into_Darkness.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Descent_Into_Darkness/scenarios/11_Descent_into_Darkness.cfg?rev=48823&r1=48822&r2=48823&view=diff
==============================================================================
--- 
trunk/data/campaigns/Descent_Into_Darkness/scenarios/11_Descent_into_Darkness.cfg
 (original)
+++ 
trunk/data/campaigns/Descent_Into_Darkness/scenarios/11_Descent_into_Darkness.cfg
 Tue Mar  8 00:51:15 2011
@@ -554,6 +554,7 @@
         [/message]
 
         [remove_shroud]
+            side=1
             x=27-32
             y=23-27
         [/remove_shroud]

Modified: 
trunk/data/campaigns/Eastern_Invasion/scenarios/02_The_Escape_Tunnel.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Eastern_Invasion/scenarios/02_The_Escape_Tunnel.cfg?rev=48823&r1=48822&r2=48823&view=diff
==============================================================================
--- trunk/data/campaigns/Eastern_Invasion/scenarios/02_The_Escape_Tunnel.cfg 
(original)
+++ trunk/data/campaigns/Eastern_Invasion/scenarios/02_The_Escape_Tunnel.cfg 
Tue Mar  8 00:51:15 2011
@@ -315,6 +315,7 @@
 
 #endif
         [remove_shroud]
+            side=1
             x,y=3,3
         [/remove_shroud]
         [teleport]

Modified: 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/14_Plunging_Into_the_Darkness.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Heir_To_The_Throne/scenarios/14_Plunging_Into_the_Darkness.cfg?rev=48823&r1=48822&r2=48823&view=diff
==============================================================================
--- 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/14_Plunging_Into_the_Darkness.cfg
 (original)
+++ 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/14_Plunging_Into_the_Darkness.cfg
 Tue Mar  8 00:51:15 2011
@@ -241,6 +241,7 @@
         [/recall]
 
         [place_shroud]
+            side=1
             x,y=1-20,21-41
         [/place_shroud]
 

Modified: 
trunk/data/campaigns/Heir_To_The_Throne/scenarios/15_The_Lost_General.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Heir_To_The_Throne/scenarios/15_The_Lost_General.cfg?rev=48823&r1=48822&r2=48823&view=diff
==============================================================================
--- trunk/data/campaigns/Heir_To_The_Throne/scenarios/15_The_Lost_General.cfg 
(original)
+++ trunk/data/campaigns/Heir_To_The_Throne/scenarios/15_The_Lost_General.cfg 
Tue Mar  8 00:51:15 2011
@@ -206,6 +206,7 @@
             x,y=6,23
         [/scroll_to]
         [remove_shroud]
+            side=1
             x=2-4
             y=21-24
         [/remove_shroud]
@@ -294,6 +295,7 @@
             find_vacant=yes
         [/unstore_unit]
         [place_shroud]
+            side=1
             x= 2-7 , 7-8
             y=21-24,22-24
         [/place_shroud]
@@ -326,6 +328,7 @@
             side=1
         [/filter]
         [remove_shroud]
+            side=1
             x=14-16,12-18,10-19,12-18
             y=10,   11,   12-14,15
         [/remove_shroud]

Modified: trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg?rev=48823&r1=48822&r2=48823&view=diff
==============================================================================
--- trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg 
(original)
+++ trunk/data/campaigns/Northern_Rebirth/scenarios/05a_The_Pursuit.cfg Tue Mar 
 8 00:51:15 2011
@@ -1073,6 +1073,7 @@
 
         # Remove some shroud and place the units
         [remove_shroud]
+            side=1
             x=9,7-10
             y=8-11,10-12
         [/remove_shroud]
@@ -2368,6 +2369,7 @@
 #endif
 #endif
         [remove_shroud]
+            side=1
             x=28-30
             y=8-12
         [/remove_shroud]
@@ -2615,6 +2617,7 @@
                 # Set a flag to prevent the confrontation form getting 
triggered more than once
                 {VARIABLE confronted_malifor yes}
                 [remove_shroud]
+                    side=1
                     x=23-26
                     y=8-13
                 [/remove_shroud]

Modified: 
trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/06_High_Pass.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/06_High_Pass.cfg?rev=48823&r1=48822&r2=48823&view=diff
==============================================================================
--- trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/06_High_Pass.cfg 
(original)
+++ trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/06_High_Pass.cfg Tue 
Mar  8 00:51:15 2011
@@ -157,11 +157,13 @@
         [/message]
 
         [remove_shroud]
+            side=1
             x=29-31
             y=10-12
         [/remove_shroud]
         {HIGHLIGHT_IMAGE 30 11 scenery/signpost.png ()}
         [place_shroud]
+            side=1
             x=29-31
             y=10-12
         [/place_shroud]

Modified: 
trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/12_The_Underlevels.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/12_The_Underlevels.cfg?rev=48823&r1=48822&r2=48823&view=diff
==============================================================================
--- 
trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/12_The_Underlevels.cfg 
(original)
+++ 
trunk/data/campaigns/The_Hammer_of_Thursagan/scenarios/12_The_Underlevels.cfg 
Tue Mar  8 00:51:15 2011
@@ -862,6 +862,7 @@
         [/terrain]
 
         [remove_shroud]
+            side=1
             x=7-10
             y=1-3
         [/remove_shroud]
@@ -913,6 +914,7 @@
         [/terrain]
 
         [remove_shroud]
+            side=1
             x=15-18
             y=1-3
         [/remove_shroud]
@@ -964,6 +966,7 @@
         [/terrain]
 
         [remove_shroud]
+            side=1
             x=22-25
             y=1-3
         [/remove_shroud]
@@ -1015,6 +1018,7 @@
         [/terrain]
 
         [remove_shroud]
+            side=1
             x=22-25
             y=8-10
         [/remove_shroud]

Modified: 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/03_Stirring_in_the_Night.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/campaigns/Under_the_Burning_Suns/scenarios/03_Stirring_in_the_Night.cfg?rev=48823&r1=48822&r2=48823&view=diff
==============================================================================
--- 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/03_Stirring_in_the_Night.cfg
 (original)
+++ 
trunk/data/campaigns/Under_the_Burning_Suns/scenarios/03_Stirring_in_the_Night.cfg
 Tue Mar  8 00:51:15 2011
@@ -1368,6 +1368,7 @@
                             fire_event=no
                         [/kill]
                         [place_shroud]
+                            side=1
                             x=1-60
                             y=1-60
                         [/place_shroud]
@@ -1529,6 +1530,7 @@
                             side=1
                         [/redraw]
                         [place_shroud]
+                            side=1
                             x=1-60
                             y=1-60
                         [/place_shroud]
@@ -1798,6 +1800,7 @@
                             [/then]
                         [/if]
                         [place_shroud]
+                            side=1
                             x=1-60
                             y=1-60
                         [/place_shroud]
@@ -2080,6 +2083,7 @@
                             [/then]
                         [/if]
                         [place_shroud]
+                            side=1
                             x=1-60
                             y=1-60
                         [/place_shroud]

Modified: trunk/src/game_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=48823&r1=48822&r2=48823&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Tue Mar  8 00:51:15 2011
@@ -544,26 +544,44 @@
 
 static void toggle_shroud(const bool remove, const vconfig& cfg)
 {
-       int side_num = cfg["side"].to_int(1);
-       const size_t index = side_num-1;
-
-       if (index < resources::teams->size())
-       {
-               team &t = (*resources::teams)[index];
-               std::set<map_location> locs;
-               terrain_filter filter(cfg, *resources::units);
-               filter.restrict_size(game_config::max_loop);
-               filter.get_locations(locs, true);
-
-               foreach (map_location const &loc, locs)
+       std::string side_for_raw = cfg["side"];
+
+       //If they didn't define any sides then we are making a comma separated 
list for them
+       //It contains all the sides from 1 to the max number of sides in play
+       if (side_for_raw.empty()) {
+       side_for_raw = "1";
+               for (size_t side_index = 1; side_index < 
resources::teams->size(); side_index++) {
+                       std::string side_fake = lexical_cast<std::string>( 
side_index + 1 );
+                       side_for_raw = side_for_raw + "," + side_fake;
+               }
+       }
+       //iterate through the list
+       std::vector<std::string> side_for =
+               utils::split(side_for_raw, ',', utils::STRIP_SPACES | 
utils::REMOVE_EMPTY);
+       std::vector<std::string>::iterator itSide;
+       size_t side;
+       for (itSide = side_for.begin(); itSide != side_for.end(); ++itSide)
+       {
+               side = lexical_cast_default<size_t>(*itSide);
+               size_t index = side-1;
+               if (index < resources::teams->size())
                {
-                       if (remove) {
-                               t.clear_shroud(loc);
-                       } else {
-                               t.place_shroud(loc);
-                       }
-               }
-       }
+                       team &t = (*resources::teams)[index];
+                       std::set<map_location> locs;
+                       terrain_filter filter(cfg, *resources::units);
+                       filter.restrict_size(game_config::max_loop);
+                       filter.get_locations(locs, true);
+
+                       foreach (map_location const &loc, locs)
+                       {
+                               if (remove) {
+                                       t.clear_shroud(loc);
+                               } else {
+                                       t.place_shroud(loc);
+                               }
+                       }
+               }
+       }
 
        resources::screen->labels().recalculate_shroud();
        resources::screen->recalculate_minimap();


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

Reply via email to