mirror of https://github.com/OpenTTD/OpenTTD
(svn r6059) -Fix(r6049): FOR_ALL was not use to not skip invalid items, so really don't skip invalid items :)
parent
93d5b5a355
commit
7fcc1ec40c
4
engine.c
4
engine.c
|
@ -459,7 +459,7 @@ static void EngineRenewPoolNewBlock(uint start_item)
|
||||||
|
|
||||||
/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
|
/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
|
||||||
* TODO - This is just a temporary stage, this will be removed. */
|
* TODO - This is just a temporary stage, this will be removed. */
|
||||||
for (er = GetEngineRenew(start_item); er != NULL; er = (er->index + 1 < GetEngineRenewPoolSize()) ? GetEngineRenew(er->index + 1) : NULL) if (er->from != INVALID_ENGINE) {
|
for (er = GetEngineRenew(start_item); er != NULL; er = (er->index + 1 < GetEngineRenewPoolSize()) ? GetEngineRenew(er->index + 1) : NULL) {
|
||||||
er->index = start_item++;
|
er->index = start_item++;
|
||||||
er->from = INVALID_ENGINE;
|
er->from = INVALID_ENGINE;
|
||||||
}
|
}
|
||||||
|
@ -472,7 +472,7 @@ static EngineRenew *AllocateEngineRenew(void)
|
||||||
|
|
||||||
/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
|
/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
|
||||||
* TODO - This is just a temporary stage, this will be removed. */
|
* TODO - This is just a temporary stage, this will be removed. */
|
||||||
for (er = GetEngineRenew(0); er != NULL; er = (er->index + 1 < GetEngineRenewPoolSize()) ? GetEngineRenew(er->index + 1) : NULL) if (er->from != INVALID_ENGINE) {
|
for (er = GetEngineRenew(0); er != NULL; er = (er->index + 1 < GetEngineRenewPoolSize()) ? GetEngineRenew(er->index + 1) : NULL) {
|
||||||
if (IsValidEngineRenew(er)) continue;
|
if (IsValidEngineRenew(er)) continue;
|
||||||
|
|
||||||
er->to = INVALID_ENGINE;
|
er->to = INVALID_ENGINE;
|
||||||
|
|
Loading…
Reference in New Issue