ID:2964212
 
BYOND Version:515
Operating System:Windows 11 Pro
Web Browser:Chrome 133.0.0.0
Applies to:Dream Maker
Status: Deferred

This issue may be low priority or very difficult to fix, and has been put on the back burner for the time being.
Descriptive Problem Summary:
mutable_appearances can not have overlays removed properly. Adding overlays works fine so this should be a valid bug.

Code Snippet (if applicable) to Reproduce Problem:
mob/verb/TestIcon1()
overlays += 'test.dmi'
sleep(5)
overlays -= 'test.dmi'

mob/verb/TestIcon2()
overlays += 'test.dmi'
sleep(5)
var/mutable_appearance/ma = new(src)
ma.overlays -= 'test.dmi'
appearance = ma


Expected Results:
TestIcon1() and TestIcon2() should remove the test.dmi icon from the overlays.

Actual Results:
TestIcon1() removes the test.dmi icon from the overlays.
TestIcon2() does NOT remove the test.dmi icon from the overlays.
Lummox JR changed status to 'Test case needed'
I need a test case. If a snippet includes icon references then it isn't sufficient on its own. I need a project to be sure we're on the same page.
Apologies, the test case has been sent on discord as I did not see a way to upload here.
Okay, I took a look into this and it turns out to be actually really tricky to fix. Here's what's going on:

When an object/icon/state is added to an overlays list, it gets converted to an appearance. The same happens if a mutable appearance's overlays list is finalized. Creating a mutable appearance and reading the overlays list creates a temporary list(), which is what you're subtracting from, but you're subtracting an icon from a list of appearances. The icon itself isn't in that list, hence the list doesn't get changed.

I don't know yet how to go about solving this problem. It's not simple. The workaround you can do is to create a temporary object and give it the icon as an overlay, and subtract that object's overlays from the mutable appearance's overlays. Then you're subtracting a resolved appearance from a list of resolved appearances.
Lummox JR changed status to 'Deferred'

Login to reply.