ID:1067753
 
(See the best response by Kaiochao.)
I'm not sure how what I want to do is usually referred to, but here's an example:

/mob
var/obj/myobj = null

/mob/proc/drop(obj/O)
if(!O) return
O.loc = src.loc
O = null

/mob/verb/drop_my_item()
drop(myobj)


When the drop_my_item() verb is called, the desired behaviour is for myobj.loc to be set to src.loc, and for myobj to be set to null.

Obviously this doesn't happen. Again, I'm not sure of the term, but I want to set the referenced var via the reference.

I've simplified this example, so please don't suggest that I merge drop() and drop_my_item(). :)
Best response
The variables are different, even though their values are the same. You'd have to actually set "myobj = null" somewhere.
//  e.g.
mob/proc/drop(obj/O)
if(O == myobj)
myobj = null
etc.

// or
mob/verb/drop_my_item()
drop(myobj)
myobj = null