diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 10ac37ca0e..c7521bcecd 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -1211,16 +1211,12 @@ var/mob/dview/dview_mob = new living_mob_list -= src /mob/dview/Destroy(var/force) - crash_with("Attempt to delete the dview_mob: [log_info_line(src)]") + stack_trace("Attempt to delete the dview_mob: [log_info_line(src)]") if (!force) return QDEL_HINT_LETMELIVE global.dview_mob = new return ..() -// call to generate a stack trace and print to runtime logs -/proc/crash_with(msg) - CRASH(msg) - /proc/screen_loc2turf(scr_loc, turf/origin) var/tX = splittext(scr_loc, ",") var/tY = splittext(tX[2], ":") diff --git a/code/controllers/globals.dm b/code/controllers/globals.dm index c92d42d82a..6b7c0b4137 100644 --- a/code/controllers/globals.dm +++ b/code/controllers/globals.dm @@ -20,7 +20,7 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars) Initialize(exclude_these) /datum/controller/global_vars/Destroy(force) - crash_with("There was an attempt to qdel the global vars holder!") + stack_trace("There was an attempt to qdel the global vars holder!") if(!force) return QDEL_HINT_LETMELIVE diff --git a/code/controllers/subsystems/processing/processing.dm b/code/controllers/subsystems/processing/processing.dm index a16902c0c5..16b4da021b 100644 --- a/code/controllers/subsystems/processing/processing.dm +++ b/code/controllers/subsystems/processing/processing.dm @@ -112,9 +112,9 @@ SUBSYSTEM_DEF(processing) var/tick_time = world.time - start_tick var/tick_use_limit = world.tick_usage - start_tick_usage - 100 // Current tick use - starting tick use - 100% (a full tick excess) if(tick_time > 0) - crash_with("[log_info_line(subsystem.debug_last_thing)] slept during processing. Spent [tick_time] tick\s.") + stack_trace("[log_info_line(subsystem.debug_last_thing)] slept during processing. Spent [tick_time] tick\s.") if(tick_use_limit > 0) - crash_with("[log_info_line(subsystem.debug_last_thing)] took longer than a tick to process. Exceeded with [tick_use_limit]%") + stack_trace("[log_info_line(subsystem.debug_last_thing)] took longer than a tick to process. Exceeded with [tick_use_limit]%") /datum/proc/process() set waitfor = 0 diff --git a/code/controllers/subsystems/timer.dm b/code/controllers/subsystems/timer.dm index 9c41a0a4ba..dadcd9ab95 100644 --- a/code/controllers/subsystems/timer.dm +++ b/code/controllers/subsystems/timer.dm @@ -159,7 +159,7 @@ SUBSYSTEM_DEF(timer) if (timer.timeToRun < head_offset) bucket_resolution = null //force bucket recreation - crash_with("[i] Invalid timer state: Timer in long run queue with a time to run less then head_offset. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") + stack_trace("[i] Invalid timer state: Timer in long run queue with a time to run less then head_offset. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") if (timer.callBack && !timer.spent) timer.callBack.InvokeAsync() spent += timer @@ -170,7 +170,7 @@ SUBSYSTEM_DEF(timer) if (timer.timeToRun < head_offset + TICKS2DS(practical_offset-1)) bucket_resolution = null //force bucket recreation - crash_with("[i] Invalid timer state: Timer in long run queue that would require a backtrack to transfer to short run queue. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") + stack_trace("[i] Invalid timer state: Timer in long run queue that would require a backtrack to transfer to short run queue. [get_timer_debug_string(timer)] world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") if (timer.callBack && !timer.spent) timer.callBack.InvokeAsync() spent += timer @@ -458,10 +458,10 @@ SUBSYSTEM_DEF(timer) CRASH("addtimer called without a callback") if (wait < 0) - crash_with("addtimer called with a negative wait. Converting to [world.tick_lag]") + stack_trace("addtimer called with a negative wait. Converting to [world.tick_lag]") if (callback.object != GLOBAL_PROC && QDELETED(callback.object) && !QDESTROYING(callback.object)) - crash_with("addtimer called with a callback assigned to a qdeleted object. In the future such timers will not be supported and may refuse to run or run with a 0 wait") + stack_trace("addtimer called with a callback assigned to a qdeleted object. In the future such timers will not be supported and may refuse to run or run with a 0 wait") wait = max(CEILING(wait, world.tick_lag), world.tick_lag) @@ -492,7 +492,7 @@ SUBSYSTEM_DEF(timer) . = hash_timer.id return else if(flags & TIMER_OVERRIDE) - crash_with("TIMER_OVERRIDE used without TIMER_UNIQUE") + stack_trace("TIMER_OVERRIDE used without TIMER_UNIQUE") var/datum/timedevent/timer = new(callback, wait, flags, hash) return timer.id diff --git a/code/datums/managed_browsers/_managed_browser.dm b/code/datums/managed_browsers/_managed_browser.dm index c915c7e86a..6c702ddbdd 100644 --- a/code/datums/managed_browsers/_managed_browser.dm +++ b/code/datums/managed_browsers/_managed_browser.dm @@ -16,10 +16,10 @@ GLOBAL_VAR(managed_browser_id_ticker) /datum/managed_browser/New(client/new_client) if(!new_client) - crash_with("Managed browser object was not given a client.") + stack_trace("Managed browser object was not given a client.") return if(!base_browser_id) - crash_with("Managed browser object does not have a base browser id defined in its type.") + stack_trace("Managed browser object does not have a base browser id defined in its type.") return my_client = new_client diff --git a/code/datums/mixed.dm b/code/datums/mixed.dm index 191868e489..0b429156da 100644 --- a/code/datums/mixed.dm +++ b/code/datums/mixed.dm @@ -28,7 +28,7 @@ /datum/data/record/Destroy(var/force) if(data_core.locked.Find(src)) if(!force) - crash_with("Someone tried to qdel a record that was in data_core.locked [log_info_line(src)]") + stack_trace("Someone tried to qdel a record that was in data_core.locked [log_info_line(src)]") return QDEL_HINT_LETMELIVE data_core.locked -= src data_core.medical -= src diff --git a/code/datums/repositories/decls.dm b/code/datums/repositories/decls.dm index e6040a90dd..fead498c63 100644 --- a/code/datums/repositories/decls.dm +++ b/code/datums/repositories/decls.dm @@ -67,5 +67,5 @@ var/repository/decls/decls_repository // Initialiozed in /datum/global_init/New( /decl/Destroy() SHOULD_CALL_PARENT(FALSE) - crash_with("Prevented attempt to delete a decl instance: [log_info_line(src)]") + stack_trace("Prevented attempt to delete a decl instance: [log_info_line(src)]") return QDEL_HINT_LETMELIVE // Prevents decl destruction diff --git a/code/game/atoms.dm b/code/game/atoms.dm index f0851201d9..acf31b5079 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -83,9 +83,9 @@ // Must return an Initialize hint. Defined in code/__defines/subsystems.dm /atom/proc/Initialize(mapload, ...) if(QDELETED(src)) - crash_with("GC: -- [type] had initialize() called after qdel() --") + stack_trace("GC: -- [type] had initialize() called after qdel() --") if(initialized) - crash_with("Warning: [src]([type]) initialized multiple times!") + stack_trace("Warning: [src]([type]) initialized multiple times!") initialized = TRUE return INITIALIZE_HINT_NORMAL diff --git a/code/game/machinery/embedded_controller/docking_program.dm b/code/game/machinery/embedded_controller/docking_program.dm index 7adc3ba9d3..1dca766535 100644 --- a/code/game/machinery/embedded_controller/docking_program.dm +++ b/code/game/machinery/embedded_controller/docking_program.dm @@ -77,7 +77,7 @@ ..() if(id_tag) if(SSshuttles.docking_registry[id_tag]) - crash_with("Docking controller tag [id_tag] had multiple associated programs.") + stack_trace("Docking controller tag [id_tag] had multiple associated programs.") SSshuttles.docking_registry[id_tag] = src /datum/embedded_program/docking/Destroy() diff --git a/code/game/objects/effects/map_effects/portal.dm b/code/game/objects/effects/map_effects/portal.dm index 9f40c87f1b..375bbcd336 100644 --- a/code/game/objects/effects/map_effects/portal.dm +++ b/code/game/objects/effects/map_effects/portal.dm @@ -201,7 +201,7 @@ when portals are shortly lived, or when portals are made to be obvious with spec break if(!counterpart) - crash_with("Portal master [type] ([x],[y],[z]) could not find another portal master with a matching portal_id ([portal_id]).") + stack_trace("Portal master [type] ([x],[y],[z]) could not find another portal master with a matching portal_id ([portal_id]).") /obj/effect/map_effect/portal/master/proc/make_visuals() var/list/observed_turfs = list() diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index bd7df8d280..3a3325daa1 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -171,7 +171,7 @@ if(istype(mover)) // turf/Enter(...) will perform more advanced checks return !density - crash_with("Non movable passed to turf CanPass : [mover]") + stack_trace("Non movable passed to turf CanPass : [mover]") return FALSE //There's a lot of QDELETED() calls here if someone can figure out how to optimize this but not runtime when something gets deleted by a Bump/CanPass/Cross call, lemme know or go ahead and fix this mess - kevinz000 diff --git a/code/modules/holomap/generate_holomap.dm b/code/modules/holomap/generate_holomap.dm index d24f1f47f3..99396bd542 100644 --- a/code/modules/holomap/generate_holomap.dm +++ b/code/modules/holomap/generate_holomap.dm @@ -56,9 +56,9 @@ // Sanity checks - Better to generate a helpful error message now than have DrawBox() runtime var/icon/canvas = icon(HOLOMAP_ICON, "blank") if(world.maxx > canvas.Width()) - crash_with("Minimap for z=[zLevel] : world.maxx ([world.maxx]) must be <= [canvas.Width()]") + stack_trace("Minimap for z=[zLevel] : world.maxx ([world.maxx]) must be <= [canvas.Width()]") if(world.maxy > canvas.Height()) - crash_with("Minimap for z=[zLevel] : world.maxy ([world.maxy]) must be <= [canvas.Height()]") + stack_trace("Minimap for z=[zLevel] : world.maxy ([world.maxy]) must be <= [canvas.Height()]") for(var/x = 1 to world.maxx) for(var/y = 1 to world.maxy) @@ -82,9 +82,9 @@ // Sanity checks - Better to generate a helpful error message now than have DrawBox() runtime var/icon/canvas = icon(HOLOMAP_ICON, "blank") if(world.maxx > canvas.Width()) - crash_with("Minimap for z=[zLevel] : world.maxx ([world.maxx]) must be <= [canvas.Width()]") + stack_trace("Minimap for z=[zLevel] : world.maxx ([world.maxx]) must be <= [canvas.Width()]") if(world.maxy > canvas.Height()) - crash_with("Minimap for z=[zLevel] : world.maxy ([world.maxy]) must be <= [canvas.Height()]") + stack_trace("Minimap for z=[zLevel] : world.maxy ([world.maxy]) must be <= [canvas.Height()]") for(var/x = 1 to world.maxx) for(var/y = 1 to world.maxy) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 8ee2eaef44..087a9821cb 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -107,7 +107,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(QDESTROYING(src)) return - crash_with("CANARY: Old human update_icons was called.") + stack_trace("CANARY: Old human update_icons was called.") update_hud() //TODO: remove the need for this @@ -839,7 +839,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() apply_layer(SUIT_LAYER) /mob/living/carbon/human/update_inv_pockets() - crash_with("Someone called update_inv_pockets even though it's dumb") + stack_trace("Someone called update_inv_pockets even though it's dumb") /mob/living/carbon/human/update_inv_wear_mask() if(QDESTROYING(src)) diff --git a/code/modules/mob/mob_planes.dm b/code/modules/mob/mob_planes.dm index 7b1fbd6f7e..6d97835cc2 100644 --- a/code/modules/mob/mob_planes.dm +++ b/code/modules/mob/mob_planes.dm @@ -63,7 +63,7 @@ ASSERT(which) var/obj/screen/plane_master/PM = plane_masters[which] if(!PM) - crash_with("Tried to alter [which] in plane_holder on [my_mob]!") + stack_trace("Tried to alter [which] in plane_holder on [my_mob]!") if(my_mob.alpha <= EFFECTIVE_INVIS) state = FALSE @@ -83,7 +83,7 @@ ASSERT(which) var/obj/screen/plane_master/PM = plane_masters[which] if(!PM) - crash_with("Tried to alter [which] in plane_holder on [my_mob]!") + stack_trace("Tried to alter [which] in plane_holder on [my_mob]!") PM.set_desired_alpha(new_alpha) if(PM.sub_planes) var/list/subplanes = PM.sub_planes @@ -94,7 +94,7 @@ ASSERT(which) var/obj/screen/plane_master/PM = plane_masters[which] if(!PM) - crash_with("Tried to set_ao [which] in plane_holder on [my_mob]!") + stack_trace("Tried to set_ao [which] in plane_holder on [my_mob]!") PM.set_ambient_occlusion(enabled) if(PM.sub_planes) var/list/subplanes = PM.sub_planes @@ -105,7 +105,7 @@ ASSERT(which) var/obj/screen/plane_master/PM = plane_masters[which] if(!PM) - crash_with("Tried to alter [which] in plane_holder on [my_mob]!") + stack_trace("Tried to alter [which] in plane_holder on [my_mob]!") PM.alter_plane_values(arglist(values)) if(PM.sub_planes) var/list/subplanes = PM.sub_planes diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index c7fcc6d30e..82753f3f0a 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -323,7 +323,7 @@ var/turf/starting = get_turf(src) if(isnull(Angle)) //Try to resolve through offsets if there's no angle set. if(isnull(xo) || isnull(yo)) - crash_with("WARNING: Projectile [type] deleted due to being unable to resolve a target after angle was null!") + stack_trace("WARNING: Projectile [type] deleted due to being unable to resolve a target after angle was null!") qdel(src) return var/turf/target = locate(CLAMP(starting + xo, 1, world.maxx), CLAMP(starting + yo, 1, world.maxy), starting.z) @@ -400,7 +400,7 @@ xo = targloc.x - curloc.x setAngle(Get_Angle(src, targloc) + spread) else - crash_with("WARNING: Projectile [type] fired without either mouse parameters, or a target atom to aim at!") + stack_trace("WARNING: Projectile [type] fired without either mouse parameters, or a target atom to aim at!") qdel(src) /proc/calculate_projectile_angle_and_pixel_offsets(mob/user, params) diff --git a/code/modules/reagents/holder/holder.dm b/code/modules/reagents/holder/holder.dm index 40766754b6..cfad19554e 100644 --- a/code/modules/reagents/holder/holder.dm +++ b/code/modules/reagents/holder/holder.dm @@ -141,7 +141,7 @@ my_atom.on_reagent_change() return 1 else - crash_with("[my_atom] attempted to add a reagent called '[id]' which doesn't exist. ([usr])") + stack_trace("[my_atom] attempted to add a reagent called '[id]' which doesn't exist. ([usr])") return 0 /datum/reagents/proc/isolate_reagent(reagent) diff --git a/code/modules/reagents/machinery/dispenser/dispenser2_energy.dm b/code/modules/reagents/machinery/dispenser/dispenser2_energy.dm index b0dec9f65b..9c776d3266 100644 --- a/code/modules/reagents/machinery/dispenser/dispenser2_energy.dm +++ b/code/modules/reagents/machinery/dispenser/dispenser2_energy.dm @@ -15,7 +15,7 @@ for(var/id in dispense_reagents) var/datum/reagent/R = SSchemistry.chemical_reagents[id] if(!R) - crash_with("[src] at [x],[y],[z] failed to find reagent '[id]'!") + stack_trace("[src] at [x],[y],[z] failed to find reagent '[id]'!") dispense_reagents -= id continue var/obj/item/weapon/reagent_containers/chem_disp_cartridge/C = cartridges[R.name] diff --git a/code/modules/shieldgen/energy_shield.dm b/code/modules/shieldgen/energy_shield.dm index 6c11eb62e2..c13c43496a 100644 --- a/code/modules/shieldgen/energy_shield.dm +++ b/code/modules/shieldgen/energy_shield.dm @@ -165,7 +165,7 @@ return if(!damtype) - crash_with("CANARY: shield.take_damage() callled without damtype.") + stack_trace("CANARY: shield.take_damage() callled without damtype.") if(!damage) return diff --git a/code/modules/vore/persist/persist_vr.dm b/code/modules/vore/persist/persist_vr.dm index 3bae4a8524..d5833e4b3b 100644 --- a/code/modules/vore/persist/persist_vr.dm +++ b/code/modules/vore/persist/persist_vr.dm @@ -40,7 +40,7 @@ */ /proc/prep_for_persist(var/mob/persister) if(!istype(persister)) - crash_with("Persist (P4P): Given non-mob [persister].") + stack_trace("Persist (P4P): Given non-mob [persister].") return // Find out of this mob is a proper mob! @@ -74,7 +74,7 @@ /proc/persist_interround_data(var/mob/occupant, var/datum/spawnpoint/new_spawn_point_type) if(!istype(occupant)) - crash_with("Persist (PID): Given non-mob [occupant].") + stack_trace("Persist (PID): Given non-mob [occupant].") return var/datum/preferences/prefs = prep_for_persist(occupant) @@ -225,7 +225,7 @@ */ /proc/persist_nif_data(var/mob/living/carbon/human/H,var/datum/preferences/prefs) if(!istype(H)) - crash_with("Persist (NIF): Given a nonhuman: [H]") + stack_trace("Persist (NIF): Given a nonhuman: [H]") return if(!prefs) diff --git a/code/unit_tests/unit_test.dm b/code/unit_tests/unit_test.dm index e775f6f763..7d7dee1617 100644 --- a/code/unit_tests/unit_test.dm +++ b/code/unit_tests/unit_test.dm @@ -30,7 +30,7 @@ var/total_unit_tests = 0 log_unit_test("Initializing Unit Testing") if(!ticker) - crash_with("No Ticker") + stack_trace("No Ticker") world.Del() var/said_msg = 0 diff --git a/maps/~map_system/maps.dm b/maps/~map_system/maps.dm index ace7243c1f..0fbbca083b 100644 --- a/maps/~map_system/maps.dm +++ b/maps/~map_system/maps.dm @@ -335,7 +335,7 @@ var/list/all_maps = list() custom_skybox = new custom_skybox() /datum/map_z_level/Destroy(var/force) - crash_with("Attempt to delete a map_z_level instance [log_info_line(src)]") + stack_trace("Attempt to delete a map_z_level instance [log_info_line(src)]") if(!force) return QDEL_HINT_LETMELIVE // No. if (using_map.zlevels["[z]"] == src)