fixes
This commit is contained in:
+13
-11
@@ -553,14 +553,15 @@
|
||||
/datum/action/item_action/removeAPCs/Trigger()
|
||||
var/list/areas = list()
|
||||
for (var/area/a in owner.siliconaccessareas)
|
||||
areas += a.name
|
||||
areas += "None"
|
||||
var/removeAPC = input("Select an APC to remove:","Remove APC Control",1) in areas
|
||||
if (removeAPC == "None")
|
||||
areas[a.name] = a
|
||||
var/removeAPC = input("Select an APC to remove:","Remove APC Control",1) as null|anything in areas
|
||||
if (!removeAPC)
|
||||
return
|
||||
var/area/area = owner.siliconaccessareas[areas.Find(removeAPC)]
|
||||
var/area/area = areas[removeAPC]
|
||||
var/obj/machinery/power/apc/apc = area.get_apc()
|
||||
apc.hijacker = 0
|
||||
if (!apc)
|
||||
return
|
||||
apc.hijacker = null
|
||||
apc.update_icon()
|
||||
apc.set_hijacked_lighting()
|
||||
owner.toggleSiliconAccessArea(area)
|
||||
@@ -574,13 +575,14 @@
|
||||
/datum/action/item_action/accessAPCs/Trigger()
|
||||
var/list/areas = list()
|
||||
for (var/area/a in owner.siliconaccessareas)
|
||||
areas += a.name
|
||||
areas += "None"
|
||||
var/accessAPC = input("Select an APC to access:","Access APC Interface",1) in areas
|
||||
if (accessAPC == "None")
|
||||
areas[a.name] = a
|
||||
var/accessAPC = input("Select an APC to access:","Access APC Interface",1) as null|anything in areas
|
||||
if (!accessAPC)
|
||||
return
|
||||
var/area/area = owner.siliconaccessareas[areas.Find(accessAPC)]
|
||||
var/area/area = areas[accessAPC]
|
||||
var/obj/machinery/power/apc/apc = area.get_apc()
|
||||
if (!apc)
|
||||
return
|
||||
apc.ui_interact(owner)
|
||||
|
||||
|
||||
|
||||
@@ -48,11 +48,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/item/implant/hijack/proc/InterceptClickOn(mob/living/user,params,atom/object)
|
||||
if (!toggled)
|
||||
return
|
||||
if (user.get_active_held_item())
|
||||
return
|
||||
if (isitem(object))
|
||||
if (user.get_active_held_item() || isitem(object || !toggled || user.incapacitated())
|
||||
return
|
||||
var/area/a = get_area(object)
|
||||
if (!hasSiliconAccessInArea(imp_in,a))
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
var/update_overlay = -1
|
||||
var/icon_update_needed = FALSE
|
||||
var/obj/machinery/computer/apc_control/remote_control = null
|
||||
var/mob/living/carbon/hijacker = 0
|
||||
var/mob/living/carbon/hijacker
|
||||
var/hijackerlast = FALSE
|
||||
|
||||
/obj/machinery/power/apc/unlocked
|
||||
@@ -402,14 +402,14 @@
|
||||
update_overlay |= APC_UPOVERLAY_ENVIRON2
|
||||
|
||||
var/results = 0
|
||||
if(last_update_state == update_state && last_update_overlay == update_overlay && (hijacker == 0 ? 0 : 1) == hijackerlast)
|
||||
if(last_update_state == update_state && last_update_overlay == update_overlay && (hijacker ? hijackerlast : !hijackerlast)
|
||||
return 0
|
||||
if(last_update_state != update_state)
|
||||
results += 1
|
||||
if(last_update_overlay != update_overlay || (hijacker == 0 ? 0 : 1) != hijackerlast)
|
||||
if(last_update_overlay != update_overlay || (hijacker ? !hijackerlast : hijackerlast)
|
||||
results += 2
|
||||
if (hijacker ? TRUE : FALSE != hijackerlast)
|
||||
hijackerlast = hijacker == 0 ? 0 : 1
|
||||
if (hijacker ? !hijackerlast : hijackerlast)
|
||||
hijackerlast = hijacker ? TRUE : FALSE
|
||||
return results
|
||||
|
||||
// Used in process so it doesn't update the icon too much
|
||||
@@ -948,9 +948,7 @@
|
||||
/obj/machinery/power/apc/proc/can_use(mob/user, loud = 0) //used by attack_hand() and Topic()
|
||||
if(IsAdminGhost(user))
|
||||
return TRUE
|
||||
if (user == hijacker || hasSiliconAccessInArea(user,area))
|
||||
return TRUE
|
||||
if (!aidisabled && issilicon(user))
|
||||
if (user == hijacker || (hasSiliconAccessInArea(user,area) && !aidisabled))
|
||||
return TRUE
|
||||
if(user.has_unlimited_silicon_privilege)
|
||||
var/mob/living/silicon/ai/AI = user
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
return UI_CLOSE
|
||||
|
||||
var/dist = get_dist(src_object, src)
|
||||
if(dist <= 1) // Open and interact if 1-0 tiles away.
|
||||
if(dist <= 1 || hasSiliconAccessInArea(src,get_area(src_object))) // Open and interact if 1-0 tiles away.
|
||||
return UI_INTERACTIVE
|
||||
else if(dist <= 2) // View only if 2-3 tiles away.
|
||||
return UI_UPDATE
|
||||
|
||||
@@ -14,8 +14,6 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
|
||||
|
||||
/mob/living/default_can_use_topic(src_object)
|
||||
. = shared_ui_interaction(src_object)
|
||||
if (hasSiliconAccessInArea(src,get_area(src_object)))
|
||||
return UI_INTERACTIVE
|
||||
if(. > UI_CLOSE && loc)
|
||||
. = min(., loc.contents_ui_distance(src_object, src)) // Check the distance...
|
||||
if(. == UI_INTERACTIVE) // Non-human living mobs can only look, not touch.
|
||||
@@ -23,8 +21,6 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new)
|
||||
|
||||
/mob/living/carbon/human/default_can_use_topic(src_object)
|
||||
. = shared_ui_interaction(src_object)
|
||||
if (hasSiliconAccessInArea(src,get_area(src_object)))
|
||||
return UI_INTERACTIVE
|
||||
if(. > UI_CLOSE)
|
||||
. = min(., shared_living_ui_distance(src_object)) // Check the distance...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user