From e6bc2fbe11b52a1da73715d3335f467544a3c68b Mon Sep 17 00:00:00 2001 From: Leshana Date: Wed, 11 Apr 2018 19:45:04 -0400 Subject: [PATCH] Fix building frames on walls and windows. try_build() has long accepted `user` parameter, but nothing that called try_build actually passed it! Upgraded try_build on APC to use the user parameter, and switched to use to_chat while I was there. --- code/game/objects/items/apc_frame.dm | 18 +++++++++--------- code/game/objects/structures/window.dm | 2 +- code/game/turfs/simulated/wall_attacks.dm | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm index 4b69e5db7c8..fd2ea3e94bd 100644 --- a/code/game/objects/items/apc_frame.dm +++ b/code/game/objects/items/apc_frame.dm @@ -13,31 +13,31 @@ new /obj/item/stack/material/steel( get_turf(src.loc), 2 ) qdel(src) -/obj/item/frame/apc/try_build(turf/on_wall) - if (get_dist(on_wall,usr)>1) +/obj/item/frame/apc/try_build(turf/on_wall, mob/user as mob) + if (get_dist(on_wall, user)>1) return - var/ndir = get_dir(usr,on_wall) + var/ndir = get_dir(user, on_wall) if (!(ndir in cardinal)) return - var/turf/loc = get_turf(usr) + var/turf/loc = get_turf(user) var/area/A = loc.loc if (!istype(loc, /turf/simulated/floor)) - usr << "APC cannot be placed on this spot." + to_chat(user, "APC cannot be placed on this spot.") return if (A.requires_power == 0 || istype(A, /area/space)) - usr << "APC cannot be placed in this area." + to_chat(user, "APC cannot be placed in this area.") return if (A.get_apc()) - usr << "This area already has an APC." + to_chat(user, "This area already has an APC.") return //only one APC per area for(var/obj/machinery/power/terminal/T in loc) if (T.master) - usr << "There is another network terminal here." + to_chat(user, "There is another network terminal here.") return else var/obj/item/stack/cable_coil/C = new /obj/item/stack/cable_coil(loc) C.amount = 10 - usr << "You cut the cables and disassemble the unused power terminal." + to_chat(user, "You cut the cables and disassemble the unused power terminal.") qdel(T) new /obj/machinery/power/apc(loc, ndir, 1) qdel(src) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 36da7485adb..c197ee1f601 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -311,7 +311,7 @@ qdel(src) else if(istype(W,/obj/item/frame) && anchored) var/obj/item/frame/F = W - F.try_build(src) + F.try_build(src, user) else user.setClickCooldown(user.get_attack_speed(W)) if(W.damtype == BRUTE || W.damtype == BURN) diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 8aa24d75d9d..8bc362a1d76 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -362,7 +362,7 @@ if(istype(W,/obj/item/frame)) var/obj/item/frame/F = W - F.try_build(src) + F.try_build(src, user) return else if(!istype(W,/obj/item/weapon/rcd) && !istype(W, /obj/item/weapon/reagent_containers))