ini_inv_mkobj_filter() bit
The try count of 1000 is never going to be reached. The obj result, if it were ever to be reached, would have been unfiltered and potentially incorrect. There is no harm in having the result, in that theoretical edge case, not be one of the obj values that was intended to be filtered out. No practical change results from this, and pancake was used because it is innocuous.
This commit is contained in:
@@ -1074,10 +1074,13 @@ ini_inv_mkobj_filter(int oclass, boolean got_level1_spellbook)
|
||||
|| restricted_spell_discipline(otyp)))
|
||||
|| otyp == SPE_NOVEL) {
|
||||
dealloc_obj(obj);
|
||||
if (++trycnt > 1000) {
|
||||
/* not expected to be reached */
|
||||
obj = mksobj(PANCAKE, TRUE, FALSE);
|
||||
break;
|
||||
}
|
||||
obj = mkobj(oclass, FALSE);
|
||||
otyp = obj->otyp;
|
||||
if (++trycnt > 1000)
|
||||
break;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user