var/sell_stock = input("Sell what?","Sell Stock") in sell
src << "Selling [sell_stock]"
var/position = src.stock.Find(sell_stock)
var/sell_amount = input("How much?", "How Much?") as num
if(sell_amount > src.amount[position])
src << "You don't have that much"
else
src.amount -= sell_amount
var/add_position = solace_stock.Find(sell_stock)
solace_amount_available[add_position] += sell_amount
src << "Sold [sell_amount] of [sell_stock]."
Problem description:
I can't seem to work out why this piece of code skips the selection part where you select an item from the list, and goes straight to the inputting of a number. I've tried everything I can to get it to work but no matter what I do it still just keeps skipping to the amount part.
Thanks in advance guys.
- GunRunner
I'm guessing that you're sell list is either empty or only has one item in it. If it has one item in it that item will automatically be selected.