mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 14:31:59 +01:00
Refactor the borg access function to account for all ID locations (#7641)
This commit is contained in:
@@ -791,18 +791,19 @@
|
||||
return ..(user,Floor(damage/2),attack_message)
|
||||
|
||||
/mob/living/silicon/robot/proc/allowed(mob/M)
|
||||
//check if it doesn't require any access at all
|
||||
// Check if the borg doesn't require any access at all
|
||||
if(check_access(null))
|
||||
return 1
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
//if they are holding or wearing a card that has access, that works
|
||||
if(check_access(H.get_active_hand()) || check_access(H.wear_id))
|
||||
return 1
|
||||
else if(istype(M, /mob/living/silicon/robot))
|
||||
// Borgs should be handled a bit differently, since their IDs are not really IDs
|
||||
if(istype(M, /mob/living/silicon/robot))
|
||||
var/mob/living/silicon/robot/R = M
|
||||
if(check_access(R.get_active_hand()) || istype(R.get_active_hand(), /obj/item/card/robot))
|
||||
return 1
|
||||
else if(istype(M, /mob/living))
|
||||
var/id = M.GetIdCard()
|
||||
// Check if the ID card the user has (if any) has access
|
||||
if(id)
|
||||
return check_access(id)
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/robot/proc/check_access(obj/item/card/id/I)
|
||||
|
||||
Reference in New Issue
Block a user