Skip to content

Commit

Permalink
remove unreachable code (#3660)
Browse files Browse the repository at this point in the history
  • Loading branch information
spookydonut authored and Rohesie committed Jan 24, 2020
1 parent 1ac8bfa commit 029b626
Show file tree
Hide file tree
Showing 16 changed files with 4 additions and 24 deletions.
4 changes: 2 additions & 2 deletions code/controllers/subsystem/timer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ SUBSYSTEM_DEF(timer)

if (timer.timeToRun < head_offset)
bucket_resolution = null //force bucket recreation
CRASH("[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()
Expand All @@ -171,7 +171,7 @@ SUBSYSTEM_DEF(timer)

if (timer.timeToRun < head_offset + TICKS2DS(practical_offset-1))
bucket_resolution = null //force bucket recreation
CRASH("[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
Expand Down
1 change: 0 additions & 1 deletion code/datums/components/squeak.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
return
if(!squeak_sound)
CRASH("Squeak component attempted to play invalid sound.")
return

if(islist(squeak_sound))
playsound(parent, sound(pick(squeak_sound)), volume)
Expand Down
2 changes: 0 additions & 2 deletions code/datums/datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,9 @@
if(!islist(jsonlist))
if(!istext(jsonlist))
CRASH("Invalid JSON")
return
jsonlist = json_decode(jsonlist)
if(!islist(jsonlist))
CRASH("Invalid JSON")
return
if(!jsonlist["DATUM_TYPE"])
return
if(!ispath(jsonlist["DATUM_TYPE"]))
Expand Down
1 change: 0 additions & 1 deletion code/datums/emergency_calls/emergency_call.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
if(!SSmapping.shuttle_templates[shuttle_id])
message_admins("Distress beacon: [name] couldn't find a valid shuttle template")
CRASH("ert called with invalid shuttle_id")
return
var/datum/map_template/shuttle/S = SSmapping.shuttle_templates[shuttle_id]

var/obj/docking_port/stationary/L = SSshuttle.getDock("distress_loading")
Expand Down
2 changes: 0 additions & 2 deletions code/datums/gamemodes/crash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
// Spawn the ship
if(!SSmapping.shuttle_templates[shuttle_id])
CRASH("Shuttle [shuttle_id] wasn't found and can't be loaded")
return FALSE

var/datum/map_template/shuttle/ST = SSmapping.shuttle_templates[shuttle_id]
var/obj/docking_port/stationary/L = SSshuttle.getDock("canterbury_loadingdock")
Expand All @@ -76,7 +75,6 @@

if(!length(valid_docks))
CRASH("No valid crash sides found!")
return
var/obj/docking_port/stationary/crashmode/actual_crash_site = pick(valid_docks)

shuttle.crashing = TRUE
Expand Down
1 change: 0 additions & 1 deletion code/datums/wires/_wires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
. = ..()
if(!istype(holder, holder_type))
CRASH("Wire holder is not of the expected type! holder: [holder.type], holder_type: [holder_type]")
return

src.holder = holder
if(randomize)
Expand Down
5 changes: 0 additions & 5 deletions code/game/objects/machinery/camera/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,12 @@
for(var/obj/machinery/camera/C in oview(4, M))
if(C.can_use()) // check if camera disabled
return C
break
return null


/proc/near_range_camera(mob/M)
for(var/obj/machinery/camera/C in range(4, M))
if(C.can_use()) // check if camera disabled
return C
break

return null


/obj/machinery/camera/proc/Togglelight(on = FALSE)
Expand Down
2 changes: 0 additions & 2 deletions code/game/objects/machinery/computer/camera_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@
if(!network)
user.unset_interaction()
CRASH("No camera network")
return

if(!(islist(network)))
user.unset_interaction()
CRASH("Camera network is not a list")
return

var/list/camera_list = get_available_cameras()
if(!(user in watchers))
Expand Down
1 change: 0 additions & 1 deletion code/modules/admin/verbs/centcom_podlauncher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.adm
if (isnull(A)) //If theres no supplypod bay mapped into centcom, throw an error
to_chat(holder.mob, "No /area/centcom/supplypod/loading/one (or /two or /three or /four) in the world! You can make one yourself (then refresh) for now, but yell at a mapper to fix this, today!")
CRASH("No /area/centcom/supplypod/loading/one (or /two or /three or /four) has been mapped into the centcom z-level!")
return
orderedArea = list()
if (!isemptylist(A.contents)) //Go through the area passed into the proc, and figure out the top left and bottom right corners by calculating max and min values
var/startX = A.contents[1].x //Create the four values (we do it off a.contents[1] so they have some sort of arbitrary initial value. They should be overwritten in a few moments)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
/obj/machinery/atmospherics/components/proc/nullifyPipenet(datum/pipeline/reference)
if(!reference)
CRASH("nullifyPipenet(null) called by [type] on [COORD(src)]")
return
var/i = parents.Find(reference)
reference.other_atmosmch -= src
parents[i] = null
Expand Down
1 change: 0 additions & 1 deletion code/modules/atmospherics/machinery/datum_pipeline.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,4 @@
var/datum/pipeline/P = returnPipenet(A)
if(!P)
CRASH("null.addMember() called by [type] on [COORD(src)]")
return
P.addMember(A, src)
1 change: 0 additions & 1 deletion code/modules/mob/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@
return l_hand
else
return r_hand
return


/mob/living/carbon/human/proc/equip_if_possible(obj/item/W, slot, del_on_fail = 1) // since byond doesn't seem to have pointers, this seems like the best way to do this :/
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/ammo_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ GLOBAL_LIST_INIT(no_sticky_resin, typecacheof(list(/obj/item/clothing/mask/faceh
if(isnestedhost(C))
return

staggerstun(C, P, stagger = 1, slowdown = 1) //Staggers and slows down briefly
staggerstun(C, P, stagger = 1, slowdown = 1) //Staggers and slows down briefly

return ..()

Expand Down
1 change: 0 additions & 1 deletion code/modules/reagents/Chemistry-Holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,6 @@
if(isnull(amount))
amount = 0
CRASH("null amount passed to reagent code")
return FALSE

if(!isnum(amount) || amount < 0)
return FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/chemistry_reagents/toxin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
taste_description = "death"

/datum/reagent/toxin/zombiepowder/on_mob_add(mob/living/L, metabolism)
return ..()
L.status_flags |= FAKEDEATH
return ..()

/datum/reagent/toxin/zombiepowder/on_mob_life(mob/living/L, metabolism)
L.adjustOxyLoss(0.5*REM)
Expand Down
1 change: 0 additions & 1 deletion code/modules/shuttle/escape_pod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@
if(occupant)
to_chat(M, "<span class='warning'>The cryogenic pod is already in use. You will need to find another.</span>")
return FALSE
return
M.forceMove(src)
to_chat(M, "<span class='notice'>You feel cool air surround you as your mind goes blank and the pod locks.</span>")
occupant = M
Expand Down

0 comments on commit 029b626

Please sign in to comment.