From af0080b00bbb8e4b20013b0217a9d02340b07afc Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Fri, 15 Sep 2017 02:51:53 -0500 Subject: [PATCH] [MIRROR] Stops ranged stack splitting (#2785) * Merge pull request #30695 from KorPhaeron/magicstacks Stops ranged stack splitting * Stops ranged stack splitting --- code/game/objects/items/stacks/stack.dm | 42 ++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 2a5561a597..d4e9d596d7 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -62,20 +62,20 @@ /obj/item/stack/examine(mob/user) ..() if (is_cyborg) - if(src.singular_name) - to_chat(user, "There is enough energy for [src.get_amount()] [src.singular_name]\s.") + if(singular_name) + to_chat(user, "There is enough energy for [get_amount()] [singular_name]\s.") else - to_chat(user, "There is enough energy for [src.get_amount()].") + to_chat(user, "There is enough energy for [get_amount()].") return - if(src.singular_name) - if(src.get_amount()>1) - to_chat(user, "There are [src.get_amount()] [src.singular_name]\s in the stack.") + if(singular_name) + if(get_amount()>1) + to_chat(user, "There are [get_amount()] [singular_name]\s in the stack.") else - to_chat(user, "There is [src.get_amount()] [src.singular_name] in the stack.") - else if(src.get_amount()>1) - to_chat(user, "There are [src.get_amount()] in the stack.") + to_chat(user, "There is [get_amount()] [singular_name] in the stack.") + else if(get_amount()>1) + to_chat(user, "There are [get_amount()] in the stack.") else - to_chat(user, "There is [src.get_amount()] in the stack.") + to_chat(user, "There is [get_amount()] in the stack.") /obj/item/stack/proc/get_amount() if(is_cyborg) @@ -93,7 +93,7 @@ user << browse(null, "window=stack") return user.set_machine(src) //for correct work of onclose - var/t1 = text("Constructions from []Amount Left: []
", src, src.get_amount()) + var/t1 = text("Constructions from []Amount Left: []
", src, get_amount()) for(var/i=1;i<=recipes.len,i++) var/datum/stack_recipe/R = recipes[i] if (isnull(R)) @@ -101,7 +101,7 @@ continue if (i>1 && !isnull(recipes[i-1])) t1+="
" - var/max_multiplier = round(src.get_amount() / R.req_amount) + var/max_multiplier = round(get_amount() / R.req_amount) var/title as text var/can_build = 1 can_build = can_build && (max_multiplier>0) @@ -109,7 +109,7 @@ title+= "[R.res_amount]x [R.title]\s" else title+= "[R.title]" - title+= " ([R.req_amount] [src.singular_name]\s)" + title+= " ([R.req_amount] [singular_name]\s)" if (can_build) t1 += text("[] ", src, i, title) else @@ -134,7 +134,7 @@ if (usr.restrained() || usr.stat || usr.get_active_held_item() != src) return if (href_list["make"]) - if (src.get_amount() < 1) qdel(src) //Never should happen + if (get_amount() < 1) qdel(src) //Never should happen var/datum/stack_recipe/R = recipes[text2num(href_list["make"])] var/multiplier = text2num(href_list["multiplier"]) @@ -185,7 +185,7 @@ addtimer(CALLBACK(src, /atom/.proc/interact, usr), 0) /obj/item/stack/proc/building_checks(datum/stack_recipe/R, multiplier) - if (src.get_amount() < R.req_amount*multiplier) + if (get_amount() < R.req_amount*multiplier) if (R.req_amount*multiplier>1) to_chat(usr, "You haven't got enough [src] to build \the [R.req_amount*multiplier] [R.title]\s!") else @@ -276,9 +276,9 @@ return //get amount from user var/min = 0 - var/max = src.get_amount() + var/max = get_amount() var/stackmaterial = round(input(user,"How many sheets do you wish to take out of this stack? (Maximum [max])") as num) - if(stackmaterial == null || stackmaterial <= min || stackmaterial >= src.get_amount()) + if(stackmaterial == null || stackmaterial <= min || stackmaterial >= get_amount() || !user.canUseTopic(src)) return else change_stack(user,stackmaterial) @@ -304,10 +304,10 @@ . = ..() /obj/item/stack/proc/copy_evidences(obj/item/stack/from as obj) - src.blood_DNA = from.blood_DNA - src.fingerprints = from.fingerprints - src.fingerprintshidden = from.fingerprintshidden - src.fingerprintslast = from.fingerprintslast + blood_DNA = from.blood_DNA + fingerprints = from.fingerprints + fingerprintshidden = from.fingerprintshidden + fingerprintslast = from.fingerprintslast //TODO bloody overlay /obj/item/stack/microwave_act(obj/machinery/microwave/M)