Page 1 of 1

Dropped() question

Posted: Thu May 08, 2014 1:54 pm
by Drynwyn
Let's say I have code that runs like so:

Obj/item/Urist/dropped()
Check for the presence of Urist in the jumpsuit slot


If the removal of Urist from the jumpsuit slot triggere the call to dropped, will the check return true or false?

Re: Dropped() question

Posted: Thu May 08, 2014 3:02 pm
by Remie Richards
Without looking (I'll look in a sec and stick an Edit)

I'd Say it'd return false.
I'm fairly certain an item's dropped() is always called immediately after it is removed/dropped.

EDIT:

All drop procs filter down to unEquip:

Code: Select all

/mob/proc/unEquip(obj/item/I, force) //Force overrides NODROP for things like wizarditis and admin undress.
	if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP.
		return 1

	if((I.flags & NODROP) && !force)
		return 0

	if(I == r_hand)
		r_hand = null
		update_inv_r_hand()
	else if(I == l_hand)
		l_hand = null
		update_inv_l_hand()

	if(I)
		if(client)
			client.screen -= I
		I.loc = loc
		I.dropped(src)
		if(I)
			I.layer = initial(I.layer)
	return 1
Which changes the item's Loc and then calls dropped()

Not sure if this is what you meant though.

Re: Dropped() question

Posted: Sat May 10, 2014 4:29 am
by Drynwyn
That's exactly what I needed. Thanks!