If atom.overlays contains two or more identical items and we try to remove any one of them using the .Cut proc it always removes the last one instead (as if we used -=).
Numbered Steps to Reproduce Problem:
1.) Execute the code below.
2.) Note that the second instance of A got removed from overlays instead of the first one.
Code Snippet (if applicable) to Reproduce Problem:
proc/main()
var/obj/O = new
var/image/A = new/image{layer=1}
var/image/B = new/image{layer=2}
O.overlays += A
O.overlays += B
O.overlays += A
print_overlays(O)
O.overlays.Cut(1,2)
print_overlays(O)
proc/print_overlays(atom/A)
. = list()
for(var/image/I as anything in A.overlays)
. += ref(I.appearance)
world.log << jointext(., " ")
Expected Results:
[0x3a000002] [0x3a000003] [0x3a000002]
[0x3a000003] [0x3a000002]
Actual Results:
[0x3a000002] [0x3a000003] [0x3a000002]
[0x3a000002] [0x3a000003]
Does the problem occur:
Every time? Or how often?Every time
In other games?N/A
In other user accounts?N/A
On other computers?N/A
When does the problem NOT occur?
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Workarounds: