Closed KroArtem closed 8 years ago
Thanks for the report :)
The game checks whether there is enough stock when the command is given to buy the item, while it subtracts from the stock after the action of the building producing the item is finished. So this probably happened because of clicking the button very fast. And once the values went into the negative, the check didn't work properly anymore (it prevented from buying the item if the stock were equal to zero, so a negative stock would allow purchasing).
I've made it so the production of the item aborts if for some reason the building lacks the stock when actually producing it, and I've also improved the other check to prevent the item buying command to work if the stock is equal to or below zero.
https://github.com/Andrettin/Wyrmgus/commit/35d8fb0f39255b483f6e4ce7f62a0f49a88f4a5c
When I was already killed (no moving units, only buildings) I tried to produce cheese and carrots and it is possible to get negative values.