wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src unit.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src unit.cpp
Date: Sat, 22 Jan 2005 07:09:37 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    05/01/22 12:09:36

Modified files:
        src            : unit.cpp 

Log message:
        Added a canrecruit filter (see patch #3640).

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit.cpp.diff?tr1=1.119&tr2=1.120&r1=text&r2=text

Patches:
Index: wesnoth/src/unit.cpp
diff -u wesnoth/src/unit.cpp:1.119 wesnoth/src/unit.cpp:1.120
--- wesnoth/src/unit.cpp:1.119  Sat Jan 22 09:05:30 2005
+++ wesnoth/src/unit.cpp        Sat Jan 22 12:09:36 2005
@@ -1,4 +1,4 @@
-/* $Id: unit.cpp,v 1.119 2005/01/22 09:05:30 silene Exp $ */
+/* $Id: unit.cpp,v 1.120 2005/01/22 12:09:36 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -485,6 +485,7 @@
        const std::string& role = cfg["role"];
        const std::string& race = cfg["race"];
        const std::string& gender = cfg["gender"];
+       const std::string& canrecruit = cfg["canrecruit"];
 
        if(description.empty() == false && description != 
this->underlying_description()) {
                return false;
@@ -564,6 +565,9 @@
                return false;
        }
 
+       if (canrecruit.empty() == false && (canrecruit == "1") != can_recruit())
+               return false;
+
        //if there are [not] tags below this tag, it means that the filter
        //should not match if what is in the [not] tag does match
        const config::child_list& negatives = cfg.get_children("not");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]