mail[Wesnoth-commits] r52732 - in /trunk: changelog players_changelog src/game_display.cpp src/whiteboard/manager.cpp src/whiteboard/manager.hpp


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

Header


Content

Posted by gabrielmorin on January 22, 2012 - 00:16:
Author: gabba
Date: Sun Jan 22 00:16:12 2012
New Revision: 52732

URL: http://svn.gna.org/viewcvs/wesnoth?rev=52732&view=rev
Log:
Display terrain % and various other marks when creating multi-turn moves.
Fixes bug #18635.

Modified:
    trunk/changelog
    trunk/players_changelog
    trunk/src/game_display.cpp
    trunk/src/whiteboard/manager.cpp
    trunk/src/whiteboard/manager.hpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=52732&r1=52731&r2=52732&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sun Jan 22 00:16:12 2012
@@ -48,6 +48,7 @@
    * Fixed bug #19221 : Assert when a whiteboard move-attack wins a scenario
    * Fixed bug #19142 : attacks can be simulated between units (for which 
this
      shouldn't be possible)
+   * Fixed bug #18635: Percentage not displayed for units selected at their 
future position
  * Miscellaneous and bug fixes:
    * Fixed wmlindent writing CRLF end of lines on windows
    * Fix tutorial units without xp bar

Modified: trunk/players_changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/players_changelog?rev=52732&r1=52731&r2=52732&view=diff
==============================================================================
--- trunk/players_changelog (original)
+++ trunk/players_changelog Sun Jan 22 00:16:12 2012
@@ -27,6 +27,7 @@
    * Fixed bug #19221 : Assert when a whiteboard move-attack wins a scenario
    * Fixed bug #19142 : attacks can be simulated between units (for which 
this
      shouldn't be possible)
+   * Fixed bug #18635: Percentage not displayed for units selected at their 
future position
 
 
 Version 1.9.14:

Modified: trunk/src/game_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_display.cpp?rev=52732&r1=52731&r2=52732&view=diff
==============================================================================
--- trunk/src/game_display.cpp (original)
+++ trunk/src/game_display.cpp Sun Jan 22 00:16:12 2012
@@ -563,7 +563,9 @@
        // Don't use empty route or the first step (the unit will be there)
        if(w != route_.marks.end()
                                && !route_.steps.empty() && 
route_.steps.front() != loc) {
-               const unit_map::const_iterator un = 
units_.find(route_.steps.front());
+               const unit_map::const_iterator un =
+                               
resources::whiteboard->get_temp_move_unit().valid() ?
+                                               
resources::whiteboard->get_temp_move_unit() : 
units_.find(route_.steps.front());
                if(un != units_.end()) {
                        // Display the def% of this terrain
                        int def =  100 - 
un->defense_modifier(get_map().get_terrain(loc));

Modified: trunk/src/whiteboard/manager.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.cpp?rev=52732&r1=52731&r2=52732&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.cpp (original)
+++ trunk/src/whiteboard/manager.cpp Sun Jan 22 00:16:12 2012
@@ -610,6 +610,8 @@
         * (This section has only one return path.)
         */
 
+       temp_move_unit_underlying_id_ = selected_unit->underlying_id();
+
        //@todo: May be appropriate to replace these separate components by a 
temporary
        //      wb::move object
 
@@ -686,6 +688,7 @@
        move_arrows_.clear();
        fake_units_.clear();
        route_.reset();
+       temp_move_unit_underlying_id_ = 0;
 }
 
 void manager::save_temp_move()
@@ -726,6 +729,11 @@
                LOG_WB << *viewer_actions() << "\n";
                print_help_once();
        }
+}
+
+unit_map::iterator manager::get_temp_move_unit() const
+{
+       return resources::units->find(temp_move_unit_underlying_id_);
 }
 
 void manager::save_temp_attack(const map_location& attacker_loc, const 
map_location& defender_loc, int weapon_choice)

Modified: trunk/src/whiteboard/manager.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.hpp?rev=52732&r1=52731&r2=52732&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.hpp (original)
+++ trunk/src/whiteboard/manager.hpp Sun Jan 22 00:16:12 2012
@@ -132,6 +132,8 @@
        /** Creates a move action for the current side, and erases the temp 
move.
         *  The move action is inserted at the end of the queue, to be 
executed last. */
        void save_temp_move();
+       /** @return an iterator to the unit that owns the temp move, 
resources::units->end() if there's none. */
+       unit_map::iterator get_temp_move_unit() const;
 
        /** Creates an attack or attack-move action for the current side */
        void save_temp_attack(const map_location& attacker_loc, const 
map_location& defender_loc, int weapon_choice);
@@ -225,6 +227,7 @@
 
        std::vector<arrow_ptr> move_arrows_;
        std::vector<fake_unit_ptr> fake_units_;
+       size_t temp_move_unit_underlying_id_;
 
        boost::scoped_ptr<CKey> key_poller_;
 




Related Messages


Powered by MHonArc, Updated Sun Jan 22 00:20:05 2012