mail[Wesnoth-commits] r43064 - in /trunk: data/scenario-test.cfg src/game_events.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by AI0867 on May 31, 2010 - 02:25:
Author: ai0867
Date: Mon May 31 02:24:59 2010
New Revision: 43064

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43064&view=rev
Log:
Add skip_steps key to [move_units_fake]

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

Modified: trunk/data/scenario-test.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/scenario-test.cfg?rev=43064&r1=43063&r2=43064&view=diff
==============================================================================
--- trunk/data/scenario-test.cfg (original)
+++ trunk/data/scenario-test.cfg Mon May 31 02:24:59 2010
@@ -626,20 +626,23 @@
             [fake_unit]
                 type="Orcish Slurbow"
                 side=2
-                x=25,19
-                y=7,7
+                x=24,19
+                y=6,7
+                skip_steps=2
             [/fake_unit]
             [fake_unit]
                 type="Orcish Grunt"
                 side=2
                 x=26,20
-                y=6,6
+                y=5,6
+                skip_steps=1
             [/fake_unit]
             [fake_unit]
                 type="Orcish Grunt"
                 side=2
-                x=26,20
-                y=7,7
+                x=27,20
+                y=11,7
+                skip_steps=0
             [/fake_unit]
         [/move_units_fake]
         [unit]

Modified: trunk/src/game_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=43064&r1=43063&r2=43064&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Mon May 31 02:24:59 2010
@@ -1165,8 +1165,11 @@
        foreach(const vconfig& config, unit_cfgs) {
                const std::vector<std::string> xvals = 
utils::split(config["x"]);
                const std::vector<std::string> yvals = 
utils::split(config["y"]);
+               const int skip_steps = 
lexical_cast_default<int>(config["skip_steps"]);
                units.push_back(create_fake_unit(config));
                paths.push_back(fake_unit_path(units.back(), xvals, yvals));
+               if(skip_steps > 0)
+                       paths.back().insert(paths.back().begin(), skip_steps, 
paths.back().front());
                longest_path = std::max(longest_path, paths.back().size());
                DBG_WML << "Path " << paths.size() - 1 << " has length " << 
paths.back().size() << '\n';
 




Related Messages


Powered by MHonArc, Updated Tue Jun 01 00:00:12 2010