ID:145372
 
Code:
mob
var
gs

verb
Capture(obj/X as obj in oview(1))
usr.gs + X
del(X)


Problem description:
When there is only one item in GS it works fine but if I try to Capture() twice i get runtime errors. Can someone please help on this
You're trying to make a second inventory?
mob/var/list/gs=list() // Make it a list!
mob/verb/Capture(obj/X in oview(1))
usr.gs.Add(X)


No reason to del? You pick it up and then delete it! o.O
In response to Mysame
Mysame wrote:
You're trying to make a second inventory?
> mob/var/list/gs=list() // Make it a list!
> mob/verb/Capture(obj/X in oview(1))
> usr.gs.Add(X)
>

No reason to del? You pick it up and then delete it! o.O

Better still:
mob/var/list/gs
mob/verb/Capture(obj/X in oview(1))
if(!usr.gs) usr.gs = new
usr.gs += X

Lummox JR
In response to Lummox JR
And we can't be forgetting to set X.loc to null also, since gs won't move the object like contents will. I expect that is probably why he was deleting it, because it was being left on the turf where he tried to take it from.