Fix 'error loading icon' warning if airlocks do not have overlays_file var

This commit is contained in:
Tad Hardesty 2020-03-31 17:31:33 -07:00
parent 38b88aa3c6
commit 361065ea20

View file

@ -283,11 +283,13 @@ impl RenderPass for Overlays {
}
} else if atom.istype("/obj/machinery/door/airlock/") {
if atom.get_var("glass", objtree).to_bool() {
overlays.push(Sprite {
icon: atom.get_var("overlays_file", objtree).as_path_str().unwrap_or(""),
icon_state: "glass_closed",
.. atom.sprite
})
if let Some(overlays_file) = atom.get_var("overlays_file", objtree).as_path_str() {
overlays.push(Sprite {
icon: overlays_file,
icon_state: "glass_closed",
.. atom.sprite
})
}
} else {
add_to(overlays, atom, "fill_closed");
}