Author: alink
Date: Mon Jun 16 23:19:44 2008
New Revision: 27233

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27233&view=rev
Log:
Fix missing default portrait in dialogs (bug reported by Shadow_Master)

Modified:
    trunk/src/unit.cpp

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=27233&r1=27232&r2=27233&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Mon Jun 16 23:19:44 2008
@@ -481,21 +481,18 @@
                cfg_.merge_with(t->movement_type().get_parent()->get_cfg());
        }
        // If unit has specific profile, remember it and keep it after advancing
-       bool specific_profile = false;
-       std::string profile;
-       if (type() != NULL)
-       {
-               specific_profile = (cfg_["profile"] != 
type()->get_gender_unit_type(gender_).get_variation(variation_).cfg_["profile"]);
-
-               if (specific_profile)
-               {
-                       profile = cfg_["profile"];
-               }
-       }
+       std::string specific_profile;
+       if (type() != NULL)     {
+               const std::string profile = cfg_["profile"];
+               if (!profile.empty() &&
+                               profile != 
type()->get_gender_unit_type(gender_).get_variation(variation_).cfg_["profile"]){
+                       specific_profile = profile;
+               }
+       }
+
        cfg_.merge_with(t->cfg_);
-       if (specific_profile)
-       {
-       cfg_["profile"] = profile;
+       if (!specific_profile.empty()) {
+               cfg_["profile"] = specific_profile;
        }
        cfg_.clear_children("male");
        cfg_.clear_children("female");


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

Reply via email to