production code for item I_NONE. This tries to put products into
vec[I_NONE]. Until item.h rev. 1.12, vec[I_NONE] was unused and zero,
so it worked. Since then, it's a subscript out of bounds, clobbering
two bytes of stack. The (unpredictable) stack contents could make the
code believe that there's not enough space for the `products', which
then reduced predicted production, typically to zero.
* Adjust produced amount by commodity production ratio
*/
output = material_consume * prodeff;
* Adjust produced amount by commodity production ratio
*/
output = material_consume * prodeff;
- if (item == I_NONE && !player->simulation) {
- levels[sp->sct_own][product->p_level] += output;
- wu((natid)0, sp->sct_own, "%s (%.2f) produced in %s\n",
- product->p_name, output, ownxy(sp));
+ if (item == I_NONE) {
+ if (!player->simulation) {
+ levels[sp->sct_own][product->p_level] += output;
+ wu((natid)0, sp->sct_own, "%s (%.2f) produced in %s\n",
+ product->p_name, output, ownxy(sp));
+ }
} else {
if ((actual = roundavg(output)) <= 0)
return 0;
} else {
if ((actual = roundavg(output)) <= 0)
return 0;