Refactors stack traces, tiny bit of cleanup (#18773)

This commit is contained in:
AffectedArc07
2022-08-14 02:11:40 +01:00
committed by GitHub
parent 5d819ac1a9
commit 34ed47ae74
50 changed files with 228 additions and 175 deletions
@@ -17,14 +17,13 @@
. = ..()
var/turf/T = get_turf(src)
if(!T)
log_runtime(EXCEPTION("Barrier spawner placed in nullspace!"), src)
return
CRASH("Barrier spawner placed in nullspace!")
var/thing_to_place = pickweight(result)
if(ispath(thing_to_place, /turf))
T.ChangeTurf(thing_to_place)
else
new thing_to_place(T)
qdel(src)
return INITIALIZE_HINT_QDEL
/obj/effect/spawner/random_barrier/wall_probably
name = "probably a wall"
@@ -10,11 +10,12 @@
var/spawn_inside = null
// This needs to use New() instead of Initialize() because the thing it creates might need to be initialized too
// AA 2022-08-11: The above comment doesnt even make sense. If extra atoms are loaded during SSatoms.Initialize(), they still get initialised!
/obj/effect/spawner/random_spawners/New()
. = ..()
var/turf/T = get_turf(src)
if(!T)
log_runtime(EXCEPTION("Spawner placed in nullspace!"), src)
stack_trace("Spawner placed in nullspace!")
return
randspawn(T)
@@ -13,7 +13,7 @@
var/obj/structure/window/WI
for(var/obj/structure/grille/G in get_turf(src))
// Complain noisily
log_runtime(EXCEPTION("Extra grille on turf: ([T.x],[T.y],[T.z])"), src)
stack_trace("Extra grille on turf: ([T.x],[T.y],[T.z])")
qdel(G) //just in case mappers don't know what they are doing
if(!useFull)
@@ -322,7 +322,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
return ..()
/mob/living/automatedannouncer/proc/autocleanup()
log_runtime(EXCEPTION("An announcer somehow managed to outlive the radio! Deleting!"), src, list("Message: '[message]'"))
stack_trace("An announcer somehow managed to outlive the radio! Deleting! (Message: [message])")
qdel(src)
// Interprets the message mode when talking into a radio, possibly returning a connection datum
+2 -2
View File
@@ -65,7 +65,7 @@
. += "[icon_state]-emagged"
if(powered)
. += "[icon_state]-powered"
if(powered && cell)
if(powered && cell)
var/ratio = cell.charge / cell.maxcharge
ratio = CEILING(ratio*4, 1) * 25
. += "[icon_state]-charge[ratio]"
@@ -562,7 +562,7 @@
if(ghost && !ghost.client)
// In case the ghost's not getting deleted for some reason
H.key = ghost.key
log_runtime(EXCEPTION("Ghost of name [ghost.name] is bound to [H.real_name], but lacks a client. Deleting ghost."), H)
stack_trace("Ghost of name [ghost.name] is bound to [H.real_name], but lacks a client. Deleting ghost.")
QDEL_NULL(ghost)
var/tplus = world.time - H.timeofdeath
@@ -77,7 +77,7 @@
H = M
if(!buf)
log_runtime(EXCEPTION("[src] used by [user] on [M] failed to initialize properly."), src)
stack_trace("[src] used by [user] on [M] failed to initialize properly.")
return
spawn(0) //Some mutations have sleeps in them, like monkey
+3 -5
View File
@@ -95,8 +95,7 @@
/obj/item/rpd/proc/create_atmos_pipe(mob/user, turf/T) //Make an atmos pipe, meter, or gas sensor
if(!can_dispense_pipe(whatpipe, RPD_ATMOS_MODE))
log_runtime(EXCEPTION("Failed to spawn [get_pipe_name(whatpipe, PIPETYPE_ATMOS)] - possible tampering detected")) //Damn dirty apes -- I mean hackers
return
CRASH("Failed to spawn [get_pipe_name(whatpipe, PIPETYPE_ATMOS)] - possible tampering detected") //Damn dirty apes -- I mean hackers
var/obj/item/pipe/P
if(whatpipe == PIPE_GAS_SENSOR)
P = new /obj/item/pipe_gsensor(T)
@@ -117,8 +116,7 @@
/obj/item/rpd/proc/create_disposals_pipe(mob/user, turf/T) //Make a disposals pipe / construct
if(!can_dispense_pipe(whatdpipe, RPD_DISPOSALS_MODE))
log_runtime(EXCEPTION("Failed to spawn [get_pipe_name(whatdpipe, PIPETYPE_DISPOSAL)] - possible tampering detected"))
return
CRASH("Failed to spawn [get_pipe_name(whatdpipe, PIPETYPE_DISPOSAL)] - possible tampering detected")
var/obj/structure/disposalconstruct/P = new(T, whatdpipe, iconrotation)
if(!iconrotation) //Automatic rotation
P.dir = user.dir
@@ -287,7 +285,7 @@
playsound(src, 'sound/machines/synth_no.ogg', 15, TRUE)
to_chat(user, "<span class='notice'>ERROR: \The [T] is out of [src]'s range!</span>")
return
T.rpd_act(user, src)
#undef RPD_COOLDOWN_TIME
@@ -708,9 +708,9 @@
if(islist(thing))
list_to_object(thing, src)
else if(thing == null)
log_runtime(EXCEPTION("Null entry found in storage/deserialize."), src)
stack_trace("Null entry found in storage/deserialize.")
else
log_runtime(EXCEPTION("Non-list thing found in storage/deserialize."), src, list("Thing: [thing]"))
stack_trace("Non-list thing found in storage/deserialize (Thing: [thing])")
..()
/obj/item/storage/AllowDrop()