mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Fixed Remote View and Project Mind not working after the target got cloned (#30309)
This commit is contained in:
@@ -1896,8 +1896,8 @@ mob/proc/on_foot()
|
||||
if(M == src || !istype(M) || !mind)
|
||||
return
|
||||
if(!ear_deaf && !stat)
|
||||
if(!(mind.heard_before[M.name]))
|
||||
mind.heard_before[M.name] = M
|
||||
if(!(mind.heard_before[M.name]) && M.mind)
|
||||
mind.heard_before[M.name] = M.mind
|
||||
M.heard_by |= mind
|
||||
|
||||
/mob/acidable()
|
||||
@@ -2161,30 +2161,36 @@ mob/proc/on_foot()
|
||||
/mob/proc/attempt_crawling(var/turf/target)
|
||||
return FALSE
|
||||
|
||||
/mob/proc/can_mind_interact(mob/living/carbon/target)
|
||||
//to_chat(world, "Starting can interact on [target]")
|
||||
if(!iscarbon(target))
|
||||
return 0 //Can't see non humans with your fancy human mind.
|
||||
//to_chat(world, "[target] is a human")
|
||||
/mob/proc/can_mind_interact(var/datum/mind/target_mind)
|
||||
var/mob/living/target
|
||||
if(isliving(target_mind))
|
||||
target = target_mind
|
||||
else
|
||||
if(!istype(target_mind))
|
||||
return null
|
||||
target = target_mind.current
|
||||
if (!istype(target))
|
||||
return null
|
||||
var/turf/target_turf = get_turf(target)
|
||||
var/turf/our_turf = get_turf(src)
|
||||
if(!target_turf)
|
||||
//to_chat(world, "[target] is in null space")
|
||||
return 0
|
||||
if((target_turf.z != our_turf.z) || target.stat!=CONSCIOUS) //Not on the same zlevel as us or they're dead.
|
||||
//to_chat(world, "[(target_turf.z != our_turf.z) ? "not on the same zlevel as [target]" : "[target] is not concious"]")
|
||||
if(target_turf.z != map.zCentcomm)
|
||||
to_chat(src, "The target mind is too faint...")//Prevent "The mind of Admin is too faint..."
|
||||
|
||||
return 0
|
||||
return null
|
||||
if (target.isDead())
|
||||
to_chat(src, "You cannot sense the target mind anymore, that's not good...")
|
||||
return null
|
||||
if(target_turf.z != our_turf.z) //Not on the same zlevel as us
|
||||
to_chat(src, "The target mind is too faint, they must be quite far from you...")
|
||||
return null
|
||||
if(target.stat != CONSCIOUS)
|
||||
to_chat(src, "The target mind is too faint, but still close, they must be unconscious...")
|
||||
return null
|
||||
if(M_PSY_RESIST in target.mutations)
|
||||
//to_chat(world, "[target] has psy resist")
|
||||
to_chat(src, "The target mind is resisting!")
|
||||
return 0
|
||||
return null
|
||||
if(target.is_wearing_any(list(/obj/item/clothing/head/helmet/space/martian,/obj/item/clothing/head/tinfoil,/obj/item/clothing/head/helmet/stun), slot_head))
|
||||
to_chat(src, "Interference is disrupting the connection with the target mind.")
|
||||
return 0
|
||||
return 1
|
||||
return null
|
||||
return target
|
||||
|
||||
/mob/proc/canMouseDrag()//used mostly to check if the mob can drag'and'drop stuff in/out of various other stuff, such as disposals, cryo tubes, etc.
|
||||
return TRUE
|
||||
|
||||
@@ -38,8 +38,10 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp
|
||||
return 0
|
||||
if(!(range == GLOBALCAST) && !(range == SELFCAST && target == user) && (options && !(target in options))) //Shouldn't be necessary but a good check in case of overrides
|
||||
return 0
|
||||
if(mind_affecting && !user.can_mind_interact(target))
|
||||
return 0
|
||||
if(ismob(target) && mind_affecting)
|
||||
var/mob/M = target
|
||||
if (!user.can_mind_interact(M.mind))
|
||||
return 0
|
||||
return !compatible_mobs.len || is_type_in_list(target, compatible_mobs)
|
||||
|
||||
/spell/targeted/choose_targets(mob/user = usr)
|
||||
@@ -59,9 +61,9 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp
|
||||
if(!user || !user.mind || !user.mind.heard_before.len)
|
||||
return
|
||||
var/target_name = input(user, "Choose the target, from those whose voices you've heard before.", "Targeting") in user.mind.heard_before
|
||||
var/mob/temp_target = user.mind.heard_before[target_name]
|
||||
var/datum/mind/temp_target = user.mind.heard_before[target_name]
|
||||
believed_name = target_name
|
||||
targets += temp_target
|
||||
targets += temp_target.current
|
||||
else if((range == 0 || range == SELFCAST) && (spell_flags & INCLUDEUSER))
|
||||
targets += user
|
||||
else
|
||||
@@ -82,8 +84,7 @@ Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are exp
|
||||
continue
|
||||
if(mind_affecting)
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
if(!C.can_mind_interact(M))
|
||||
if(!M.mind || !user.can_mind_interact(M.mind))
|
||||
continue
|
||||
possible_targets += M
|
||||
|
||||
|
||||
Reference in New Issue
Block a user