Remove various uses of lengthof on std::array
This commit is contained in:
@@ -29,7 +29,7 @@ ScriptCargoList_IndustryAccepting::ScriptCargoList_IndustryAccepting(IndustryID
|
||||
if (!ScriptIndustry::IsValidIndustry(industry_id)) return;
|
||||
|
||||
Industry *ind = ::Industry::Get(industry_id);
|
||||
for (uint i = 0; i < lengthof(ind->accepts_cargo); i++) {
|
||||
for (size_t i = 0; i < ind->accepts_cargo.size(); i++) {
|
||||
CargoID cargo_id = ind->accepts_cargo[i];
|
||||
if (cargo_id != INVALID_CARGO) {
|
||||
this->AddItem(cargo_id);
|
||||
@@ -42,7 +42,7 @@ ScriptCargoList_IndustryProducing::ScriptCargoList_IndustryProducing(IndustryID
|
||||
if (!ScriptIndustry::IsValidIndustry(industry_id)) return;
|
||||
|
||||
Industry *ind = ::Industry::Get(industry_id);
|
||||
for (uint i = 0; i < lengthof(ind->produced_cargo); i++) {
|
||||
for (size_t i = 0; i < ind->produced_cargo.size(); i++) {
|
||||
CargoID cargo_id = ind->produced_cargo[i];
|
||||
if (cargo_id != INVALID_CARGO) {
|
||||
this->AddItem(cargo_id);
|
||||
|
@@ -97,7 +97,7 @@ ScriptTileList_IndustryAccepting::ScriptTileList_IndustryAccepting(IndustryID in
|
||||
CargoArray acceptance = ::GetAcceptanceAroundTiles(cur_tile, 1, 1, radius);
|
||||
{
|
||||
bool cargo_accepts = false;
|
||||
for (byte j = 0; j < lengthof(i->accepts_cargo); j++) {
|
||||
for (size_t j = 0; j < i->accepts_cargo.size(); j++) {
|
||||
if (i->accepts_cargo[j] != INVALID_CARGO && acceptance[i->accepts_cargo[j]] != 0) cargo_accepts = true;
|
||||
}
|
||||
if (!cargo_accepts) continue;
|
||||
|
Reference in New Issue
Block a user