On 15 May 2013, at 15:42, Andi Sidwell wrote:

>> -		/* Sell a few items */
>> -		stock = s->stock_num;
>> -		stock -= randint1(s->turnover);
>> -
>> -		/* Keep stock between specified min and max slots */
>> -		if (stock > max) stock = max;
>> -		if (stock < min) stock = min;
>> -
>> -		/* Destroy objects until only "j" slots are left */
>> -		while (s->stock_num > stock)
>> -			store_delete_random(s);
>> -
>> -
>> -		/** "Buy in" various items **/
>> +		/* this used to keep the always_num slots too, but now
>> +		 * staples are created after this phase, so that's not
>
>
> This change is wrong.  stock_{min|max} are about the amount of 
> randomly-chosen stock, not the amount of stock for the whole store.  
> Can you change this back and I'll pull?

I may be misunderstanding something. The intent of the change here is 
that, before I touched anything, the store was trying to keep a minimum 
of stock_min *plus* always_stock items, because it would have added the 
staples and wouldn't be willing to delete them. With the restructuring 
such that staples are added later, and can be deleted, I don't think 
always_num should be added here anymore.

-s