var/N1 = 0
for(var/obj/Items/Stick/I in usr)
if(!N1) del(I)
N1++
Is there a better way to just delete 1? Or is this correct.
ID:265574
![]() May 4 2006, 9:01 am (Edited on May 4 2006, 9:47 am)
|
|
Ok to delete 1 of a certain item in my inventory I am currently doing something like this.
var/N1 = 0 Is there a better way to just delete 1? Or is this correct. |
Papoose wrote:
Silly rabbit! > var/obj/item/I = locate() in usr I'm a bit rusty on the matter, but I do believe that should do. Make sure you check that 'I' actually exists! Also, a break in the for() loop would've worked as well. |
Does that even work? By the looks of it, it appears that the object type has to be the first thing in your contents, since your variable increments on the first iteration and is no longer false by the second.
|
Silly rabbit!
I'm a bit rusty on the matter, but I do believe that should do.