diff options
author | yexo <yexo@openttd.org> | 2009-02-11 00:48:15 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-02-11 00:48:15 +0000 |
commit | 8d252020672d44b8708128e5bcafb015897e3a15 (patch) | |
tree | 191e912509cb195a4b9143a11da495fad92944ee /src/ai/api/ai_industrytype.cpp | |
parent | 1eeb0f6748420003f20449c6f651b2b50d5c108e (diff) | |
download | openttd-8d252020672d44b8708128e5bcafb015897e3a15.tar.xz |
(svn r15441) -Cleanup: Use a return value instead of passing a pointer to where the result should be stored.
Diffstat (limited to 'src/ai/api/ai_industrytype.cpp')
-rw-r--r-- | src/ai/api/ai_industrytype.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ai/api/ai_industrytype.cpp b/src/ai/api/ai_industrytype.cpp index 095aaa45f..83d356a3c 100644 --- a/src/ai/api/ai_industrytype.cpp +++ b/src/ai/api/ai_industrytype.cpp @@ -56,7 +56,7 @@ const IndustrySpec *ins = ::GetIndustrySpec(industry_type); AIList *list = new AIList(); - for (int i = 0; i < 2; i++) { + for (size_t i = 0; i < lengthof(ins->produced_cargo); i++) { if (ins->produced_cargo[i] != CT_INVALID) list->AddItem(ins->produced_cargo[i], 0); } @@ -70,7 +70,7 @@ const IndustrySpec *ins = ::GetIndustrySpec(industry_type); AIList *list = new AIList(); - for (int i = 0; i < 3; i++) { + for (size_t i = 0; i < lengthof(ins->accepts_cargo); i++) { if (ins->accepts_cargo[i] != CT_INVALID) list->AddItem(ins->accepts_cargo[i], 0); } |