ID:1843479
 
BYOND Version:507.1283
Operating System:Windows 10 Pro Technical Preview - Build 10074
Web Browser:
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:I added an object overlay to characters to display their name in my game and even though the object has no icon_state and a null icon_state isn't in my file, it's displaying using my characters icon_state instead.

Numbered Steps to Reproduce Problem:1.Create a new project with the snippet below.
2.Create the icon file and make sure you don't have a null/un-named icon_state in the file.
3.Create a map file, 11x11 is a good enough size.
4.Run the project and see that the object has no icon_state, it does have an icon but since there's no blank icon_state there nothing should be displayed except the maptext. (THIS IS WHERE IT'S BUGGED, the object added as an overlay is displayed using the same icon_state defined for the mob, but only when the icon_state is null.)

Code Snippet (if applicable) to Reproduce Problem:
mob
icon='Testing Environment.dmi'
icon_state="Player"
Login()
..()
loc=locate(6,6,1)
var/obj/a=new
if(a.icon_state)
a.maptext="<b><center>[a.icon] + [a.icon_state]</center></b>"
else
a.maptext="<b><center>[a.icon] + ERROR: No Icon State</center></b>"
a.layer=layer+1
a.maptext_width=352
a.pixel_x=-160
overlays+=a
obj
icon='Testing Environment.dmi'
turf
icon='Testing Environment.dmi'
icon_state="Grass"


Expected Results:The maptext alone will be displayed since there is no null icon state in 'Testing Environment.dmi'

Actual Results:It's inheriting/displaying with the players icon_state.

Does the problem occur:
Every time? Or how often?Every Time
In other games?Yes
In other user accounts?Yes
On other computers?Yes

When does the problem NOT occur?See work-arounds below.

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.)
Tested all the way back to 468.1072 and it always does this.

Workarounds:
Set the icon to null or the icon_state to something besides null such as "This_Is_A_Fake_Icon_State"

NOTE: Maptext has nothing to do with this bug at all, I even had to get rid of the use of maptext as I did testing so far back because I went back to the pre-maptext era, but it still bugs even that far back.
This is actually intentional behavior (null icons/states are supposed to fall back on the parent), but I think it'd be wise to change it when maptext is in play.
In response to Lummox JR
OK, well I didn't think it'd have been intentional but the icon isn't falling back at all, just the state.

And yea, when maptext is involved the behavior isn't ideal.

Also it doesn't fall back either state or icon when adding objects to the clients screen, it only does anything on underlays/overlays.
In response to Superbike32
Superbike32 wrote:
Also it doesn't fall back either state or icon when adding objects to the clients screen, it only does anything on underlays/overlays.

Right, because when it's on client.screen it is the parent object, not an overlay/underlay.