Merge pull request #2821 from fleure/secfix

Better fix for security access
This commit is contained in:
Cheridan
2014-02-18 22:41:39 -06:00
@@ -8,50 +8,46 @@ var/list/sec_departments = list("engineering", "supply", "medical", "science")
else
var/department = pick(sec_departments)
sec_departments -= department
var/access = null
var/dep_access = null
var/destination = null
switch(department)
if("supply")
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/cargo(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/supply(H), slot_ears)
access = list(access_mailsorting, access_mining)
dep_access = list(access_mailsorting, access_mining)
destination = /area/security/checkpoint/supply
if("engineering")
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/engine(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/engi(H), slot_ears)
access = list(access_construction, access_engine)
dep_access = list(access_construction, access_engine)
destination = /area/security/checkpoint/engineering
if("medical")
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/med(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/med(H), slot_ears)
access = list(access_medical)
dep_access = list(access_medical)
destination = /area/security/checkpoint/medical
if("science")
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/science(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/sci(H), slot_ears)
access = list(access_research)
dep_access = list(access_research)
destination = /area/security/checkpoint/science
var/teleport = 0
if(!config.sec_start_brig)
if(destination)
if(!ticker || ticker.current_state <= GAME_STATE_SETTING_UP)
teleport = 1
spawn(10)
if(H)
if(teleport)
var/turf/T
var/safety = 0
while(safety < 25)
T = safepick(get_area_turfs(destination))
if(T && !H.Move(T))
safety += 1
continue
else
break
H << "<b>You have been assigned to [department]!</b>"
var/obj/item/weapon/card/id/I = locate(/obj/item/weapon/card/id, H)
if(I)
I.access |= access
if(teleport)
var/turf/T
var/safety = 0
while(safety < 25)
T = safepick(get_area_turfs(destination))
if(T && !H.Move(T))
safety += 1
continue
else
break
H << "<b>You have been assigned to [department]!</b>"
access += dep_access