Makes ladders craftable (#54485)

This commit is contained in:
wesoda25
2020-11-19 15:11:15 -08:00
committed by GitHub
parent 2ef129ed44
commit 23197a58ab
2 changed files with 13 additions and 6 deletions
+1
View File
@@ -5,6 +5,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
new/datum/stack_recipe("linen bin", /obj/structure/bedsheetbin/empty, 2, time = 5, one_per_turf = FALSE), \
new/datum/stack_recipe("railing", /obj/structure/railing, 3, time = 18, window_checks = TRUE), \
new/datum/stack_recipe("tank holder", /obj/structure/tank_holder, 2, time = 5, one_per_turf = TRUE, on_floor = FALSE), \
new/datum/stack_recipe("ladder", /obj/structure/ladder/crafted, 15, time = 150, one_per_turf = TRUE, on_floor = FALSE), \
))
/obj/item/stack/rods
+12 -6
View File
@@ -7,6 +7,7 @@
anchored = TRUE
var/obj/structure/ladder/down //the ladder below this one
var/obj/structure/ladder/up //the ladder above this one
var/crafted = FALSE
obj_flags = CAN_BE_HIT | BLOCK_Z_OUT_DOWN
/obj/structure/ladder/Initialize(mapload, obj/structure/ladder/up, obj/structure/ladder/down)
@@ -35,15 +36,17 @@
if (!down)
L = locate() in SSmapping.get_turf_below(T)
if (L)
down = L
L.up = src // Don't waste effort looping the other way
L.update_icon()
if(crafted == L.crafted)
down = L
L.up = src // Don't waste effort looping the other way
L.update_icon()
if (!up)
L = locate() in SSmapping.get_turf_above(T)
if (L)
up = L
L.down = src // Don't waste effort looping the other way
L.update_icon()
if(crafted == L.crafted)
up = L
L.down = src // Don't waste effort looping the other way
L.update_icon()
update_icon()
@@ -195,3 +198,6 @@
break // break if both our connections are filled
update_icon()
/obj/structure/ladder/crafted
crafted = TRUE