ID:2208789
 
Not a bug
BYOND Version:511.1368
Operating System:Windows 7 Home Basic 64-bit
Web Browser:Chrome 55.0.2883.87
Applies to:DM Language
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:
If you use a mutable appearance as an overlay, it will ignore the dir unless the dir if the mutable_appearance has one specified. Additionally, images will also ignore their dir unless it was set as part of creation.

Code Snippet (if applicable) to Reproduce Problem:
// make sure your mob is a directional icon
var/image/I = new(icon, icon_state)
I.dir = WEST
var/mutable_appearance/MA = new(I)
loc.overlays += MA
world << MA.dir


Expected Results:
As long as the image/mutable_appearance's dir is WEST, the overlay should face WEST.

Actual Results:
Sometimes it acts as though the dir is SOUTH even though it's clearly not.

When does the problem NOT occur?
If you add an overlay that's an image and the image had its dir set as creation, then BYOND respects the dir correctly. Even if you change it later, as long as it was defined at spawn, dir is respected. Even if you copy the image as a mutable_appearance, it still respects dir. Don't define dir, however, and it will ignore dir forever.

    var/image/I = new(icon, icon_state, dir = WEST)
I think this is intentional. That way, for example, if you have a person, and clothing overlays then when the person changes direction the clothing overlays automatically follow
Guess it's time for a new appearance_flags flag: RESET_DIR. Pretty soon we'll have a RESET flag for every variable of appearances.
In response to Kaiochao
Kaiochao wrote:
Guess it's time for a new appearance_flags flag: RESET_DIR. Pretty soon we'll have a RESET flag for every variable of appearances.

just have a string variable called "RESET_PARAMS" that contains a list of param'd variables
In response to Monster860
That would be fine if the dir was 0 or null, but images as overlays already respect a specified dir. I'm simply asking for both the ability to specify a dir and the more general behavior of inheriting it instead of being stuck with just the latter.
bump
What if we just stop DM from refusing to allow atoms with a dir of 0?

when appearances are drawn on the client, and a dir of 0 is encountered for an appearance:

atoms/screen/statpanels/grids: default to the opposite of: client.dir (client.dir defaults to NORTH, which means default direction is SOUTH)

overlays/appearances/vis_contents/plane slaves: default to the direction of the root's default direction.

Simply allowing the value 0 to be handled specially is more than fine, given DIR is an unsigned byte, innit? If possible, this removes the need for an appearance flag.


Similarly, we could have gone back in time and done something similar with color to create a special format for color matrixes that adds a field with the following flags:

RESET_CLIENT | RESET_PARENT | RESET_ALPHA

Similarly, matrixes could have been granted an extra field for RESET_CLIENT and RESET_PARENT, as well as PIXEL_SCALE

That would have reduced appearance flag usage to:

LONG_GLIDE
KEEP_TOGETHER
KEEP_APART
PLANE_MASTER
TILE_BOUND

The new filter format also opens similar doors.
Lummox JR resolved issue (Not a bug)