It's suppose to: Drop the object in usr.loc (as shown), and the little item that shows up on my onscreen inventory(the pants), should be deleted.
obj/items/pants/black
icon = 'pants-black.dmi'
icon_state = "show"
layer=MOB_LAYER+10
var/wearing = 0
verb/Get()
set src in oview(1)
set category="Item"
Move(usr)
usr.contents += src
usr.refeshing()
Click()
switch(alert("What do you want to do?",,"Wear","Drop","Cancel"))
if("Wear")
if(src.wearing==0)
src.wearing=1
usr.overlays+='pants-black.dmi'
usr<<"You wear the [src]"
else
src.wearing=0
usr.overlays -= 'pants-black.dmi'
usr<<"You remove the [src]"
if("Drop")
if(src.wearing == 1)
src<<"<b>You're wearing the clothes."
return
else
set src in usr
var/deleted=0
while(deleted<=0)
for(var/obj/O in usr.contents)
if(O==src)
O.Move(usr.loc)
deleted=1
for(var/obj/items/F in usr.client.screen)
del(F)
usr.refeshing()
for(var/obj/background/BG in usr.client.screen)
del(BG)
usr << "You drop [src]."
if("Cancel")
return
Problem: When the player is suppose to drop the pants, it slows down movement dramatically, doesn't delete the content, and I get error:
If it is not an infinite loop, either do 'set background=1' or set world.loop_checks=0.
proc name: Click (/obj/items/pants/black/Click)
usr: Camaro (/mob/player/Dark)
src: the black (/obj/items/pants/black)
call stack:
the black (/obj/items/pants/black): Click(the carpet (1,12,3) (/turf/carpet))
I tried to put detail into this, because I'd really like help. Thank you :)
-Camaro-
should it be >=0?
woah.. >=0 is a mad face AND it checks if a var is greater than or equal to 0. COOL!