mail[Wesnoth-commits] r40369 - /trunk/src/unit.cpp


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

Header


Content

Posted by guillaume . melquiond on December 24, 2009 - 14:59:
Author: silene
Date: Thu Dec 24 14:59:27 2009
New Revision: 40369

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40369&view=rev
Log:
Fixed units not having random names.

Modified:
    trunk/src/unit.cpp

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=40369&r1=40368&r2=40369&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Thu Dec 24 14:59:27 2009
@@ -289,11 +289,13 @@
        }
 
        advance_to(type(), use_traits, state);
-       if (const unit_race *r = unit_types.find_race(cfg["race"])) {
-               race_ = r;
-       } else {
-               static const unit_race dummy_race;
-               race_ = &dummy_race;
+       if (cfg.has_attribute("race")) {
+               if (const unit_race *r = unit_types.find_race(cfg["race"])) {
+                       race_ = r;
+               } else {
+                       static const unit_race dummy_race;
+                       race_ = &dummy_race;
+               }
        }
        level_ = lexical_cast_default<int>(cfg["level"], level_);
        if(cfg["undead_variation"] != "") {




Related Messages


Powered by MHonArc, Updated Thu Dec 24 15:00:13 2009