[Wesnoth-commits] r10079 - /trunk/src/unit_types.cpp (February 13, 2006 - 01:32)

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

 

Author: noyga
Date: Mon Feb 13 01:32:11 2006
New Revision: 10079

URL: http://svn.gna.org/viewcvs/wesnoth?rev=10079&view=rev
Log:
Abilities filters now support multiple aliased terrains
This should make ambush working in snow forests

Modified:
    trunk/src/unit_types.cpp

Modified: trunk/src/unit_types.cpp
URL: http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_types.cpp?rev=10079&r1=10078&r2=10079&view=diff
==============================================================================
--- trunk/src/unit_types.cpp (original)
+++ trunk/src/unit_types.cpp Mon Feb 13 01:32:11 2006
@@ -509,7 +509,12 @@
 	if (terrain_filter->empty()) {
 		return true;
 	} else {
-		return std::find(terrain_filter->begin(),terrain_filter->end(),terrain) != terrain_filter->end();
+		for (std::string::const_iterator i = terrain.begin(); i != terrain.end(); ++i) {
+			std::string t(1,*i);
+			if (std::find(terrain_filter->begin(),terrain_filter->end(),t) != terrain_filter->end())
+				return true;
+		}
+		return false;
 	}
 }
 



Related Mails




Powered by MHonArc, Updated Mon Feb 13 02:00:17 2006