var/origin
New()
origin=loc
..()
proc
respawn()
var/oldloc = origin
spawn(respawnTime)
var/obj/clone = new type
clone.loc = oldloc
Problem description:
When a player takes an object it is supposed to respawn but there are strange happenings. Objects will duplicate in the inventory or not respawn at all
This is because, for the clone, origin is being set to null because New() occurs before the line "clone.loc = oldloc" and you're creating the "new type" without an initial location.