(svn r13724) [NoAI] -Fix r13723: in this modern world with all those checks and warnings GCC can give when ever I not ask him to, it fails to see the simplest of all, 'if (cargo_id == cargo_id)'.. makes you wonder, doesn't it? Well, such is life, wondering wondering wandering .. Status Quo, Yeah! Oh yeah, what was I doing ... ah, yes: don't compare one variable with itself, it is always true.. Obiwan by Yexo. (Yexo) noai
authortruebrain
Fri, 18 Jul 2008 01:00:03 +0000
branchnoai
changeset 11166 17960948c3af
parent 11165 a725845fcc01
child 11167 9f636bd0ff2d
(svn r13724) [NoAI] -Fix r13723: in this modern world with all those checks and warnings GCC can give when ever I not ask him to, it fails to see the simplest of all, 'if (cargo_id == cargo_id)'.. makes you wonder, doesn't it? Well, such is life, wondering wondering wandering .. Status Quo, Yeah! Oh yeah, what was I doing ... ah, yes: don't compare one variable with itself, it is always true.. Obiwan by Yexo. (Yexo)
src/ai/api/ai_industry.cpp
--- a/src/ai/api/ai_industry.cpp	Fri Jul 18 00:15:14 2008 +0000
+++ b/src/ai/api/ai_industry.cpp	Fri Jul 18 01:00:03 2008 +0000
@@ -74,8 +74,8 @@
 
 	Industry *ind = ::GetIndustry(industry_id);
 	for (uint i = 0; i < lengthof(ind->produced_cargo); i++) {
-		CargoID cargo_id = ind->produced_cargo[i];
-		if (cargo_id == cargo_id) {
+		CargoID cid = ind->produced_cargo[i];
+		if (cid == cargo_id) {
 			return ind->produced_cargo_waiting[i];
 		}
 	}