diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 23d6dfe9bb8..bb0517353b4 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1210,22 +1210,19 @@ return var/airlock_type = painter.available_paint_jobs["[current_paintjob]"] // get the airlock type path associated with the airlock name the user just chose - var/obj/machinery/door/airlock/airlock = new airlock_type // we need to create a new instance of the airlock and assembly to read vars from them - var/obj/structure/door_assembly/assembly = new airlock.assemblytype + var/obj/machinery/door/airlock/airlock = airlock_type // we need to create a new instance of the airlock and assembly to read vars from them + var/obj/structure/door_assembly/assembly = initial(airlock.assemblytype) - if(airlock_material == "glass" && assembly.noglass) // prevents painting glass airlocks with a paint job that doesn't have a glass version, such as the freezer + if(airlock_material == "glass" && initial(assembly.noglass)) // prevents painting glass airlocks with a paint job that doesn't have a glass version, such as the freezer to_chat(user, "This paint job can only be applied to non-glass airlocks.") - else - // applies the user-chosen airlock's icon, overlays and assemblytype to the src airlock - painter.use_paint(user) - icon = airlock.icon - overlays_file = airlock.overlays_file - assemblytype = airlock.assemblytype - update_icon() + return - // these are just hanging around but are never placed, we need to delete them - qdel(airlock) - qdel(assembly) + // applies the user-chosen airlock's icon, overlays and assemblytype to the src airlock + painter.use_paint(user) + icon = initial(airlock.icon) + overlays_file = initial(airlock.overlays_file) + assemblytype = initial(airlock.assemblytype) + update_icon() /obj/machinery/door/airlock/CanAStarPass(obj/item/card/id/ID) //Airlock is passable if it is open (!density), bot has access, and is not bolted shut or powered off) @@ -1565,7 +1562,7 @@ */ /obj/machinery/door/airlock/proc/set_wires() var/area/source_area = get_area(src) - return new source_area.airlock_wires(src) + return source_area?.airlock_wires ? new source_area.airlock_wires(src) : new /datum/wires/airlock(src) #undef AIRLOCK_CLOSED #undef AIRLOCK_CLOSING