Fixes Examine Crashes (#17430)

* Fixes Examine Crashes

* fukken indentations
This commit is contained in:
Wowzewow (Wezzy)
2023-09-27 18:22:04 +08:00
committed by GitHub
parent 725d999680
commit fd26ff32e2
32 changed files with 147 additions and 136 deletions
+1
View File
@@ -97,6 +97,7 @@
to_chat(usr, SPAN_NOTICE("Camera deactivated."))
/obj/item/clothing/head/helmet/space/examine(mob/user, distance, is_adjacent)
. = ..()
if((distance <= 1) && camera)
to_chat(user, FONT_SMALL(SPAN_NOTICE("To toggle the helmet camera, right click the helmet and press <b>Toggle Helmet Camera</b>.")))
to_chat(user, "This helmet has a built-in camera. It's [!ispath(camera) && camera.status ? "" : "in"]active.")
+1 -1
View File
@@ -136,7 +136,7 @@
/mob/living/heavy_vehicle/examine(var/mob/user)
if(!user || !user.client)
return
return TRUE
to_chat(user, "That's \a <b>[src]</b>.")
to_chat(user, desc)
if(LAZYLEN(pilots) && (!hatch_closed || body.pilot_coverage < 100 || body.transparent_cabin))
@@ -58,8 +58,8 @@
/obj/item/clothing/examine(mob/user)
if(IC)
IC.examine(user)
..()
examinate(user, IC)
. = ..()
/obj/item/clothing/attackby(obj/item/I, mob/user)
if(IC)
+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"
+1 -1
View File
@@ -327,7 +327,7 @@
/obj/item/organ/internal/vaurca/preserve/examine(mob/user, distance, is_adjacent)
. = ..()
if(distance <= 0)
if(is_adjacent)
var/celsius_temperature = air_contents.temperature - T0C
var/descriptive
switch(celsius_temperature)
@@ -12,10 +12,10 @@
var/light_firing_sound = 'sound/effects/explosionfar.ogg' //The sound played when you're a few walls away. Kind of loud.
var/projectile_type = /obj/item/projectile/ship_ammo
var/special_firing_mechanism = FALSE //If set to TRUE, the gun won't show up on normal controls.
var/charging_sound //The sound played when the gun is charging up.
var/charging_sound //The sound played when the gun is charging up.
var/caliber = SHIP_CALIBER_NONE
var/use_ammunition = TRUE //If we use physical ammo or not. Note that the creation of ammunition in pre_fire() is still REQUIRED!
//This just skips the initial check for ammunition.
var/use_ammunition = TRUE //If we use physical ammo or not. Note that the creation of ammunition in pre_fire() is still REQUIRED!
//This just skips the initial check for ammunition.
var/list/obj/item/ship_ammunition/ammunition = list()
var/ammo_per_shot = 1
var/max_ammo = 1
@@ -274,16 +274,22 @@
. = ..()
/obj/structure/ship_weapon_dummy/examine(mob/user)
connected.examine(user)
if(connected)
return connected.examine(user)
else
return TRUE
/obj/structure/ship_weapon_dummy/attack_hand(mob/user)
connected.attack_hand(user)
if(connected)
connected.attack_hand(user)
/obj/structure/ship_weapon_dummy/attackby(obj/item/W, mob/user)
connected.attackby(W, user)
if(connected)
connected.attackby(W, user)
/obj/structure/ship_weapon_dummy/hitby(atom/movable/AM, var/speed = THROWFORCE_SPEED_DIVISOR)
connected.hitby(AM)
if(connected)
connected.hitby(AM)
if(ismob(AM))
if(isliving(AM))
var/mob/living/M = AM
+8 -8
View File
@@ -84,22 +84,22 @@
to_chat(user, "<span class='notice'>You put [i] in [src].</span>")
papers.Add(i)
amount++
/* if(istype(O, /obj/item/paper_pack)) WIP written in.
var/obj/item/paper_bundle/j = O
amount += j.amount
to_chat(user, "<span class='notice'>You add paper from [j] into [src].</span>")
user.drop_from_inventory(j,get_turf(src))
/* if(istype(O, /obj/item/paper_pack)) WIP written in.
var/obj/item/paper_bundle/j = O
amount += j.amount
to_chat(user, "<span class='notice'>You add paper from [j] into [src].</span>")
user.drop_from_inventory(j,get_turf(src))
qdel(j)
*/
*/
/obj/item/paper_bin/examine(mob/user, distance, is_adjacent)
if(distance <= 1)
. = ..()
if(is_adjacent)
if(amount)
to_chat(user, "<span class='notice'>There " + (amount > 1 ? "are [amount] papers" : "is one paper") + " in the bin.</span>")
else
to_chat(user, "<span class='notice'>There are no papers in the bin.</span>")
return
/obj/item/paper_bin/update_icon()
+15 -16
View File
@@ -29,24 +29,23 @@
return ..()
/obj/machinery/light_construct/examine(mob/user, distance, is_adjacent)
if(distance > 2)
return
. = ..()
if(is_adjacent)
switch(stage)
if(1)
to_chat(user, SPAN_NOTICE("It's an empty frame."))
if(2)
to_chat(user, SPAN_NOTICE("It's wired."))
if(3)
to_chat(user, SPAN_NOTICE("The casing is closed."))
switch(stage)
if(1)
to_chat(user, SPAN_NOTICE("It's an empty frame."))
if(2)
to_chat(user, SPAN_NOTICE("It's wired."))
if(3)
to_chat(user, SPAN_NOTICE("The casing is closed."))
if (cell_connectors)
if (cell)
to_chat(user, SPAN_NOTICE("You see [cell] inside the casing."))
if (cell_connectors)
if (cell)
to_chat(user, SPAN_NOTICE("You see [cell] inside the casing."))
else
to_chat(user, SPAN_NOTICE("The casing has no power cell installed."))
else
to_chat(user, SPAN_NOTICE("The casing has no power cell installed."))
else
to_chat(user, SPAN_WARNING("This casing doesn't support a backup power cell."))
to_chat(user, SPAN_WARNING("This casing doesn't support a backup power cell."))
/obj/machinery/light_construct/attackby(obj/item/W, mob/living/user)
add_fingerprint(user)
+6 -6
View File
@@ -67,12 +67,12 @@
return ..()
/obj/machinery/power/portgen/examine(mob/user, distance, is_adjacent)
if(distance > 1)
return
if(active)
to_chat(user, SPAN_NOTICE("The generator is on."))
else
to_chat(user, SPAN_NOTICE("The generator is off."))
. = ..()
if(is_adjacent)
if(active)
to_chat(user, SPAN_NOTICE("The generator is on."))
else
to_chat(user, SPAN_NOTICE("The generator is off."))
/obj/machinery/power/portgen/emp_act(severity)
var/duration = 6000 //ten minutes
@@ -22,7 +22,7 @@
needspin = FALSE
/obj/item/gun/energy/plasmacutter/examine(mob/user, distance, is_adjacent)
..()
. = ..()
if(is_adjacent)
if(power_supply)
to_chat(user, FONT_SMALL(SPAN_NOTICE("It has a <b>[capitalize_first_letters(power_supply.name)]</b> installed as its power supply.")))
@@ -20,9 +20,9 @@
var/list/rockets = new/list()
/obj/item/gun/launcher/rocket/examine(mob/user, distance, is_adjacent)
if(distance > 2)
return
to_chat(user, "<span class='notice'>[rockets.len] / [max_rockets] rockets.</span>")
. = ..()
if(is_adjacent)
to_chat(user, "<span class='notice'>[rockets.len] / [max_rockets] rockets.</span>")
/obj/item/gun/launcher/rocket/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/ammo_casing/rocket))
@@ -111,9 +111,9 @@
to_chat(user, SPAN_NOTICE("You adjusted the pressure nozzle. You'll now use [amount_per_transfer_from_this] units per spray, with a [spray_size] lane spray."))
/obj/item/reagent_containers/spray/examine(mob/user, distance, is_adjacent)
. = ..()
if(is_adjacent)
to_chat(user, "[round(reagents.total_volume)] units left.")
return
/obj/item/reagent_containers/spray/verb/empty()
@@ -170,7 +170,7 @@
/obj/item/reagent_containers/spray/pepper/examine(mob/user, distance, is_adjacent)
. = ..()
if(distance <= 1)
if(is_adjacent)
to_chat(user, "The safety is [safety ? "on" : "off"].")
/obj/item/reagent_containers/spray/pepper/AltClick()
+2 -2
View File
@@ -110,12 +110,12 @@
add_overlay(I)
/obj/structure/bigDelivery/examine(mob/user, distance, is_adjacent)
. = ..()
if(distance <= 4)
if(sortTag)
to_chat(user, "<span class='notice'>It is labeled \"[sortTag]\"</span>")
if(examtext)
to_chat(user, "<span class='notice'>It has a note attached which reads, \"[examtext]\"</span>")
return
/obj/item/smallDelivery
desc = "A small wrapped package."
@@ -230,12 +230,12 @@
add_overlay(I)
/obj/item/smallDelivery/examine(mob/user, distance, is_adjacent)
. = ..()
if(distance <= 4)
if(sortTag)
to_chat(user, "<span class='notice'>It is labeled \"[sortTag]\"</span>")
if(examtext)
to_chat(user, "<span class='notice'>It has a note attached which reads, \"[examtext]\"</span>")
return
/obj/structure/bigDelivery/Destroy()
if(wrapped) //sometimes items can disappear. For example, bombs. --rastaf0