(svn r10419) -Fix (r10418): do not compare bitmasks with HASBIT. Thanks to Maedhros for spotting this.
authorrubidium
Tue, 03 Jul 2007 19:25:06 +0000
changeset 7145 0bb6d7c2de2f
parent 7144 8e73641511f3
child 7146 0e8ef75fc9d9
(svn r10419) -Fix (r10418): do not compare bitmasks with HASBIT. Thanks to Maedhros for spotting this.
src/industry_cmd.cpp
--- a/src/industry_cmd.cpp	Tue Jul 03 19:16:34 2007 +0000
+++ b/src/industry_cmd.cpp	Tue Jul 03 19:25:06 2007 +0000
@@ -1624,7 +1624,7 @@
 
 	if (indspec->life_type == INDUSTRYLIFE_BLACK_HOLE) return;
 
-	if (HASBIT(indspec->life_type, INDUSTRYLIFE_ORGANIC) || HASBIT(indspec->life_type, INDUSTRYLIFE_EXTRACTIVE)) {
+	if ((indspec->life_type & (INDUSTRYLIFE_ORGANIC | INDUSTRYLIFE_EXTRACTIVE)) != 0) {
 		for (j = 0; j < 2 && indspec->produced_cargo[j] != CT_INVALID; j++){
 			uint32 r = Random();
 			int old_prod, new_prod, percent;
@@ -1666,7 +1666,7 @@
 		}
 	}
 
-	if (HASBIT(indspec->life_type, INDUSTRYLIFE_PROCESSING)) {
+	if ((indspec->life_type & INDUSTRYLIFE_PROCESSING) != 0) {
 		if ((byte)(_cur_year - i->last_prod_year) < 5 || !CHANCE16(1, 180)) closeit = false;
 	}