RecipeVendor
icon = 'vendor1.dmi'
density = 1
DblClick()
var/mob/player/M
for(M as mob in get_step(src,src.dir))
usr.nomotion=1
switch(input("Varsuvio: Nyeh. Welcome to me store, young whippersnapper.","")in list("Buy","Sell","Leave"))
if("Buy")
var/Buying = input("What would you like?")in list("Make Lumber Recipe (500GP)","Leave")
if(Buying == "Make Lumber Recipe (500GP)")
if(usr.gold >= 500)
usr.gold -= 500
new/obj/recipes/MakeLumberRecipe(usr)
usr<<"You have purchased a Make Lumber recipe!"
usr.nomotion=0
else
usr.nomotion=0
if("Sell")
for(var/obj/recipes/O in usr)
if(locate(O) in usr)
switch(alert("Are you sure you want to sell [O] for [O.price] gold?","Selling","Yes","No"))
if("Yes")
usr.gold += O.price
usr<<"You have sold your [O] for [O.price]"
del(O)
usr.nomotion=0
else
usr.nomotion=0
else
usr << "You don't have anything to sell!"
usr.nomotion=0
else
usr.nomotion=0
Problem description: Everything aside from the fact that if there's nothing in usr to sell, it doesn't set usr's nomotion to 0, is okay.
That's because, "nomotion=0" is under the loop. If there's nothing to loop through - then the loop won't even begin.