mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 21:40:55 +01:00
Fixes #6702 and cleanup
Makes reinforced glass a subtype of glass, cleans up window creation copypasta. Cleaned up window initialization leaking outside of the window constructor. Removes unnecessary init_dir var from windows.
This commit is contained in:
@@ -123,8 +123,8 @@
|
||||
return
|
||||
|
||||
//window placing begin
|
||||
else if(istype(W,/obj/item/stack/sheet/rglass) || istype(W,/obj/item/stack/sheet/glass))
|
||||
var/obj/item/stack/sheet/ST = W
|
||||
else if(istype(W,/obj/item/stack/sheet/glass))
|
||||
var/obj/item/stack/sheet/glass/ST = W
|
||||
var/dir_to_set = 1
|
||||
if(loc == user.loc)
|
||||
dir_to_set = user.dir
|
||||
@@ -153,16 +153,10 @@
|
||||
if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
|
||||
user << "<span class='notice'>There is already a window facing this way there.</span>"
|
||||
return
|
||||
|
||||
var/wtype = ST.created_window
|
||||
if (ST.use(1))
|
||||
var/obj/structure/window/WD
|
||||
if(istype(W, /obj/item/stack/sheet/rglass))
|
||||
WD = new/obj/structure/window/reinforced(loc) //reinforced window
|
||||
else
|
||||
WD = new/obj/structure/window/basic(loc) //normal window
|
||||
WD.dir = dir_to_set
|
||||
WD.ini_dir = dir_to_set
|
||||
WD.anchored = 0
|
||||
WD.state = 0
|
||||
var/obj/structure/window/WD = new wtype(loc, dir_to_set, 1)
|
||||
user << "<span class='notice'>You place the [WD] on [src].</span>"
|
||||
WD.update_icon()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user