Fixes Examine Crashes (#17430)

* Fixes Examine Crashes

* fukken indentations
This commit is contained in:
Wowzewow (Wezzy)
2023-09-27 10:22:04 +00:00
committed by GitHub
parent 725d999680
commit fd26ff32e2
32 changed files with 147 additions and 136 deletions
+1 -1
View File
@@ -66,7 +66,7 @@
return 0
/mob/abstract/eye/examine(mob/user)
return
return TRUE
/mob/abstract/eye/proc/possess(var/mob/user)
if(owner && owner != user)
+1 -1
View File
@@ -1,5 +1,5 @@
/proc/examinate(mob/user, atom/target, show_extended = FALSE)
if((user.is_blind() || user.stat) && isobserver(user))
if(user.is_blind() || user.stat)
to_chat(user, SPAN_NOTICE("Something is there, but you cannot see it."))
user.face_atom(target)
+2 -2
View File
@@ -53,8 +53,8 @@ var/list/holder_mob_icon_cache = list()
return ..()
/obj/item/holder/examine(mob/user)
if (contained)
contained.examine(user)
if(contained)
return contained.examine(user)
/obj/item/holder/attack_self()
for(var/mob/M in contents)
@@ -92,7 +92,7 @@
msg += "<span class='deadsay'>It appears to be completely inactive.</span>\n"
msg += "</span><span class='info'>*---------*</span>"
to_chat(user, msg)
return
return TRUE
/obj/item/device/mmi/digital/posibrain/ready_for_use(var/mob/user)
if(!brainmob)
@@ -32,7 +32,7 @@
else
to_chat(user, "<span class='deadsay'>[get_pronoun("He")] [get_pronoun("has")] a pulse!</span>")
/mob/living/carbon/human/examine(mob/user)
/mob/living/carbon/human/examine(mob/user, distance, is_adjacent)
var/skipbody = get_covered_body_parts()
var/skipbody_thick = get_covered_body_parts(TRUE)
var/skipitems = get_covered_clothes()
@@ -241,10 +241,6 @@
if(is_berserk())
msg += "<span class='warning'><B>[get_pronoun("He")] [get_pronoun("has")] engorged veins, which appear a vibrant red!</B></span>\n"
var/distance = get_dist(user,src)
if(istype(user, /mob/abstract/observer) || user.stat == DEAD) // ghosts can see anything
distance = 1
if((src.stat || (status_flags & FAKEDEATH)) && !(src.species.flags & NO_BLOOD)) // No point checking pulse of a species that doesn't have one.
msg += "<span class='warning'>[get_pronoun("He")] [get_pronoun("is")]n't responding to anything around [get_pronoun("him")] and seems to be unconscious.</span>\n"
if(distance <= 3 && ((stat == DEAD || is_asystole() || src.losebreath) || (status_flags & FAKEDEATH)))
@@ -412,6 +408,8 @@
if(Adjacent(user))
INVOKE_ASYNC(src, PROC_REF(examine_pulse), user)
return TRUE
//Helper procedure. Called by /mob/living/carbon/human/examine() and /mob/living/carbon/human/Topic() to determine HUD access to security and medical records.
/proc/hasHUD(mob/M, hudtype)
if(ishuman(M))
@@ -457,7 +455,7 @@
var/output_text = color_map[supplied_color] || "fluid"
return output_text
/mob/living/carbon/human/assemble_height_string(mob/examiner)
/mob/living/carbon/human/proc/assemble_height_string(mob/examiner)
var/height_string = ""
var/height_descriptor
if(height == HEIGHT_NOT_USED)
@@ -1,6 +1,6 @@
/mob/living/silicon/ai/examine(mob/user)
if(!..(user))
return
return TRUE
var/msg = ""
if (src.stat == DEAD)
@@ -34,7 +34,7 @@
msg += hardware.get_examine_desc()
to_chat(user, msg)
user.showLaws(src)
return
return TRUE
/mob/proc/showLaws(var/mob/living/silicon/S)
return
@@ -102,9 +102,8 @@
/mob/living/simple_animal/hostile/morph/examine(mob/user, distance, is_adjacent)
if(morphed)
. = form.examine(user)
if(distance > 2)
return
to_chat(user, SPAN_WARNING("It doesn't look quite right..."))
if(distance <= 2)
to_chat(user, SPAN_WARNING("It doesn't look quite right..."))
else
return ..()
+15 -49
View File
@@ -1363,29 +1363,29 @@
toggle_zone_sel(list(BP_R_ARM,BP_R_HAND))
/client/verb/body_l_arm()
set name = "body-l-arm"
set hidden = 1
toggle_zone_sel(list(BP_L_ARM,BP_L_HAND))
set name = "body-l-arm"
set hidden = 1
toggle_zone_sel(list(BP_L_ARM,BP_L_HAND))
/client/verb/body_chest()
set name = "body-chest"
set hidden = 1
toggle_zone_sel(list(BP_CHEST))
set name = "body-chest"
set hidden = 1
toggle_zone_sel(list(BP_CHEST))
/client/verb/body_groin()
set name = "body-groin"
set hidden = 1
toggle_zone_sel(list(BP_GROIN))
set name = "body-groin"
set hidden = 1
toggle_zone_sel(list(BP_GROIN))
/client/verb/body_r_leg()
set name = "body-r-leg"
set hidden = 1
toggle_zone_sel(list(BP_R_LEG,BP_R_FOOT))
set name = "body-r-leg"
set hidden = 1
toggle_zone_sel(list(BP_R_LEG,BP_R_FOOT))
/client/verb/body_l_leg()
set name = "body-l-leg"
set hidden = 1
toggle_zone_sel(list(BP_L_LEG,BP_L_FOOT))
set name = "body-l-leg"
set hidden = 1
toggle_zone_sel(list(BP_L_LEG,BP_L_FOOT))
/client/verb/cycle_target_zone()
set name = "cycle-zone"
@@ -1398,40 +1398,6 @@
var/obj/screen/zone_sel/selector = mob.zone_sel
selector.set_selected_zone(next_in_list(mob.zone_sel.selecting,zones))
/mob/examine(mob/user, var/distance = -1, var/infix = "", var/suffix = "")
..()
if(assemble_height_string(user))
to_chat(user, SPAN_NOTICE(assemble_height_string(user)))
//Height String for examine - Runs on the mob being examined.
/mob/proc/assemble_height_string(mob/examiner)
var/height_string = null
var/height_descriptor
if(height == HEIGHT_NOT_USED)
return height_string
if(examiner.height == HEIGHT_NOT_USED)
return height_string
switch(height - examiner.height)
if(-999 to -100)
height_descriptor = "absolutely tiny compared to"
if(-99 to -50)
height_descriptor = "much smaller than"
if(-49 to -11)
height_descriptor = "shorter than"
if(-10 to 10)
height_descriptor = "about the same height as"
if(11 to 50)
height_descriptor = "taller than"
if(51 to 100)
height_descriptor = "much larger than"
else
height_descriptor = "to tower over"
if(height_string)
return height_string + " [get_pronoun("He")] seem[get_pronoun("end")] [height_descriptor] you."
return "[get_pronoun("He")] seem[get_pronoun("end")] [height_descriptor] you."
/mob/proc/get_speech_bubble_state_modifier()
return "normal"