xKiv
Active member
In light of my recent escapade which cost me over 50M meat, I would like to suggest the following safeguard for (all (two) variants of) put_shop:
If price is below minimum (i.e. below 100 or 2*autosell, whichever is higher), and it isn't 0 (which converts to the unsellable 999999999), abort with an error (or at the very least don't sell at minprice; selling at 999999999 might be fine), since it probably indicates that the code in question is passing parameters in the wrong order (like calling put_shop(quantity, price, item) instead of put_shop(price, 0, quantity, item), ehm [1]).
[1] more concrete example: I called put_shop(1, 0, item) thinking that it would sell 1 at price "0" (and convert to 999999999). But for mafia, this meant "at price 1" (convert to min-price) with limit 1/day.
If price is below minimum (i.e. below 100 or 2*autosell, whichever is higher), and it isn't 0 (which converts to the unsellable 999999999), abort with an error (or at the very least don't sell at minprice; selling at 999999999 might be fine), since it probably indicates that the code in question is passing parameters in the wrong order (like calling put_shop(quantity, price, item) instead of put_shop(price, 0, quantity, item), ehm [1]).
[1] more concrete example: I called put_shop(1, 0, item) thinking that it would sell 1 at price "0" (and convert to 999999999). But for mafia, this meant "at price 1" (convert to min-price) with limit 1/day.