[MIRROR] Fix: #41250 You can't use a tablet while inside a locker [MDB IGNORE] (#15177)

* Fix: #41250 You can't use a tablet while inside a locker (#68171)

* Fix: #41250 You can't use a tablet while inside a locker

Co-authored-by: Matt <gavxn@zanidrak.com>
This commit is contained in:
SkyratBot
2022-07-25 11:49:11 +01:00
committed by GitHub
co-authored by Matt
parent ac521fa235
commit 758914d69a
5 changed files with 14 additions and 4 deletions
+2
View File
@@ -16,6 +16,8 @@
#define INTERACT_ATOM_NO_FINGERPRINT_ATTACK_HAND (1<<7)
/// adds hiddenprints instead of fingerprints on interact
#define INTERACT_ATOM_NO_FINGERPRINT_INTERACT (1<<8)
/// allows this atom to skip the adjacency check
#define INTERACT_ATOM_ALLOW_USER_LOCATION (1<<9)
/// attempt pickup on attack_hand for items
#define INTERACT_ITEM_ATTACK_HAND_PICKUP (1<<0)
+1
View File
@@ -149,6 +149,7 @@ DEFINE_BITFIELD(interaction_flags_atom, list(
"INTERACT_ATOM_REQUIRES_ANCHORED" = INTERACT_ATOM_REQUIRES_ANCHORED,
"INTERACT_ATOM_REQUIRES_DEXTERITY" = INTERACT_ATOM_REQUIRES_DEXTERITY,
"INTERACT_ATOM_UI_INTERACT" = INTERACT_ATOM_UI_INTERACT,
"INTERACT_ATOM_ALLOW_USER_LOCATION" = INTERACT_ATOM_ALLOW_USER_LOCATION,
))
DEFINE_BITFIELD(interaction_flags_machine, list(
+3 -2
View File
@@ -64,8 +64,8 @@
return interact(user)
return FALSE
/atom/proc/can_interact(mob/user)
if(!user.can_interact_with(src))
/atom/proc/can_interact(mob/user, require_adjacent_turf = TRUE)
if(!user.can_interact_with(src, interaction_flags_atom & INTERACT_ATOM_ALLOW_USER_LOCATION))
return FALSE
if((interaction_flags_atom & INTERACT_ATOM_REQUIRES_DEXTERITY) && !ISADVANCEDTOOLUSER(user))
to_chat(user, span_warning("You don't have the dexterity to do this!"))
@@ -83,6 +83,7 @@
/atom/ui_status(mob/user)
. = ..()
//Check if both user and atom are at the same location
if(!can_interact(user))
. = min(., UI_UPDATE)
+7 -2
View File
@@ -960,8 +960,13 @@
return 9
///Can the mob interact() with an atom?
/mob/proc/can_interact_with(atom/A)
if(isAdminGhostAI(src) || Adjacent(A))
/mob/proc/can_interact_with(atom/A, treat_mob_as_adjacent)
if(isAdminGhostAI(src))
return TRUE
//Return early. we do not need to check that we are on adjacent turfs (i.e we are inside a closet)
if (treat_mob_as_adjacent && src == A.loc)
return TRUE
if (Adjacent(A))
return TRUE
var/datum/dna/mob_dna = has_dna()
if(mob_dna?.check_mutation(/datum/mutation/human/telekinesis) && tkMaxRangeCheck(src, A))
@@ -18,6 +18,7 @@
comp_light_luminosity = 2.3 //Same as the PDA
looping_sound = FALSE
custom_materials = list(/datum/material/iron=300, /datum/material/glass=100, /datum/material/plastic=100)
interaction_flags_atom = INTERACT_ATOM_ALLOW_USER_LOCATION
var/has_variants = TRUE
var/finish_color = null