ID:266366
 
It gives me this error...
runtime error: bad del
proc name: GiveItem (/mob/pc/verb/GiveItem)
source file: SnowyHill.dm,27
usr: Troy (/mob/pc/Snow_Lords)
src: Troy (/mob/pc/Snow_Lords)
call stack:
Troy (/mob/pc/Snow_Lords): GiveItem(IronSword (/obj/Swords/IronSword))




mob/pc
verb/GiveItem(obj/O as obj in src.contents)
for(var/mob/M as mob in oview(1))
M.contents+=O
del(O in src.contents)
return
usr <<"There is no unit to give this to!"
return
The weird thing it does what I want it to just fine...
In response to Jon Snow
Change del(O in src.contents) to just del(O)

tell me if that works.


-Rcet

[edit]
on second thought, you dont need that. Only if you created a new obj in M's contents.
In response to Jon Snow
Just delete the del(O in src.contents)... which I don't believe would work anyway. You don't need to delete anything, because you aren't creating a new() obj to replace it with, you are referencing an already existing object, and moving it from one mobs contents to another.
In response to Rcet
oops...
ok thanks guys :)
In response to Jon Snow
You could even O.Move(M.contents)
In response to Nadrew
howcome when I put M.contents += new O
it gave me an error saying it cannot create (whatever object it was)

just curious, that's what I put first time I tried it.
In response to Jon Snow
try new O.type?