Dropped() question

How, what and why to code in BYOND.
Post Reply
User avatar
Drynwyn
Joined: Fri Apr 18, 2014 5:09 pm
Byond Username: Drynwyn

Dropped() question

Post by Drynwyn » #4489

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?
In game, I play the A.I Firmware, the French cyborg C.U.R.I.E, Aubrie Allen, and the lizard scum Skulks-Through-Maintenance.
User avatar
Remie Richards
Joined: Thu Apr 17, 2014 7:11 pm
Byond Username: CrimsonVision
Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
Contact:

Re: Dropped() question

Post by Remie Richards » #4508

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.
私は完璧
User avatar
Drynwyn
Joined: Fri Apr 18, 2014 5:09 pm
Byond Username: Drynwyn

Re: Dropped() question

Post by Drynwyn » #4861

That's exactly what I needed. Thanks!
In game, I play the A.I Firmware, the French cyborg C.U.R.I.E, Aubrie Allen, and the lizard scum Skulks-Through-Maintenance.
Post Reply

Who is online

Users browsing this forum: No registered users