Added code to ensure items always have a sell cost < infinity

The largest possible number in Javascript is about 1.797e+308, this is the constant Number.MAX_VALUE, anything beyond this is simply identified as infinite. The inserted code checks if get_item_last_cost equals infinity, and if it does, it changes the cst value to Number.MAX_VALUE.

This will hopefully help avoid a lot of butthurt from the new formula being introduced.