mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Fix cult structure stacking exploit (#17091)
This commit is contained in:
@@ -372,12 +372,12 @@ GLOBAL_LIST_INIT(cardboard_recipes, list (
|
||||
*/
|
||||
|
||||
GLOBAL_LIST_INIT(cult_recipes, list ( \
|
||||
new /datum/stack_recipe/cult("runed door (stuns non-cultists)", /obj/machinery/door/airlock/cult, 1, time = 50, one_per_turf = TRUE, on_floor = TRUE, no_cult_structure = TRUE),
|
||||
new /datum/stack_recipe/cult("runed girder (used to make cult walls)", /obj/structure/girder/cult, 1, time = 10, one_per_turf = TRUE, on_floor = TRUE, no_cult_structure = TRUE), \
|
||||
new /datum/stack_recipe/cult("pylon (heals nearby cultists)", /obj/structure/cult/functional/pylon, 4, time = 40, one_per_turf = TRUE, on_floor = TRUE, no_cult_structure = TRUE), \
|
||||
new /datum/stack_recipe/cult("forge (crafts shielded robes, flagellant's robes, and mirror shields)", /obj/structure/cult/functional/forge, 3, time = 40, one_per_turf = TRUE, on_floor = TRUE, no_cult_structure = TRUE), \
|
||||
new /datum/stack_recipe/cult("archives (crafts zealot's blindfolds, shuttle curse orbs, veil shifters, and reality sunderers)", /obj/structure/cult/functional/archives, 3, time = 40, one_per_turf = TRUE, on_floor = TRUE, no_cult_structure = TRUE), \
|
||||
new /datum/stack_recipe/cult("altar (crafts eldritch whetstones, construct shells, and flasks of unholy water)", /obj/structure/cult/functional/altar, 3, time = 40, one_per_turf = TRUE, on_floor = TRUE, no_cult_structure = TRUE),
|
||||
new /datum/stack_recipe/cult("runed door (stuns non-cultists)", /obj/machinery/door/airlock/cult, 1, time = 50, one_per_turf = TRUE, on_floor = TRUE, cult_structure = TRUE),
|
||||
new /datum/stack_recipe/cult("runed girder (used to make cult walls)", /obj/structure/girder/cult, 1, time = 10, one_per_turf = TRUE, on_floor = TRUE, cult_structure = TRUE), \
|
||||
new /datum/stack_recipe/cult("pylon (heals nearby cultists)", /obj/structure/cult/functional/pylon, 4, time = 40, one_per_turf = TRUE, on_floor = TRUE, cult_structure = TRUE), \
|
||||
new /datum/stack_recipe/cult("forge (crafts shielded robes, flagellant's robes, and mirror shields)", /obj/structure/cult/functional/forge, 3, time = 40, one_per_turf = TRUE, on_floor = TRUE, cult_structure = TRUE), \
|
||||
new /datum/stack_recipe/cult("archives (crafts zealot's blindfolds, shuttle curse orbs, veil shifters, and reality sunderers)", /obj/structure/cult/functional/archives, 3, time = 40, one_per_turf = TRUE, on_floor = TRUE, cult_structure = TRUE), \
|
||||
new /datum/stack_recipe/cult("altar (crafts eldritch whetstones, construct shells, and flasks of unholy water)", /obj/structure/cult/functional/altar, 3, time = 40, one_per_turf = TRUE, on_floor = TRUE, cult_structure = TRUE),
|
||||
))
|
||||
|
||||
/obj/item/stack/sheet/runed_metal
|
||||
|
||||
@@ -209,7 +209,7 @@
|
||||
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed on the floor!</span>")
|
||||
return FALSE
|
||||
|
||||
if(R.no_cult_structure)
|
||||
if(R.cult_structure)
|
||||
if(usr.holy_check())
|
||||
return
|
||||
if(!is_level_reachable(usr.z))
|
||||
@@ -222,7 +222,11 @@
|
||||
if(R.time)
|
||||
to_chat(usr, "<span class='notice'>Building [R.title]...</span>")
|
||||
if(!do_after(usr, R.time, target = loc))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
if(R.cult_structure && locate(/obj/structure/cult) in get_turf(src)) //Check again after do_after to prevent queuing construction exploit.
|
||||
to_chat(usr, "<span class='warning'>There is a structure here!</span>")
|
||||
return FALSE
|
||||
|
||||
if(get_amount() < R.req_amount * multiplier)
|
||||
return
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
var/one_per_turf = 0
|
||||
var/on_floor = 0
|
||||
var/window_checks = FALSE
|
||||
var/no_cult_structure = FALSE
|
||||
var/cult_structure = FALSE
|
||||
|
||||
/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0, window_checks = FALSE, no_cult_structure = FALSE)
|
||||
/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0, window_checks = FALSE, cult_structure = FALSE)
|
||||
src.title = title
|
||||
src.result_type = result_type
|
||||
src.req_amount = req_amount
|
||||
@@ -24,7 +24,7 @@
|
||||
src.one_per_turf = one_per_turf
|
||||
src.on_floor = on_floor
|
||||
src.window_checks = window_checks
|
||||
src.no_cult_structure = no_cult_structure
|
||||
src.cult_structure = cult_structure
|
||||
|
||||
/datum/stack_recipe/proc/post_build(obj/item/stack/S, obj/result)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user