Skip to content
This repository has been archived by the owner on Sep 17, 2022. It is now read-only.

Update portable_turret.dm #95

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions code/game/machinery/porta_turret/portable_turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -905,16 +905,23 @@ DEFINE_BITFIELD(turret_flags, list(
if (issilicon(user))
return attack_hand(user)

if ( get_dist(src, user) == 0 ) // trying to unlock the interface
if (allowed(usr))
if(obj_flags & EMAGGED)
to_chat(user, "<span class='warning'>The turret control is unresponsive!</span>")
return
// SinguloStation edit
togglelock(user) // trying to unlock the interface

locked = !locked
to_chat(user, "<span class='notice'>You [ locked ? "lock" : "unlock"] the panel.</span>")
else
to_chat(user, "<span class='alert'>Access denied.</span>")
/obj/machinery/turretid/proc/togglelock(mob/user)
if (allowed(user))
if(obj_flags & EMAGGED)
to_chat(user, "<span class='notice'>The turret control is unresponsive.</span>")
return
locked = !locked
to_chat(user, "<span class='notice'>You [ locked ? "lock" : "unlock"] the panel.</span>")
else
to_chat(user, "<span class='warning'>Access denied.</span>")

/obj/machinery/turretid/AltClick(mob/user)
if(machine_stat & BROKEN)
return
togglelock(user)

/obj/machinery/turretid/emag_act(mob/user)
if(obj_flags & EMAGGED)
Expand Down