mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 23:23:28 +01:00
Use a generic ai handler instead. Fix AI wire cut
This commit is contained in:
+5
-10
@@ -194,26 +194,22 @@
|
||||
// AIRLOCKS
|
||||
|
||||
/obj/machinery/door/airlock/AIAltShiftClick(mob/user) // Sets/Unsets Emergency Access Override
|
||||
if(emagged)
|
||||
to_chat(user, "<span class='warning'>Unable to interface: Internal error.</span>")
|
||||
if(!ai_control_check(user))
|
||||
return
|
||||
toggle_emergency_status(user)
|
||||
|
||||
/obj/machinery/door/airlock/AIShiftClick(mob/user) // Opens and closes doors!
|
||||
if(emagged)
|
||||
to_chat(user, "<span class='warning'>Unable to interface: Internal error.</span>")
|
||||
if(!ai_control_check(user))
|
||||
return
|
||||
open_close(user)
|
||||
|
||||
/obj/machinery/door/airlock/AICtrlClick(mob/living/silicon/user) // Bolts doors
|
||||
if(emagged)
|
||||
to_chat(user, "<span class='warning'>Unable to interface: Internal error.</span>")
|
||||
if(!ai_control_check(user))
|
||||
return
|
||||
toggle_bolt(user)
|
||||
|
||||
/obj/machinery/door/airlock/AIAltClick(mob/living/silicon/user) // Electrifies doors.
|
||||
if(emagged)
|
||||
to_chat(user, "<span class='warning'>Unable to interface: Internal error.</span>")
|
||||
if(!ai_control_check(user))
|
||||
return
|
||||
if(wires.is_cut(WIRE_ELECTRIFY))
|
||||
to_chat(user, "<span class='warning'>The electrification wire is cut - Cannot electrify the door.</span>")
|
||||
@@ -224,8 +220,7 @@
|
||||
|
||||
|
||||
/obj/machinery/door/airlock/AIMiddleClick(mob/living/user) // Toggles door bolt lights.
|
||||
if(emagged)
|
||||
to_chat(user, "<span class='warning'>Unable to interface: Internal error.</span>")
|
||||
if(!ai_control_check(user))
|
||||
return
|
||||
toggle_light(user)
|
||||
|
||||
|
||||
@@ -757,6 +757,22 @@ About the new airlock wires panel:
|
||||
else
|
||||
try_to_activate_door(user)
|
||||
|
||||
/obj/machinery/door/airlock/proc/ai_control_check(mob/user)
|
||||
if(!issilicon(user))
|
||||
return TRUE
|
||||
if(emagged)
|
||||
to_chat(user, "<span class='warning'>Unable to interface: Internal error.</span>")
|
||||
return FALSE
|
||||
if(!canAIControl())
|
||||
if(canAIHack(user))
|
||||
hack(user)
|
||||
else
|
||||
if(isAllPowerLoss())
|
||||
to_chat(user, "<span class='warning'>Unable to interface: Connection timed out.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Unable to interface: Connection refused.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/door/airlock/tgui_act(action, params)
|
||||
if(..())
|
||||
@@ -764,17 +780,7 @@ About the new airlock wires panel:
|
||||
if(!issilicon(usr) && !usr.can_admin_interact())
|
||||
to_chat(usr, "<span class='warning'>Access denied. Only silicons may use this interface.</span>")
|
||||
return
|
||||
if(issilicon(usr) && emagged)
|
||||
to_chat(usr, "<span class='warning'>Unable to interface: Internal error.</span>")
|
||||
return
|
||||
if(!canAIControl() && !isobserver(usr))
|
||||
if(canAIHack(usr))
|
||||
hack(usr)
|
||||
else
|
||||
if(isAllPowerLoss())
|
||||
to_chat(usr, "<span class='warning'>Unable to interface: Connection timed out.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>Unable to interface: Connection refused.</span>")
|
||||
if(!ai_control_check(usr))
|
||||
return
|
||||
. = TRUE
|
||||
switch(action)
|
||||
|
||||
Reference in New Issue
Block a user