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
+5 -4
View File
@@ -73,11 +73,12 @@
return TRUE
return ..()
/obj/item/holomenu/examine(mob/user, distance)
if(anchored && length(menu_text))
/obj/item/holomenu/examine(mob/user, distance, is_adjacent)
if(anchored && length(menu_text) && is_adjacent)
interact(user)
return
return ..()
return TRUE
else
. = ..()
/obj/item/holomenu/attack_hand(mob/user)
if(anchored)
+1 -1
View File
@@ -69,7 +69,7 @@
/obj/item/stack/examine(mob/user, distance, is_adjacent)
. = ..()
if(distance <= 1)
if(is_adjacent)
if(!iscoil())
if(!uses_charge)
to_chat(user, "There [src.amount == 1 ? "is" : "are"] <b>[src.amount]</b> [src.singular_name]\s in the stack.")
+1 -4
View File
@@ -101,6 +101,7 @@
icon_state = "deliveryPaper"
desc = "A roll of paper used to enclose an object for delivery."
desc_info = "To package wrap the object for delivery, use the package wrapper on the object."
singular_name = "length"
w_class = ITEMSIZE_NORMAL
amount = 30
var/wrapping_tag = "Sorting Office"
@@ -199,10 +200,6 @@
return
return
/obj/item/stack/packageWrap/examine(mob/user, distance, is_adjacent)
if(distance <= 1)
to_chat(user, "There [amount == 1 ? "is" : "are"] about [amount] units of package wrap left!")
/obj/item/c_tube
name = "cardboard tube"
desc = "A tube of cardboard."
@@ -37,7 +37,7 @@
IC.emp_act(severity)
/obj/item/implant/integrated_circuit/examine(mob/user, distance, is_adjacent)
IC.examine(user, distance, is_adjacent)
return IC.examine(user, distance, is_adjacent)
/obj/item/implant/integrated_circuit/attackby(var/obj/item/O, var/mob/user)
if(O.iscrowbar() || istype(O, /obj/item/device/integrated_electronics) || istype(O, /obj/item/integrated_circuit) || O.isscrewdriver() || istype(O, /obj/item/cell/device) )
@@ -189,7 +189,7 @@
/obj/item/tank/jetpack/rig/examine()
to_chat(usr, "It's a jetpack. If you can see this, report it on the bug tracker.")
return 0
return TRUE
/obj/item/tank/jetpack/rig/allow_thrust(num, mob/living/user as mob)
@@ -21,8 +21,9 @@
/obj/item/tank/oxygen/adjust_initial_gas()
air_contents.adjust_gas(GAS_OXYGEN, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
/obj/item/tank/oxygen/examine(mob/user)
if(..(user, 0) && air_contents.gas[GAS_OXYGEN] < 10)
/obj/item/tank/oxygen/examine(mob/user, distance, is_adjacent)
. = ..()
if((is_adjacent) && air_contents.gas[GAS_OXYGEN] < 10)
to_chat(user, text("<span class='warning'>The meter on \the [src] indicates you are almost out of oxygen!</span>"))
/obj/item/tank/oxygen/yellow
@@ -76,7 +77,8 @@
air_contents.adjust_multi(GAS_OXYGEN, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD, GAS_NITROGEN, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
/obj/item/tank/air/examine(mob/user, distance, is_adjacent)
if((distance <= 0) && air_contents.gas[GAS_OXYGEN] < 1 && loc==user)
. = ..()
if((is_adjacent) && air_contents.gas[GAS_OXYGEN] < 1 && loc==user)
to_chat(user, "<span class='danger'>The meter on the [src.name] indicates you are almost out of air!</span>")
/*
@@ -147,7 +149,8 @@
air_contents.adjust_gas(GAS_OXYGEN, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
/obj/item/tank/emergency_oxygen/examine(mob/user, distance, is_adjacent)
if((distance <= 0) && air_contents.gas[GAS_OXYGEN] < 0.2 && loc==user)
. = ..()
if((is_adjacent) && air_contents.gas[GAS_OXYGEN] < 0.2 && loc==user)
to_chat(user, text("<span class='danger'>The meter on the [src.name] indicates you are almost out of air!</span>"))
/obj/item/tank/emergency_oxygen/engi
+4 -4
View File
@@ -34,16 +34,16 @@
// Since Topic() never seems to interact with usr on more than a superficial
// level, it should be fine to let anyone mess with the board other than ghosts.
/obj/structure/noticeboard/examine(var/mob/user)
. = ..()
if(user.Adjacent(src))
/obj/structure/noticeboard/examine(mob/user, distance, is_adjacent)
if(is_adjacent)
var/dat = "<B>Noticeboard</B><BR>"
for(var/obj/item/paper/P in src)
dat += "<A href='?src=\ref[src];read=\ref[P]'>[P.name]</A> <A href='?src=\ref[src];write=\ref[P]'>Write</A> <A href='?src=\ref[src];remove=\ref[P]'>Remove</A><BR>"
user << browse("<HEAD><TITLE>Notices</TITLE></HEAD>[dat]","window=noticeboard")
onclose(user, "noticeboard")
return TRUE
else
..()
. = ..()
/obj/structure/noticeboard/Topic(href, href_list)
..()