Skip to content

Commit

Permalink
bugfix: fixes access control eating and holding (ss220-space#4778)
Browse files Browse the repository at this point in the history
* fixes access control

* Update code/game/machinery/doors/airlock_electronics.dm

* Update door_assembly.dm

* forcemove_turf
  • Loading branch information
Rerik007 authored Apr 5, 2024
1 parent bc5ce61 commit cd82248
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 5 deletions.
3 changes: 3 additions & 0 deletions code/game/machinery/doors/access_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
req_access = list(ACCESS_ENGINE)
toolspeed = 1
usesound = 'sound/items/deconstruct.ogg'
material_type = MATERIAL_CLASS_TECH
max_bites = 1
nutritional_value = 10

/// List of accesses currently set
var/list/selected_accesses = list()
Expand Down
28 changes: 27 additions & 1 deletion code/game/machinery/doors/airlock_electronics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,38 @@
usesound = 'sound/items/deconstruct.ogg'

multitool_menu_type = /datum/multitool_menu/idtag/airlock_electronics


var/obj/item/access_control/access_electronics = null
var/id

/obj/item/airlock_electronics/multitool_act(mob/user, obj/item/I)
. = TRUE
multitool_menu_interact(user, I)

/obj/item/airlock_electronics/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/access_control) && !access_electronics)
if(!user.drop_transfer_item_to_loc(I, src))
return
access_electronics = I
update_icon(UPDATE_OVERLAYS)
return TRUE
return ..()

/obj/item/airlock_electronics/screwdriver_act(mob/living/user, obj/item/I)
if(!access_electronics)
return FALSE
access_electronics.forceMove_turf()
if(iscarbon(user))
var/mob/living/carbon/carbon_user = user
carbon_user.put_in_hands(access_electronics, ignore_anim = FALSE)
access_electronics = null
update_icon(UPDATE_OVERLAYS)
return TRUE

/obj/item/airlock_electronics/update_overlays()
. = ..()
if(access_electronics)
. += "access-control-overlay"

/obj/item/airlock_electronics/syndicate
name = "suspicious airlock electronics"
18 changes: 14 additions & 4 deletions code/game/objects/items/weapons/storage/bags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,20 @@
max_w_class = WEIGHT_CLASS_NORMAL
w_class = WEIGHT_CLASS_TINY
can_hold = list(
/obj/item/assembly, /obj/item/circuitboard, /obj/item/intercom_electronics,
/obj/item/airlock_electronics, /obj/item/firelock_electronics, /obj/item/tracker_electronics,
/obj/item/firealarm_electronics, /obj/item/airalarm_electronics, /obj/item/apc_electronics,
/obj/item/stock_parts/cell, /obj/item/stock_parts, /obj/item/camera_assembly)
/obj/item/assembly,
/obj/item/circuitboard,
/obj/item/intercom_electronics,
/obj/item/airlock_electronics,
/obj/item/firelock_electronics,
/obj/item/tracker_electronics,
/obj/item/firealarm_electronics,
/obj/item/airalarm_electronics,
/obj/item/apc_electronics,
/obj/item/stock_parts/cell,
/obj/item/stock_parts,
/obj/item/camera_assembly,
/obj/item/access_control
)
resistance_flags = FLAMMABLE

/*
Expand Down
13 changes: 13 additions & 0 deletions code/game/objects/structures/door_assembly.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@
state = AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER
name = "near finished airlock assembly"
airlock_electronics = W
var/obj/item/airlock_electronics/electronics = W
if(electronics.access_electronics)
if(electronics.access_electronics.emagged || access_electronics)
to_chat(user, span_warning("[electronics.access_electronics] не вставляется в [src]"))
electronics.access_electronics.forceMove(user.drop_location())
electronics.access_electronics = null
return
electronics.access_electronics.forceMove(src)
to_chat(user, span_notice("You install the access control electronics."))
access_electronics = electronics.access_electronics
electronics.access_electronics = null

else if(istype(W, /obj/item/access_control) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER)
var/obj/item/access_control/control = W
Expand Down Expand Up @@ -231,6 +242,8 @@
door.check_one_access = access_electronics.one_access
access_electronics.forceMove(door)
access_electronics = null
else
door.has_access_electronics = FALSE

qdel(src)
update_icon(UPDATE_OVERLAYS)
Expand Down
Binary file modified icons/obj/doors/door_assembly.dmi
Binary file not shown.

0 comments on commit cd82248

Please sign in to comment.