mail[Wesnoth-commits] r37034 - in /trunk/src: ./ ai/default/


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

Header


Content

Posted by guillaume . melquiond on July 19, 2009 - 10:40:
Author: silene
Date: Sun Jul 19 10:40:11 2009
New Revision: 37034

URL: http://svn.gna.org/viewcvs/wesnoth?rev=37034&view=rev
Log:
Removed unused field from attack_type.

Modified:
    trunk/src/actions.cpp
    trunk/src/ai/default/contexts.cpp
    trunk/src/attack_prediction_display.cpp
    trunk/src/unit_abilities.cpp
    trunk/src/unit_types.cpp
    trunk/src/unit_types.hpp

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=37034&r1=37033&r2=37034&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Sun Jul 19 10:40:11 2009
@@ -710,9 +710,9 @@
 
        // Get the weapon characteristics, if any.
        if (weapon) {
-               weapon->set_specials_context(*aloc, *dloc, &units, 
resources::game_map, resources::tod_manager, resources::teams, attacking, 
opp_weapon);
+               weapon->set_specials_context(*aloc, *dloc, units, attacking, 
opp_weapon);
                if (opp_weapon)
-                       opp_weapon->set_specials_context(*aloc, *dloc, 
&units, resources::game_map, resources::tod_manager, resources::teams, 
!attacking, weapon);
+                       opp_weapon->set_specials_context(*aloc, *dloc, units, 
!attacking, weapon);
                slows = weapon->get_special_bool("slow");
                drains = weapon->get_special_bool("drains") && 
!utils::string_bool(opp.get_state("not_living"));
                petrifies = weapon->get_special_bool("petrifies");

Modified: trunk/src/ai/default/contexts.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai/default/contexts.cpp?rev=37034&r1=37033&r2=37034&view=diff
==============================================================================
--- trunk/src/ai/default/contexts.cpp (original)
+++ trunk/src/ai/default/contexts.cpp Sun Jul 19 10:40:11 2009
@@ -292,8 +292,7 @@
                bool backstab = false, slow = false;
                std::vector<attack_type>& attacks = 
unit_itor->second.attacks();
                for(std::vector<attack_type>::iterator a = attacks.begin(); a 
!= attacks.end(); ++a) {
-                       a->set_specials_context(map_location(),map_location(),
-                                                                             
                                          
&units_,&map_,&get_info().tod_manager_,&teams_,true,NULL);
+                       a->set_specials_context(map_location(), 
map_location(), units_, true, NULL);
                        if(a->get_special_bool("backstab")) {
                                backstab = true;
                        }

Modified: trunk/src/attack_prediction_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/attack_prediction_display.cpp?rev=37034&r1=37033&r2=37034&view=diff
==============================================================================
--- trunk/src/attack_prediction_display.cpp (original)
+++ trunk/src/attack_prediction_display.cpp Sun Jul 19 10:40:11 2009
@@ -155,7 +155,7 @@
 
                // Set specials context (for safety, it should not have 
changed normally).
                const attack_type *weapon = stats.weapon;
-               weapon->set_specials_context(u_loc, opp_loc, 
resources::units, resources::game_map, resources::tod_manager, 
resources::teams, stats.is_attacker, opp_weapon);
+               weapon->set_specials_context(u_loc, opp_loc, 
*resources::units, stats.is_attacker, opp_weapon);
 
                // Get damage modifiers.
                unit_ability_list dmg_specials = 
weapon->get_specials("damage");

Modified: trunk/src/unit_abilities.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_abilities.cpp?rev=37034&r1=37033&r2=37034&view=diff
==============================================================================
--- trunk/src/unit_abilities.cpp (original)
+++ trunk/src/unit_abilities.cpp Sun Jul 19 10:40:11 2009
@@ -741,16 +741,11 @@
        return false;
 }
 void attack_type::set_specials_context(const map_location& aloc,const 
map_location& dloc,
-                              const unit_map* unitmap,
-                                                         const gamemap* map, 
const tod_manager* tod_mng,
-                                                         const 
std::vector<team>* teams, bool attacker,const attack_type* other_attack) const
+       const unit_map &unitmap, bool attacker, const attack_type 
*other_attack) const
 {
        aloc_ = aloc;
        dloc_ = dloc;
-       unitmap_ = unitmap;
-       map_ = map;
-       tod_manager_ = tod_mng;
-       teams_ = teams;
+       unitmap_ = &unitmap;
        attacker_ = attacker;
        other_attack_ = other_attack;
 }
@@ -760,8 +755,6 @@
        aloc_ = loc;
        dloc_ = dloc;
        unitmap_ = un.units_;
-       map_ = resources::game_map;
-       teams_ = resources::teams;
        attacker_ = attacker;
        other_attack_ = NULL;
 }

Modified: trunk/src/unit_types.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_types.cpp?rev=37034&r1=37033&r2=37034&view=diff
==============================================================================
--- trunk/src/unit_types.cpp (original)
+++ trunk/src/unit_types.cpp Sun Jul 19 10:40:11 2009
@@ -44,9 +44,6 @@
        dloc_(),
        attacker_(false),
        unitmap_(NULL),
-       map_(NULL),
-       tod_manager_(NULL),
-       teams_(NULL),
        other_attack_(NULL),
        cfg_(cfg),
        description_(cfg["description"]),

Modified: trunk/src/unit_types.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_types.hpp?rev=37034&r1=37033&r2=37034&view=diff
==============================================================================
--- trunk/src/unit_types.hpp (original)
+++ trunk/src/unit_types.hpp Sun Jul 19 10:40:11 2009
@@ -59,9 +59,7 @@
        std::vector<t_string> special_tooltips(bool force=false) const;
        std::string weapon_specials(bool force=false) const;
        void set_specials_context(const map_location& aloc,const 
map_location& dloc,
-                              const unit_map* unitmap,
-                                                         const gamemap* map, 
const tod_manager* tod_mng,
-                                                         const 
std::vector<team>* teams,bool attacker,const attack_type* other_attack) const;
+               const unit_map &unitmap, bool attacker, const attack_type 
*other_attack) const;
        void set_specials_context(const map_location& loc,const map_location& 
dloc, const unit& un, bool attacker =true) const;
 
        bool has_special_by_id(const std::string& special) const;
@@ -77,9 +75,6 @@
        mutable map_location aloc_,dloc_;
        mutable bool attacker_;
        mutable const unit_map* unitmap_;
-       mutable const gamemap* map_;
-       mutable const tod_manager* tod_manager_;
-       mutable const std::vector<team>* teams_;
        mutable const attack_type* other_attack_;
        /*
         * cfg: a weapon special WML structure




Related Messages


Powered by MHonArc, Updated Sun Jul 19 12:01:06 2009