First off, here's the problem code:
obj/container/chest
verb
put(obj/O as obj in usr.contents)
set name = "Put"
set src in view(1)
if(O.Move(src.contents))
usr << "You put the [O.alt] in the [src.name]."
oview() << "[usr.name] puts \a [O.alt] in the [src.name]."
else
usr << "You cannot put the [O.alt] in the [src.name]."
Now, I can't figure out why but whenever I use the put verb to try to put something into the chest, it always returns the "else", and I can't figure out what's preventing it from going in. It's probably just a dumb overlook on my part, but if anyone can spot it for me or show me what I did wrong I'd appreciate it.
ID:180164
Aug 14 2001, 12:12 pm
|
|
Air Mapster wrote:
Foomer wrote: Hey, it works too! I just feel more and more ignorant every day :o) Good to know. Thanks. | |
Here's the problem. You want to have O.Move(src). Things can only be moved into atoms (Area/Turf/Obj/Mob). src.contents is a list, not an atom. I can see how you thought you could do that since once the object is moved in there, it shows up in the contents list. You can add something to the contents list, but you can't move something into it that way.