A fix for grille layers:
In code\atoms.dm, add
layer = 2
to /obj/grille
Now wasn't that easy?
Alternatively, an in-game solution for use on unfixed servers is to build the windows AFTER the grate. Same effect, diffrent method. Code edit is easier in every way if you have code access.
(Basically, the fix gives layer a default value of 2 rather than the 3 that I assume is inherited from a base object)
No, I meant when constructing it, it should only be able to go on layer 2.
But after further experimenting, it should be 2.9
When constructing grilles, the layer is left unchanged.
So, rather than add layer-setting code there, I put it in the grille's definition so that it would apply to all instances of the grille rather than the special case of player-built grilles.
When you construct a grille it does not change the layer, so it must have a default, but the grille's definition does not have a default of it's own.
Sure, setting it in the grille creation part works just as well, but setting the layer here also makes adding grilles easier for mapmakers and any future grille creation.
Really, from the player's point of view, it will make no diffrence at all, but if another way to create a grille is added, with it's own layer = 2.9, then when you wanted to change it, you would have to seek out both.
Of course, adding it to obj/grille/new() also works, so it's really the choice of whoever implements the change.
def, new(), or player creation function. All work. I will use teh def, you use whatever.
Edit:
I would have gone with the most obvious solution of change the player's construct function, but it uses the code
new /obj/grille( usr.loc )
Meaning that I would have to modify two lines, one to set the layer, and this one to store it in a var.
Overall, changing the grille's new() or definition is easier, and the def is in a single file where it would be easy to access or change.