From 2ae0380fefdea5254255d0b51bfbc303a741c950 Mon Sep 17 00:00:00 2001 From: Firecage Date: Thu, 5 Oct 2017 11:13:47 +0200 Subject: [PATCH] Does some code standardization/consistency --- code/__HELPERS/icons.dm | 220 ++++++++++++------ code/__HELPERS/maths.dm | 9 +- code/__HELPERS/unsorted.dm | 3 +- code/_onclick/adjacent.dm | 3 +- code/_onclick/drag_drop.dm | 5 +- code/_onclick/hud/alert.dm | 18 +- code/_onclick/hud/robot.dm | 6 +- code/_onclick/hud/screen_objects.dm | 3 +- code/controllers/subsystem/dbcore.dm | 39 ++-- code/controllers/subsystem/garbage.dm | 3 +- code/datums/browser.dm | 3 +- code/datums/diseases/pierrot_throat.dm | 12 +- code/datums/diseases/wizarditis.dm | 6 +- code/datums/martial/wrestling.dm | 9 +- code/datums/mind.dm | 12 +- code/game/area/areas.dm | 3 +- code/game/atoms.dm | 3 +- code/game/atoms_movable.dm | 3 +- code/game/data_huds.dm | 21 +- code/game/gamemodes/changeling/changeling.dm | 3 +- .../game/gamemodes/changeling/traitor_chan.dm | 3 +- code/game/gamemodes/events.dm | 6 +- .../gamemodes/miniantags/abduction/gland.dm | 6 +- code/game/gamemodes/objective.dm | 11 +- code/game/gamemodes/sandbox/airlock_maker.dm | 3 +- code/game/gamemodes/sandbox/h_sandbox.dm | 21 +- code/game/machinery/_machinery.dm | 9 +- code/game/machinery/airlock_control.dm | 12 +- code/game/machinery/camera/motion.dm | 3 +- code/game/machinery/camera/presets.dm | 3 +- code/game/machinery/computer/atmos_alert.dm | 6 +- .../game/machinery/computer/buildandrepair.dm | 3 +- .../game/machinery/computer/communications.dm | 27 ++- code/game/machinery/computer/crew.dm | 30 ++- code/game/machinery/computer/dna_console.dm | 3 +- code/game/machinery/computer/message.dm | 6 +- code/game/machinery/computer/prisoner.dm | 3 +- .../embedded_controller/airlock_controller.dm | 3 +- .../embedded_controller_base.dm | 3 +- code/game/machinery/magnet.dm | 6 +- code/game/machinery/requests_console.dm | 3 +- code/game/machinery/syndicatebeacon.dm | 3 +- .../telecomms/machine_interactions.dm | 3 +- code/game/mecha/equipment/mecha_equipment.dm | 3 +- .../game/mecha/equipment/tools/other_tools.dm | 12 +- code/game/mecha/equipment/tools/work_tools.dm | 6 +- code/game/mecha/mecha.dm | 3 +- code/game/mecha/mecha_topic.dm | 12 +- code/game/objects/effects/anomalies.dm | 6 +- code/game/objects/empulse.dm | 3 +- code/game/objects/items.dm | 3 +- code/game/objects/items/dehy_carp.dm | 3 +- code/game/objects/items/devices/PDA/PDA.dm | 9 +- code/game/objects/items/devices/PDA/cart.dm | 3 +- code/game/objects/items/devices/camera_bug.dm | 3 +- .../objects/items/devices/chameleonproj.dm | 6 +- .../objects/items/devices/lightreplacer.dm | 3 +- code/game/objects/items/devices/paicard.dm | 30 ++- .../game/objects/items/devices/radio/radio.dm | 6 +- code/game/objects/items/extinguisher.dm | 15 +- code/game/objects/items/mop.dm | 3 +- code/game/objects/items/paint.dm | 3 +- code/game/objects/items/singularityhammer.dm | 3 +- code/game/objects/items/stacks/stack.dm | 3 +- code/game/objects/items/storage/bags.dm | 6 +- code/game/objects/items/tanks/tanks.dm | 3 +- code/game/objects/items/tools.dm | 3 +- code/game/objects/items/toys.dm | 5 +- code/game/objects/radiation.dm | 3 +- .../objects/structures/beds_chairs/bed.dm | 3 +- code/game/objects/structures/door_assembly.dm | 9 +- code/game/objects/structures/grille.dm | 3 +- code/game/objects/structures/noticeboard.dm | 3 +- code/game/objects/structures/safe.dm | 3 +- code/game/objects/structures/tables_racks.dm | 6 +- .../transit_tubes/transit_tube_pod.dm | 3 +- .../objects/structures/windoor_assembly.dm | 3 +- code/game/turfs/simulated/floor.dm | 9 +- code/game/turfs/space/space.dm | 3 +- code/game/turfs/turf.dm | 6 +- code/modules/admin/DB_ban/functions.dm | 12 +- code/modules/admin/NewBan.dm | 12 +- code/modules/admin/admin_verbs.dm | 3 +- code/modules/admin/holder2.dm | 3 +- code/modules/admin/secrets.dm | 12 +- code/modules/admin/verbs/BrokenInhands.dm | 3 +- code/modules/admin/verbs/buildmode.dm | 6 +- code/modules/admin/verbs/debug.dm | 3 +- code/modules/admin/verbs/manipulate_organs.dm | 3 +- code/modules/admin/verbs/mapping.dm | 21 +- code/modules/admin/verbs/randomverbs.dm | 24 +- code/modules/assembly/signaler.dm | 6 +- .../mission_code/stationCollision.dm | 3 +- code/modules/client/preferences.dm | 3 +- code/modules/client/preferences_toggles.dm | 3 +- code/modules/clothing/under/accessories.dm | 6 +- code/modules/detectivework/detective_work.dm | 3 +- code/modules/flufftext/Hallucination.dm | 21 +- code/modules/flufftext/TextFilters.dm | 6 +- code/modules/food_and_drinks/drinks/drinks.dm | 9 +- .../modules/food_and_drinks/food/condiment.dm | 6 +- .../food_and_drinks/food/customizables.dm | 6 +- code/modules/games/cards.dm | 9 +- code/modules/goonchat/jsErrorHandler.dm | 6 +- code/modules/holodeck/area_copy.dm | 3 +- code/modules/html_interface/html_interface.dm | 65 ++++-- .../html_interface/html_interface_client.dm | 9 +- .../html_interface/nanotrasen/nanotrasen.dm | 12 +- code/modules/hydroponics/grown/flowers.dm | 3 +- code/modules/hydroponics/grown/nettle.dm | 3 +- code/modules/mining/machine_stacking.dm | 3 +- code/modules/mining/machine_vending.dm | 3 +- code/modules/mining/ores_coins.dm | 3 +- .../modules/mob/dead/new_player/new_player.dm | 3 +- code/modules/mob/dead/observer/observer.dm | 6 +- .../carbon/alien/humanoid/alien_powers.dm | 9 +- code/modules/mob/living/carbon/alien/say.dm | 3 +- code/modules/mob/living/carbon/human/say.dm | 9 +- code/modules/mob/living/silicon/ai/life.dm | 9 +- .../mob/living/silicon/pai/personality.dm | 3 +- .../mob/living/silicon/pai/software.dm | 5 +- .../mob/living/silicon/robot/inventory.dm | 3 +- .../mob/living/simple_animal/bot/mulebot.dm | 3 +- .../mob/living/simple_animal/friendly/dog.dm | 6 +- .../mob/living/simple_animal/parrot.dm | 12 +- code/modules/mob/mob.dm | 9 +- code/modules/paperwork/handlabeler.dm | 3 +- code/modules/power/antimatter/shielding.dm | 3 +- code/modules/power/apc.dm | 3 +- code/modules/power/cable.dm | 6 +- code/modules/power/lighting.dm | 6 +- code/modules/power/port_gen.dm | 3 +- code/modules/projectiles/guns/syringe_gun.dm | 9 +- code/modules/reagents/chemistry/holder.dm | 3 +- .../chemistry/machinery/chem_dispenser.dm | 3 +- .../chemistry/reagents/drug_reagents.dm | 3 +- .../chemistry/reagents/other_reagents.dm | 6 +- code/modules/reagents/reagent_containers.dm | 3 +- .../reagents/reagent_containers/borghydro.dm | 3 +- .../reagents/reagent_containers/dropper.dm | 6 +- .../reagents/reagent_containers/glass.dm | 3 +- .../reagents/reagent_containers/pill.dm | 3 +- code/modules/recycling/disposal-structures.dm | 6 +- code/modules/recycling/disposal-unit.dm | 12 +- code/modules/research/rdconsole.dm | 58 +++-- code/modules/research/server.dm | 6 +- code/modules/shuttle/shuttle.dm | 3 +- code/modules/spells/spell.dm | 3 +- .../spells/spell_types/ethereal_jaunt.dm | 3 +- .../spells/spell_types/rightandwrong.dm | 6 +- .../spells/spell_types/turf_teleport.dm | 9 +- code/modules/stock_market/industries.dm | 84 ++++--- code/modules/surgery/organ_manipulation.dm | 3 +- tools/Redirector/textprocs.dm | 9 +- 154 files changed, 935 insertions(+), 475 deletions(-) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 91bf127ab837..81187a05cb5b 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -308,7 +308,8 @@ world */ /proc/ReadRGB(rgb) - if(!rgb) return + if(!rgb) + return // interpret the HSV or HSVA value var/i=1,start=1 @@ -317,19 +318,27 @@ world var/digits=0 for(i=start, i<=length(rgb), ++i) ch = text2ascii(rgb, i) - if(ch < 48 || (ch > 57 && ch < 65) || (ch > 70 && ch < 97) || ch > 102) break + if(ch < 48 || (ch > 57 && ch < 65) || (ch > 70 && ch < 97) || ch > 102) + break ++digits - if(digits == 8) break + if(digits == 8) + break var/single = digits < 6 - if(digits != 3 && digits != 4 && digits != 6 && digits != 8) return - if(digits == 4 || digits == 8) usealpha = 1 + if(digits != 3 && digits != 4 && digits != 6 && digits != 8) + return + if(digits == 4 || digits == 8) + usealpha = 1 for(i=start, digits>0, ++i) ch = text2ascii(rgb, i) - if(ch >= 48 && ch <= 57) ch -= 48 - else if(ch >= 65 && ch <= 70) ch -= 55 - else if(ch >= 97 && ch <= 102) ch -= 87 - else break + if(ch >= 48 && ch <= 57) + ch -= 48 + else if(ch >= 65 && ch <= 70) + ch -= 55 + else if(ch >= 97 && ch <= 102) + ch -= 87 + else + break --digits switch(which) if(0) @@ -337,69 +346,91 @@ world if(single) r |= r << 4 ++which - else if(!(digits & 1)) ++which + else if(!(digits & 1)) + ++which if(1) g = (g << 4) | ch if(single) g |= g << 4 ++which - else if(!(digits & 1)) ++which + else if(!(digits & 1)) + ++which if(2) b = (b << 4) | ch if(single) b |= b << 4 ++which - else if(!(digits & 1)) ++which + else if(!(digits & 1)) + ++which if(3) alpha = (alpha << 4) | ch - if(single) alpha |= alpha << 4 + if(single) + alpha |= alpha << 4 . = list(r, g, b) - if(usealpha) . += alpha + if(usealpha) + . += alpha /proc/ReadHSV(hsv) - if(!hsv) return + if(!hsv) + return // interpret the HSV or HSVA value var/i=1,start=1 - if(text2ascii(hsv) == 35) ++start // skip opening # + if(text2ascii(hsv) == 35) + ++start // skip opening # var/ch,which=0,hue=0,sat=0,val=0,alpha=0,usealpha var/digits=0 for(i=start, i<=length(hsv), ++i) ch = text2ascii(hsv, i) - if(ch < 48 || (ch > 57 && ch < 65) || (ch > 70 && ch < 97) || ch > 102) break + if(ch < 48 || (ch > 57 && ch < 65) || (ch > 70 && ch < 97) || ch > 102) + break ++digits - if(digits == 9) break - if(digits > 7) usealpha = 1 - if(digits <= 4) ++which - if(digits <= 2) ++which + if(digits == 9) + break + if(digits > 7) + usealpha = 1 + if(digits <= 4) + ++which + if(digits <= 2) + ++which for(i=start, digits>0, ++i) ch = text2ascii(hsv, i) - if(ch >= 48 && ch <= 57) ch -= 48 - else if(ch >= 65 && ch <= 70) ch -= 55 - else if(ch >= 97 && ch <= 102) ch -= 87 - else break + if(ch >= 48 && ch <= 57) + ch -= 48 + else if(ch >= 65 && ch <= 70) + ch -= 55 + else if(ch >= 97 && ch <= 102) + ch -= 87 + else + break --digits switch(which) if(0) hue = (hue << 4) | ch - if(digits == (usealpha ? 6 : 4)) ++which + if(digits == (usealpha ? 6 : 4)) + ++which if(1) sat = (sat << 4) | ch - if(digits == (usealpha ? 4 : 2)) ++which + if(digits == (usealpha ? 4 : 2)) + ++which if(2) val = (val << 4) | ch - if(digits == (usealpha ? 2 : 0)) ++which + if(digits == (usealpha ? 2 : 0)) + ++which if(3) alpha = (alpha << 4) | ch . = list(hue, sat, val) - if(usealpha) . += alpha + if(usealpha) + . += alpha /proc/HSVtoRGB(hsv) - if(!hsv) return "#000000" + if(!hsv) + return "#000000" var/list/HSV = ReadHSV(hsv) - if(!HSV) return "#000000" + if(!HSV) + return "#000000" var/hue = HSV[1] var/sat = HSV[2] @@ -407,27 +438,30 @@ world // Compress hue into easier-to-manage range hue -= hue >> 8 - if(hue >= 0x5fa) hue -= 0x5fa + if(hue >= 0x5fa) + hue -= 0x5fa var/hi,mid,lo,r,g,b hi = val lo = round((255 - sat) * val / 255, 1) mid = lo + round(abs(round(hue, 510) - hue) * (hi - lo) / 255, 1) if(hue >= 765) - if(hue >= 1275) {r=hi; g=lo; b=mid} + if(hue >= 1275) {r=hi; g=lo; b=mid} else if(hue >= 1020) {r=mid; g=lo; b=hi } - else {r=lo; g=mid; b=hi } + else {r=lo; g=mid; b=hi } else - if(hue >= 510) {r=lo; g=hi; b=mid} - else if(hue >= 255) {r=mid; g=hi; b=lo } - else {r=hi; g=mid; b=lo } + if(hue >= 510) {r=lo; g=hi; b=mid} + else if(hue >= 255) {r=mid; g=hi; b=lo } + else {r=hi; g=mid; b=lo } return (HSV.len > 3) ? rgb(r,g,b,HSV[4]) : rgb(r,g,b) /proc/RGBtoHSV(rgb) - if(!rgb) return "#0000000" + if(!rgb) + return "#0000000" var/list/RGB = ReadRGB(rgb) - if(!RGB) return "#0000000" + if(!RGB) + return "#0000000" var/r = RGB[1] var/g = RGB[2] @@ -456,15 +490,22 @@ world return hsv(hue, sat, val, (RGB.len>3 ? RGB[4] : null)) /proc/hsv(hue, sat, val, alpha) - if(hue < 0 || hue >= 1536) hue %= 1536 - if(hue < 0) hue += 1536 + if(hue < 0 || hue >= 1536) + hue %= 1536 + if(hue < 0) + hue += 1536 if((hue & 0xFF) == 0xFF) ++hue - if(hue >= 1536) hue = 0 - if(sat < 0) sat = 0 - if(sat > 255) sat = 255 - if(val < 0) val = 0 - if(val > 255) val = 255 + if(hue >= 1536) + hue = 0 + if(sat < 0) + sat = 0 + if(sat > 255) + sat = 255 + if(val < 0) + val = 0 + if(val > 255) + val = 255 . = "#" . += TO_HEX_DIGIT(hue >> 8) . += TO_HEX_DIGIT(hue >> 4) @@ -474,8 +515,10 @@ world . += TO_HEX_DIGIT(val >> 4) . += TO_HEX_DIGIT(val) if(!isnull(alpha)) - if(alpha < 0) alpha = 0 - if(alpha > 255) alpha = 255 + if(alpha < 0) + alpha = 0 + if(alpha > 255) + alpha = 255 . += TO_HEX_DIGIT(alpha >> 4) . += TO_HEX_DIGIT(alpha) @@ -493,32 +536,44 @@ world var/list/HSV2 = ReadHSV(hsv2) // add missing alpha if needed - if(HSV1.len < HSV2.len) HSV1 += 255 - else if(HSV2.len < HSV1.len) HSV2 += 255 + if(HSV1.len < HSV2.len) + HSV1 += 255 + else if(HSV2.len < HSV1.len) + HSV2 += 255 var/usealpha = HSV1.len > 3 // normalize hsv values in case anything is screwy - if(HSV1[1] > 1536) HSV1[1] %= 1536 - if(HSV2[1] > 1536) HSV2[1] %= 1536 - if(HSV1[1] < 0) HSV1[1] += 1536 - if(HSV2[1] < 0) HSV2[1] += 1536 + if(HSV1[1] > 1536) + HSV1[1] %= 1536 + if(HSV2[1] > 1536) + HSV2[1] %= 1536 + if(HSV1[1] < 0) + HSV1[1] += 1536 + if(HSV2[1] < 0) + HSV2[1] += 1536 if(!HSV1[3]) {HSV1[1] = 0; HSV1[2] = 0} if(!HSV2[3]) {HSV2[1] = 0; HSV2[2] = 0} // no value for one color means don't change saturation - if(!HSV1[3]) HSV1[2] = HSV2[2] - if(!HSV2[3]) HSV2[2] = HSV1[2] + if(!HSV1[3]) + HSV1[2] = HSV2[2] + if(!HSV2[3]) + HSV2[2] = HSV1[2] // no saturation for one color means don't change hues - if(!HSV1[2]) HSV1[1] = HSV2[1] - if(!HSV2[2]) HSV2[1] = HSV1[1] + if(!HSV1[2]) + HSV1[1] = HSV2[1] + if(!HSV2[2]) + HSV2[1] = HSV1[1] // Compress hues into easier-to-manage range HSV1[1] -= HSV1[1] >> 8 HSV2[1] -= HSV2[1] >> 8 var/hue_diff = HSV2[1] - HSV1[1] - if(hue_diff > 765) hue_diff -= 1530 - else if(hue_diff <= -765) hue_diff += 1530 + if(hue_diff > 765) + hue_diff -= 1530 + else if(hue_diff <= -765) + hue_diff += 1530 var/hue = round(HSV1[1] + hue_diff * amount, 1) var/sat = round(HSV1[2] + (HSV2[2] - HSV1[2]) * amount, 1) @@ -526,8 +581,10 @@ world var/alpha = usealpha ? round(HSV1[4] + (HSV2[4] - HSV1[4]) * amount, 1) : null // normalize hue - if(hue < 0 || hue >= 1530) hue %= 1530 - if(hue < 0) hue += 1530 + if(hue < 0 || hue >= 1530) + hue %= 1530 + if(hue < 0) + hue += 1530 // decompress hue hue += round(hue / 255) @@ -547,8 +604,10 @@ world var/list/RGB2 = ReadRGB(rgb2) // add missing alpha if needed - if(RGB1.len < RGB2.len) RGB1 += 255 - else if(RGB2.len < RGB1.len) RGB2 += 255 + if(RGB1.len < RGB2.len) + RGB1 += 255 + else if(RGB2.len < RGB1.len) + RGB2 += 255 var/usealpha = RGB1.len > 3 var/r = round(RGB1[1] + (RGB2[1] - RGB1[1]) * amount, 1) @@ -563,15 +622,18 @@ world /proc/HueToAngle(hue) // normalize hsv in case anything is screwy - if(hue < 0 || hue >= 1536) hue %= 1536 - if(hue < 0) hue += 1536 + if(hue < 0 || hue >= 1536) + hue %= 1536 + if(hue < 0) + hue += 1536 // Compress hue into easier-to-manage range hue -= hue >> 8 return hue / (1530/360) /proc/AngleToHue(angle) // normalize hsv in case anything is screwy - if(angle < 0 || angle >= 360) angle -= 360 * round(angle / 360) + if(angle < 0 || angle >= 360) + angle -= 360 * round(angle / 360) var/hue = angle * (1530/360) // Decompress hue hue += round(hue / 255) @@ -583,18 +645,23 @@ world var/list/HSV = ReadHSV(hsv) // normalize hsv in case anything is screwy - if(HSV[1] >= 1536) HSV[1] %= 1536 - if(HSV[1] < 0) HSV[1] += 1536 + if(HSV[1] >= 1536) + HSV[1] %= 1536 + if(HSV[1] < 0) + HSV[1] += 1536 // Compress hue into easier-to-manage range HSV[1] -= HSV[1] >> 8 - if(angle < 0 || angle >= 360) angle -= 360 * round(angle / 360) + if(angle < 0 || angle >= 360) + angle -= 360 * round(angle / 360) HSV[1] = round(HSV[1] + angle * (1530/360), 1) // normalize hue - if(HSV[1] < 0 || HSV[1] >= 1530) HSV[1] %= 1530 - if(HSV[1] < 0) HSV[1] += 1530 + if(HSV[1] < 0 || HSV[1] >= 1530) + HSV[1] %= 1530 + if(HSV[1] < 0) + HSV[1] += 1530 // decompress hue HSV[1] += round(HSV[1] / 255) @@ -614,8 +681,10 @@ world var/gray = RGB[1]*0.3 + RGB[2]*0.59 + RGB[3]*0.11 var/tone_gray = TONE[1]*0.3 + TONE[2]*0.59 + TONE[3]*0.11 - if(gray <= tone_gray) return BlendRGB("#000000", tone, gray/(tone_gray || 1)) - else return BlendRGB(tone, "#ffffff", (gray-tone_gray)/((255-tone_gray) || 1)) + if(gray <= tone_gray) + return BlendRGB("#000000", tone, gray/(tone_gray || 1)) + else + return BlendRGB(tone, "#ffffff", (gray-tone_gray)/((255-tone_gray) || 1)) //Used in the OLD chem colour mixing algorithm @@ -715,7 +784,8 @@ The _flatIcons list is a cache for generated icon files. var/image/I = current currentLayer = I.layer if(currentLayer<0) // Special case for FLY_LAYER - if(currentLayer <= -1000) return flat + if(currentLayer <= -1000) + return flat if(pSet == 0) // Underlay currentLayer = A.layer+currentLayer/1000 else // Overlay diff --git a/code/__HELPERS/maths.dm b/code/__HELPERS/maths.dm index 41d2f721f597..10c0ea52e9d7 100644 --- a/code/__HELPERS/maths.dm +++ b/code/__HELPERS/maths.dm @@ -13,7 +13,8 @@ GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, return x!=0?x/abs(x):0 /proc/Atan2(x, y) - if(!x && !y) return 0 + if(!x && !y) + return 0 var/a = arccos(x / sqrt(x*x + y*y)) return y >= 0 ? a : -a @@ -98,10 +99,12 @@ GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, . = list() var/d = b*b - 4 * a * c var/bottom = 2 * a - if(d < 0) return + if(d < 0) + return var/root = sqrt(d) . += (-b + root) / bottom - if(!d) return + if(!d) + return . += (-b - root) / bottom // tangent diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index a20cad1cf2b9..5f01d61ed06d 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -137,7 +137,8 @@ Turf and target are separate in case you want to teleport some distance from a t return if(destination.y>world.maxy || destination.y<1) return - else return + else + return return destination diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm index 1f7121ba0e3f..95810c869bad 100644 --- a/code/_onclick/adjacent.dm +++ b/code/_onclick/adjacent.dm @@ -76,7 +76,8 @@ // This is necessary for storage items not on your person. /obj/item/Adjacent(var/atom/neighbor, var/recurse = 1) - if(neighbor == loc) return 1 + if(neighbor == loc) + return 1 if(isitem(loc)) if(recurse > 0) return loc.Adjacent(neighbor,recurse - 1) diff --git a/code/_onclick/drag_drop.dm b/code/_onclick/drag_drop.dm index e7d5755962dc..3d62cdd0ac0c 100644 --- a/code/_onclick/drag_drop.dm +++ b/code/_onclick/drag_drop.dm @@ -6,11 +6,12 @@ almost anything into a trash can. */ /atom/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params) - if(!usr || !over) + if(!usr || !over) return if(over == src) return usr.client.Click(src, src_location, src_control, params) - if(!Adjacent(usr) || !over.Adjacent(usr)) return // should stop you from dragging through windows + if(!Adjacent(usr) || !over.Adjacent(usr)) + return // should stop you from dragging through windows over.MouseDrop_T(src,usr) return diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 638b4a31cf56..b5e72b791480 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -577,8 +577,10 @@ so as to remain in compliance with the most up-to-date laws." var/atom/target = null /obj/screen/alert/hackingapc/Click() - if(!usr || !usr.client) return - if(!target) return + if(!usr || !usr.client) + return + if(!target) + return var/mob/living/silicon/ai/AI = usr var/turf/T = get_turf(target) if(T) @@ -601,7 +603,8 @@ so as to remain in compliance with the most up-to-date laws." timeout = 300 /obj/screen/alert/notify_cloning/Click() - if(!usr || !usr.client) return + if(!usr || !usr.client) + return var/mob/dead/observer/G = usr G.reenter_corpse() @@ -614,10 +617,13 @@ so as to remain in compliance with the most up-to-date laws." var/action = NOTIFY_JUMP /obj/screen/alert/notify_action/Click() - if(!usr || !usr.client) return - if(!target) return + if(!usr || !usr.client) + return + if(!target) + return var/mob/dead/observer/G = usr - if(!istype(G)) return + if(!istype(G)) + return switch(action) if(NOTIFY_ATTACK) target.attack_ghost(G) diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 62683584fa0b..526683c65ecf 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -180,7 +180,8 @@ /datum/hud/proc/toggle_show_robot_modules() - if(!iscyborg(mymob)) return + if(!iscyborg(mymob)) + return var/mob/living/silicon/robot/R = mymob @@ -188,7 +189,8 @@ update_robot_modules_display() /datum/hud/proc/update_robot_modules_display(mob/viewer) - if(!iscyborg(mymob)) return + if(!iscyborg(mymob)) + return var/mob/living/silicon/robot/R = mymob diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 94799437868d..b2b516a3b89c 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -324,7 +324,8 @@ usr.stop_pulling() /obj/screen/pull/update_icon(mob/mymob) - if(!mymob) return + if(!mymob) + return if(mymob.pulling) icon_state = "pull" else diff --git a/code/controllers/subsystem/dbcore.dm b/code/controllers/subsystem/dbcore.dm index 864274b8fb0d..f610cde218f9 100644 --- a/code/controllers/subsystem/dbcore.dm +++ b/code/controllers/subsystem/dbcore.dm @@ -281,16 +281,29 @@ Delayed insert mode was removed in mysql 7 and only works with MyISAM type table /datum/DBColumn/proc/SqlTypeName(type_handler = sql_type) switch(type_handler) - if(TINYINT) return "TINYINT" - if(SMALLINT) return "SMALLINT" - if(MEDIUMINT) return "MEDIUMINT" - if(INTEGER) return "INTEGER" - if(BIGINT) return "BIGINT" - if(FLOAT) return "FLOAT" - if(DOUBLE) return "DOUBLE" - if(DATE) return "DATE" - if(DATETIME) return "DATETIME" - if(TIMESTAMP) return "TIMESTAMP" - if(TIME) return "TIME" - if(STRING) return "STRING" - if(BLOB) return "BLOB" + if(TINYINT) + return "TINYINT" + if(SMALLINT) + return "SMALLINT" + if(MEDIUMINT) + return "MEDIUMINT" + if(INTEGER) + return "INTEGER" + if(BIGINT) + return "BIGINT" + if(FLOAT) + return "FLOAT" + if(DOUBLE) + return "DOUBLE" + if(DATE) + return "DATE" + if(DATETIME) + return "DATETIME" + if(TIMESTAMP) + return "TIMESTAMP" + if(TIME) + return "TIME" + if(STRING) + return "STRING" + if(BLOB) + return "BLOB" diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index d202c08d3944..689ff8393513 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -385,7 +385,8 @@ SUBSYSTEM_DEF(garbage) find_references(TRUE) /datum/proc/DoSearchVar(X, Xname) - if(usr && usr.client && !usr.client.running_find_references) return + if(usr && usr.client && !usr.client.running_find_references) + return if(istype(X, /datum)) var/datum/D = X if(D.last_find_references == last_find_references) diff --git a/code/datums/browser.dm b/code/datums/browser.dm index c854d20f18fb..9092cae09e42 100644 --- a/code/datums/browser.dm +++ b/code/datums/browser.dm @@ -249,7 +249,8 @@ // Otherwise, the user mob's machine var will be reset directly. // /proc/onclose(mob/user, windowid, atom/ref=null) - if(!user.client) return + if(!user.client) + return var/param = "null" if(ref) param = "\ref[ref]" diff --git a/code/datums/diseases/pierrot_throat.dm b/code/datums/diseases/pierrot_throat.dm index adaf78375cea..ba2a43792f78 100644 --- a/code/datums/diseases/pierrot_throat.dm +++ b/code/datums/diseases/pierrot_throat.dm @@ -15,10 +15,14 @@ ..() switch(stage) if(1) - if(prob(10)) to_chat(affected_mob, "You feel a little silly.") + if(prob(10)) + to_chat(affected_mob, "You feel a little silly.") if(2) - if(prob(10)) to_chat(affected_mob, "You start seeing rainbows.") + if(prob(10)) + to_chat(affected_mob, "You start seeing rainbows.") if(3) - if(prob(10)) to_chat(affected_mob, "Your thoughts are interrupted by a loud HONK!") + if(prob(10)) + to_chat(affected_mob, "Your thoughts are interrupted by a loud HONK!") if(4) - if(prob(5)) affected_mob.say( pick( list("HONK!", "Honk!", "Honk.", "Honk?", "Honk!!", "Honk?!", "Honk...") ) ) + if(prob(5)) + affected_mob.say( pick( list("HONK!", "Honk!", "Honk.", "Honk?", "Honk!!", "Honk?!", "Honk...") ) ) diff --git a/code/datums/diseases/wizarditis.dm b/code/datums/diseases/wizarditis.dm index eed96dc634a4..66d81804b850 100644 --- a/code/datums/diseases/wizarditis.dm +++ b/code/datums/diseases/wizarditis.dm @@ -95,8 +95,10 @@ STI KALY - blind var/list/L = list() for(var/turf/T in get_area_turfs(thearea.type)) - if(T.z != affected_mob.z) continue - if(T.name == "space") continue + if(T.z != affected_mob.z) + continue + if(T.name == "space") + continue if(!T.density) var/clear = 1 for(var/obj/O in T) diff --git a/code/datums/martial/wrestling.dm b/code/datums/martial/wrestling.dm index 02e2d9614db9..ae7146ca33f0 100644 --- a/code/datums/martial/wrestling.dm +++ b/code/datums/martial/wrestling.dm @@ -358,9 +358,12 @@ for (var/obj/O in oview(1, A)) if (O.density == 1) - if (O == A) continue - if (O == D) continue - if (O.opacity) continue + if (O == A) + continue + if (O == D) + continue + if (O.opacity) + continue else surface = O ST = get_turf(O) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 809222ec0188..e8724eb7175b 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -290,7 +290,8 @@ uplink_loc = R if (!uplink_loc) - if(!silent) to_chat(traitor_mob, "Unfortunately, [employer] wasn't able to get you an Uplink.") + if(!silent) + to_chat(traitor_mob, "Unfortunately, [employer] wasn't able to get you an Uplink.") . = 0 else var/obj/item/device/uplink/U = new(uplink_loc) @@ -300,19 +301,22 @@ if(uplink_loc == R) R.traitor_frequency = sanitize_frequency(rand(MIN_FREQ, MAX_FREQ)) - if(!silent) to_chat(traitor_mob, "[employer] has cunningly disguised a Syndicate Uplink as your [R.name]. Simply dial the frequency [format_frequency(R.traitor_frequency)] to unlock its hidden features.") + if(!silent) + to_chat(traitor_mob, "[employer] has cunningly disguised a Syndicate Uplink as your [R.name]. Simply dial the frequency [format_frequency(R.traitor_frequency)] to unlock its hidden features.") traitor_mob.mind.store_memory("Radio Frequency: [format_frequency(R.traitor_frequency)] ([R.name]).") else if(uplink_loc == PDA) PDA.lock_code = "[rand(100,999)] [pick(GLOB.phonetic_alphabet)]" - if(!silent) to_chat(traitor_mob, "[employer] has cunningly disguised a Syndicate Uplink as your [PDA.name]. Simply enter the code \"[PDA.lock_code]\" into the ringtone select to unlock its hidden features.") + if(!silent) + to_chat(traitor_mob, "[employer] has cunningly disguised a Syndicate Uplink as your [PDA.name]. Simply enter the code \"[PDA.lock_code]\" into the ringtone select to unlock its hidden features.") traitor_mob.mind.store_memory("Uplink Passcode: [PDA.lock_code] ([PDA.name]).") else if(uplink_loc == P) P.traitor_unlock_degrees = rand(1, 360) - if(!silent) to_chat(traitor_mob, "[employer] has cunningly disguised a Syndicate Uplink as your [P.name]. Simply twist the top of the pen [P.traitor_unlock_degrees] from its starting position to unlock its hidden features.") + if(!silent) + to_chat(traitor_mob, "[employer] has cunningly disguised a Syndicate Uplink as your [P.name]. Simply twist the top of the pen [P.traitor_unlock_degrees] from its starting position to unlock its hidden features.") traitor_mob.mind.store_memory("Uplink Degrees: [P.traitor_unlock_degrees] ([P.name]).") //Link a new mobs mind to the creator of said mob. They will join any team they are currently on, and will only switch teams when their creator does. diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index fafd057fea37..d6f15b25e8da 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -89,7 +89,8 @@ GLOBAL_LIST_EMPTY(teleportlocs) // want to find machines, mobs, etc, in the same logical area, you will need to check all the // related areas. This returns a master contents list to assist in that. /proc/area_contents(area/A) - if(!istype(A)) return null + if(!istype(A)) + return null var/list/contents = list() for(var/area/LSA in A.related) contents += LSA.contents diff --git a/code/game/atoms.dm b/code/game/atoms.dm index b37a46161124..0a9a7918e95b 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -445,7 +445,8 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) return 1 /atom/proc/get_global_map_pos() - if(!islist(GLOB.global_map) || isemptylist(GLOB.global_map)) return + if(!islist(GLOB.global_map) || isemptylist(GLOB.global_map)) + return var/cur_x = null var/cur_y = null var/list/y_arr = null diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 4f7ab6366d46..70bbb44a77aa 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -61,7 +61,8 @@ return ..() /atom/movable/Move(atom/newloc, direct = 0) - if(!loc || !newloc) return 0 + if(!loc || !newloc) + return 0 var/atom/oldloc = loc if(loc != newloc) diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 143842fe0748..84255da890d7 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -8,10 +8,12 @@ /* DATA HUD DATUMS */ /atom/proc/add_to_all_human_data_huds() - for(var/datum/atom_hud/data/human/hud in GLOB.huds) hud.add_to_hud(src) + for(var/datum/atom_hud/data/human/hud in GLOB.huds) + hud.add_to_hud(src) /atom/proc/remove_from_all_data_huds() - for(var/datum/atom_hud/data/hud in GLOB.huds) hud.remove_from_hud(src) + for(var/datum/atom_hud/data/hud in GLOB.huds) + hud.remove_from_hud(src) /datum/atom_hud/data @@ -21,10 +23,13 @@ /datum/atom_hud/data/human/medical/basic /datum/atom_hud/data/human/medical/basic/proc/check_sensors(mob/living/carbon/human/H) - if(!istype(H)) return 0 + if(!istype(H)) + return 0 var/obj/item/clothing/under/U = H.w_uniform - if(!istype(U)) return 0 - if(U.sensor_mode <= SENSOR_VITALS) return 0 + if(!istype(U)) + return 0 + if(U.sensor_mode <= SENSOR_VITALS) + return 0 return 1 /datum/atom_hud/data/human/medical/basic/add_to_single_hud(mob/M, mob/living/carbon/H) @@ -132,7 +137,8 @@ B.update_suit_sensors(src) var/turf/T = get_turf(src) - if (T) GLOB.crewmonitor.queueUpdate(T.z) + if (T) + GLOB.crewmonitor.queueUpdate(T.z) //called when a living mob changes health /mob/living/proc/med_hud_set_health() @@ -192,7 +198,8 @@ sec_hud_set_security_status() var/turf/T = get_turf(src) - if (T) GLOB.crewmonitor.queueUpdate(T.z) + if (T) + GLOB.crewmonitor.queueUpdate(T.z) /mob/living/carbon/human/proc/sec_hud_set_implants() var/image/holder diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index c560b8cef0bd..259c3d491f5f 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -67,7 +67,8 @@ GLOBAL_LIST_INIT(slot2type, list("head" = /obj/item/clothing/head/changeling, "w if(antag_candidates.len>0) for(var/i = 0, i < num_changelings, i++) - if(!antag_candidates.len) break + if(!antag_candidates.len) + break var/datum/mind/changeling = pick(antag_candidates) antag_candidates -= changeling changelings += changeling diff --git a/code/game/gamemodes/changeling/traitor_chan.dm b/code/game/gamemodes/changeling/traitor_chan.dm index af33b649edb2..883430ae84c2 100644 --- a/code/game/gamemodes/changeling/traitor_chan.dm +++ b/code/game/gamemodes/changeling/traitor_chan.dm @@ -42,7 +42,8 @@ if(possible_changelings.len>0) for(var/j = 0, j < num_changelings, j++) - if(!possible_changelings.len) break + if(!possible_changelings.len) + break var/datum/mind/changeling = pick(possible_changelings) antag_candidates -= changeling possible_changelings -= changeling diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index b405cc935c45..743a4aea3c36 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -25,7 +25,8 @@ if(!(AT.z in GLOB.station_z_levels)) //Only check one, it's enough. skip = 1 break - if(skip) continue + if(skip) + continue A.power_light = FALSE A.power_equip = FALSE A.power_environ = FALSE @@ -40,7 +41,8 @@ if(istype(A,area_type)) skip = 1 break - if(skip) continue + if(skip) + continue C.cell.charge = 0 diff --git a/code/game/gamemodes/miniantags/abduction/gland.dm b/code/game/gamemodes/miniantags/abduction/gland.dm index 8c408c007e49..a3d69c45b942 100644 --- a/code/game/gamemodes/miniantags/abduction/gland.dm +++ b/code/game/gamemodes/miniantags/abduction/gland.dm @@ -242,10 +242,12 @@ /obj/item/organ/heart/gland/plasma/activate() to_chat(owner, "You feel bloated.") sleep(150) - if(!owner) return + if(!owner) + return to_chat(owner, "A massive stomachache overcomes you.") sleep(50) - if(!owner) return + if(!owner) + return owner.visible_message("[owner] vomits a cloud of plasma!") var/turf/open/T = get_turf(owner) if(istype(T)) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 424ea3242340..b65cea8bfc1d 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -409,14 +409,17 @@ GLOBAL_LIST_EMPTY(possible_items) /datum/objective/steal/proc/select_target() //For admins setting objectives manually. var/list/possible_items_all = GLOB.possible_items+"custom" var/new_target = input("Select target:", "Objective target", steal_target) as null|anything in possible_items_all - if (!new_target) return + if (!new_target) + return if (new_target == "custom") //Can set custom items. var/obj/item/custom_target = input("Select type:","Type") as null|anything in typesof(/obj/item) - if (!custom_target) return + if (!custom_target) + return var/custom_name = initial(custom_target.name) custom_name = stripped_input("Enter target name:", "Objective target", custom_name) - if (!custom_name) return + if (!custom_name) + return steal_target = custom_target explanation_text = "Steal [custom_name]." @@ -578,7 +581,7 @@ GLOBAL_LIST_EMPTY(possible_items_special) for(var/datum/mind/M in owners) if(!owner || !owner.changeling || !owner.changeling.stored_profiles) continue - absorbedcount += M.changeling.absorbedcount + absorbedcount += M.changeling.absorbedcount return absorbedcount >= target_amount diff --git a/code/game/gamemodes/sandbox/airlock_maker.dm b/code/game/gamemodes/sandbox/airlock_maker.dm index 96e93c19fce4..311f65c4602b 100644 --- a/code/game/gamemodes/sandbox/airlock_maker.dm +++ b/code/game/gamemodes/sandbox/airlock_maker.dm @@ -69,7 +69,8 @@ usr << browse(dat,"window=airlockmaker") /datum/airlock_maker/Topic(var/href,var/list/href_list) - if(!usr) return + if(!usr) + return if(!src || !linked || !linked.loc) usr << browse(null,"window=airlockmaker") return diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index 395369f6f896..177e051ff992 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -112,7 +112,8 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE) // Admin: toggle spawning // if("hsbtobj") - if(!admin) return + if(!admin) + return if(GLOB.hsboxspawn) to_chat(world, "Sandbox: \black[usr.key] has disabled object spawning!") GLOB.hsboxspawn = FALSE @@ -125,7 +126,8 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE) // Admin: Toggle auto-close // if("hsbtac") - if(!admin) return + if(!admin) + return if(config.sandbox_autoclose) to_chat(world, "Sandbox: \black [usr.key] has removed the object spawn limiter.") config.sandbox_autoclose = FALSE @@ -138,7 +140,8 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE) // if("hsbsuit") var/mob/living/carbon/human/P = usr - if(!istype(P)) return + if(!istype(P)) + return if(P.wear_suit) P.wear_suit.loc = P.loc P.wear_suit.layer = initial(P.wear_suit.layer) @@ -216,7 +219,8 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE) // Spawn check due to grief potential (destroying floors, walls, etc) // if("hsbrcd") - if(!GLOB.hsboxspawn) return + if(!GLOB.hsboxspawn) + return new/obj/item/construction/rcd/combat(usr.loc) @@ -232,7 +236,8 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE) // Clothing if("hsbcloth") - if(!GLOB.hsboxspawn) return + if(!GLOB.hsboxspawn) + return if(!clothinfo) clothinfo = "Clothing (Reagent Containers) (Other Items)

" @@ -246,7 +251,8 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE) // Reagent containers if("hsbreag") - if(!GLOB.hsboxspawn) return + if(!GLOB.hsboxspawn) + return if(!reaginfo) reaginfo = "Reagent Containers (Clothing) (Other Items)

" @@ -260,7 +266,8 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE) // Other items if("hsbobj") - if(!GLOB.hsboxspawn) return + if(!GLOB.hsboxspawn) + return if(!objinfo) objinfo = "Other Items (Clothing) (Reagent Containers)

" diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index b070de1b1c0d..5bca39780b27 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -475,14 +475,17 @@ Class Procs: // Hook for html_interface module to prevent updates to clients who don't have this as their active machine. /obj/machinery/proc/hiIsValidClient(datum/html_interface_client/hclient, datum/html_interface/hi) if (hclient.client.mob && (hclient.client.mob.stat == 0 || IsAdminGhost(hclient.client.mob))) - if (isAI(hclient.client.mob) || IsAdminGhost(hclient.client.mob)) return TRUE - else return hclient.client.mob.machine == src && Adjacent(hclient.client.mob) + if (isAI(hclient.client.mob) || IsAdminGhost(hclient.client.mob)) + return TRUE + else + return hclient.client.mob.machine == src && Adjacent(hclient.client.mob) else return FALSE // Hook for html_interface module to unset the active machine when the window is closed by the player. /obj/machinery/proc/hiOnHide(datum/html_interface_client/hclient) - if (hclient.client.mob && hclient.client.mob.machine == src) hclient.client.mob.unset_machine() + if (hclient.client.mob && hclient.client.mob.machine == src) + hclient.client.mob.unset_machine() /obj/machinery/proc/can_be_overridden() . = 1 diff --git a/code/game/machinery/airlock_control.dm b/code/game/machinery/airlock_control.dm index 54c20bfb19cd..3717501db166 100644 --- a/code/game/machinery/airlock_control.dm +++ b/code/game/machinery/airlock_control.dm @@ -8,9 +8,11 @@ /obj/machinery/door/airlock/receive_signal(datum/signal/signal) - if(!signal || signal.encryption) return + if(!signal || signal.encryption) + return - if(id_tag != signal.data["tag"] || !signal.data["command"]) return + if(id_tag != signal.data["tag"] || !signal.data["command"]) + return switch(signal.data["command"]) if("open") @@ -63,12 +65,14 @@ /obj/machinery/door/airlock/open(surpress_send) . = ..() - if(!surpress_send) send_status() + if(!surpress_send) + send_status() /obj/machinery/door/airlock/close(surpress_send) . = ..() - if(!surpress_send) send_status() + if(!surpress_send) + send_status() /obj/machinery/door/airlock/proc/set_frequency(new_frequency) diff --git a/code/game/machinery/camera/motion.dm b/code/game/machinery/camera/motion.dm index dbfaabef5283..97e7e101b147 100644 --- a/code/game/machinery/camera/motion.dm +++ b/code/game/machinery/camera/motion.dm @@ -57,7 +57,8 @@ return 1 /obj/machinery/camera/proc/triggerAlarm() - if (!detectTime) return 0 + if (!detectTime) + return 0 for (var/mob/living/silicon/aiPlayer in GLOB.player_list) if (status) aiPlayer.triggerAlarm("Motion", get_area(src), list(src), src) diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index 864ab2bff2fb..ba72d9676d00 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -53,7 +53,8 @@ var/area/A = get_area(src) if(A) for(var/obj/machinery/camera/autoname/C in GLOB.machines) - if(C == src) continue + if(C == src) + continue var/area/CA = get_area(C) if(CA.type == A.type) if(C.number) diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index 457abb325930..f5115c7e2a15 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -60,12 +60,14 @@ radio_connection = SSradio.add_object(src, receive_frequency, GLOB.RADIO_ATMOSIA) /obj/machinery/computer/atmos_alert/receive_signal(datum/signal/signal) - if(!signal || signal.encryption) return + if(!signal || signal.encryption) + return var/zone = signal.data["zone"] var/severity = signal.data["alert"] - if(!zone || !severity) return + if(!zone || !severity) + return minor_alarms -= zone priority_alarms -= zone diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index db2bfedd7c7d..2d6c03eebb5b 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -24,7 +24,8 @@ playsound(src.loc, P.usesound, 50, 1) to_chat(user, "You start deconstructing the frame...") if(do_after(user, 20*P.toolspeed, target = src)) - if(!src || !WT.isOn()) return + if(!src || !WT.isOn()) + return to_chat(user, "You deconstruct the frame.") var/obj/item/stack/sheet/metal/M = new (loc, 5) M.add_fingerprint(user) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index bd203772cb4d..7de64f8aa798 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -103,9 +103,12 @@ if (I && istype(I)) if(ACCESS_CAPTAIN in I.access) var/old_level = GLOB.security_level - if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN - if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN - if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this + if(!tmp_alertlevel) + tmp_alertlevel = SEC_LEVEL_GREEN + if(tmp_alertlevel < SEC_LEVEL_GREEN) + tmp_alertlevel = SEC_LEVEL_GREEN + if(tmp_alertlevel > SEC_LEVEL_BLUE) + tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this set_security_level(tmp_alertlevel) if(GLOB.security_level != old_level) to_chat(usr, "Authorization confirmed. Modifying security level.") @@ -230,7 +233,8 @@ if("securitylevel") src.tmp_alertlevel = text2num( href_list["newalertlevel"] ) - if(!tmp_alertlevel) tmp_alertlevel = 0 + if(!tmp_alertlevel) + tmp_alertlevel = 0 state = STATE_CONFIRM_LEVEL if("changeseclevel") state = STATE_ALERT_LEVEL @@ -356,11 +360,15 @@ make_announcement(usr, 1) if("ai-securitylevel") src.tmp_alertlevel = text2num( href_list["newalertlevel"] ) - if(!tmp_alertlevel) tmp_alertlevel = 0 + if(!tmp_alertlevel) + tmp_alertlevel = 0 var/old_level = GLOB.security_level - if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN - if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN - if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this + if(!tmp_alertlevel) + tmp_alertlevel = SEC_LEVEL_GREEN + if(tmp_alertlevel < SEC_LEVEL_GREEN) + tmp_alertlevel = SEC_LEVEL_GREEN + if(tmp_alertlevel > SEC_LEVEL_BLUE) + tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this set_security_level(tmp_alertlevel) if(GLOB.security_level != old_level) //Only notify the admins if an actual change happened @@ -670,7 +678,8 @@ var/datum/radio_frequency/frequency = SSradio.return_frequency(1435) - if(!frequency) return + if(!frequency) + return var/datum/signal/status_signal = new status_signal.source = src diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index 9b5e14963fc8..2b46f1959ccf 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -93,7 +93,8 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) /datum/crewmonitor/proc/show(mob/mob, z) if (mob.client) sendResources(mob.client) - if (!z) z = mob.z + if (!z) + z = mob.z if (z > 0 && src.interfaces) var/datum/html_interface/hi @@ -160,7 +161,8 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) pos = H.z == 0 || U.sensor_mode == SENSOR_COORDS ? get_turf(H) : null // Special case: If the mob is inside an object confirm the z-level on turf level. - if (H.z == 0 && (!pos || pos.z != z)) continue + if (H.z == 0 && (!pos || pos.z != z)) + continue I = H.wear_id ? H.wear_id.GetID() : null @@ -173,8 +175,10 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) assignment = "" ijob = 80 - if (U.sensor_mode >= SENSOR_LIVING) life_status = (!H.stat ? "true" : "false") - else life_status = null + if (U.sensor_mode >= SENSOR_LIVING) + life_status = (!H.stat ? "true" : "false") + else + life_status = null if (U.sensor_mode >= SENSOR_VITALS) dam1 = round(H.getOxyLoss(),1) @@ -188,7 +192,8 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) dam4 = null if (U.sensor_mode >= SENSOR_COORDS) - if (!pos) pos = get_turf(H) + if (!pos) + pos = get_turf(H) var/area/player_area = get_area(H) area = format_text(player_area.name) @@ -208,13 +213,15 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) var/z = "" for (z in src.interfaces) - if (src.interfaces[z] == hi) break + if (src.interfaces[z] == hi) + break if(hclient.client.mob && IsAdminGhost(hclient.client.mob)) return TRUE if (hclient.client.mob && hclient.client.mob.stat == 0 && hclient.client.mob.z == text2num(z)) - if (isAI(hclient.client.mob)) return TRUE + if (isAI(hclient.client.mob)) + return TRUE else if (iscyborg(hclient.client.mob)) return (locate(/obj/machinery/computer/crew, range(world.view, hclient.client.mob))) || (locate(/obj/item/device/sensor_device, hclient.client.mob.contents)) else @@ -238,8 +245,10 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) var/obj/machinery/camera/C = locate(/obj/machinery/camera) in range(5, tile) - if (!C) C = locate(/obj/machinery/camera) in urange(10, tile) - if (!C) C = locate(/obj/machinery/camera) in urange(15, tile) + if (!C) + C = locate(/obj/machinery/camera) in urange(10, tile) + if (!C) + C = locate(/obj/machinery/camera) in urange(15, tile) if (C) addtimer(CALLBACK(src, .proc/update_ai, AI, C, AI.eyeobj.loc), min(30, get_dist(get_turf(C), AI.eyeobj) / 4)) @@ -254,7 +263,8 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) . = ..() - if (old_z != src.z) GLOB.crewmonitor.queueUpdate(old_z) + if (old_z != src.z) + GLOB.crewmonitor.queueUpdate(old_z) GLOB.crewmonitor.queueUpdate(src.z) else return ..() diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index aafe74f2b371..913d6f632613 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -67,7 +67,8 @@ ShowInterface(user) /obj/machinery/computer/scan_consolenew/proc/ShowInterface(mob/user, last_change) - if(!user) return + if(!user) + return var/datum/browser/popup = new(user, "scannernew", "DNA Modifier Console", 800, 630) // Set up the popup browser window if(!(in_range(src, user) || issilicon(user))) popup.close() diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 2a0f5ecb3a4c..5470380ca5ab 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -82,7 +82,8 @@ if(hacking || emagged) screen = 2 else if(!auth || !linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) - if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) message = noserver + if(!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN))) + message = noserver screen = 0 switch(screen) @@ -267,7 +268,8 @@ //Turn the server on/off. if (href_list["active"]) - if(auth) linkedServer.active = !linkedServer.active + if(auth) + linkedServer.active = !linkedServer.active //Find a server if (href_list["find"]) if(GLOB.message_servers && GLOB.message_servers.len > 1) diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index a7626258ae7b..620fd5140235 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -96,7 +96,8 @@ return I.loc = src inserted_id = I - else to_chat(usr, "No valid ID.") + else + to_chat(usr, "No valid ID.") else if(inserted_id) switch(href_list["id"]) if("eject") diff --git a/code/game/machinery/embedded_controller/airlock_controller.dm b/code/game/machinery/embedded_controller/airlock_controller.dm index 1fdc5d4a4c0e..2b0bb2511124 100644 --- a/code/game/machinery/embedded_controller/airlock_controller.dm +++ b/code/game/machinery/embedded_controller/airlock_controller.dm @@ -19,7 +19,8 @@ /datum/computer/file/embedded_program/airlock_controller/receive_signal(datum/signal/signal, receive_method, receive_param) var/receive_tag = signal.data["tag"] - if(!receive_tag) return + if(!receive_tag) + return if(receive_tag==sensor_tag) if(signal.data["pressure"]) diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm index 02eee65369b6..dacc0aa28862 100644 --- a/code/game/machinery/embedded_controller/embedded_controller_base.dm +++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm @@ -44,7 +44,8 @@ return 0 /obj/machinery/embedded_controller/receive_signal(datum/signal/signal, receive_method, receive_param) - if(!signal || signal.encryption) return + if(!signal || signal.encryption) + return if(program) program.receive_signal(signal, receive_method, receive_param) diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index d0d40e72338b..051c26bee6fb 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -166,7 +166,8 @@ /obj/machinery/magnetic_module/proc/magnetic_process() // proc that actually does the pulling - if(pulling) return + if(pulling) + return while(on) pulling = 1 @@ -333,7 +334,8 @@ updateUsrDialog() /obj/machinery/magnetic_controller/proc/MagnetMove() - if(looping) return + if(looping) + return while(moving && rpath.len >= 1) diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 872194ee67ff..2f6fe2bdd03e 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -343,7 +343,8 @@ GLOBAL_LIST_EMPTY(allConsoles) if (sending) var/pass = 0 for (var/obj/machinery/message_server/MS in GLOB.machines) - if(!MS.active) continue + if(!MS.active) + continue MS.send_rc_message(href_list["department"],department,log_msg,msgStamped,msgVerified,priority) pass = 1 diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index 928d56a149fa..b8d1535c81f2 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -20,7 +20,8 @@ /obj/machinery/power/singularity_beacon/proc/Activate(mob/user = null) if(surplus() < 1500) - if(user) to_chat(user, "The connected wire doesn't have enough current.") + if(user) + to_chat(user, "The connected wire doesn't have enough current.") return for(var/obj/singularity/singulo in GLOB.singularities) if(singulo.z == z) diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 5638b92b99cb..893ab3838089 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -60,7 +60,8 @@ dat += "
Identification String: NULL" dat += "
Network: [network]" dat += "
Prefabrication: [autolinkers.len ? "TRUE" : "FALSE"]" - if(hide) dat += "
Shadow Link: ACTIVE" + if(hide) + dat += "
Shadow Link: ACTIVE" //Show additional options for certain machines. dat += Options_Menu() diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index 1e7c2b9f206e..982df72b4395 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -46,7 +46,8 @@ log_message("Critical failure",1) /obj/item/mecha_parts/mecha_equipment/proc/get_equip_info() - if(!chassis) return + if(!chassis) + return var/txt = "* " if(chassis.selected == src) txt += "[src.name]" diff --git a/code/game/mecha/equipment/tools/other_tools.dm b/code/game/mecha/equipment/tools/other_tools.dm index e22db80bb7b3..51e27bebcce5 100644 --- a/code/game/mecha/equipment/tools/other_tools.dm +++ b/code/game/mecha/equipment/tools/other_tools.dm @@ -14,7 +14,8 @@ range = RANGED /obj/item/mecha_parts/mecha_equipment/teleporter/action(atom/target) - if(!action_checks(target) || src.loc.z == ZLEVEL_CENTCOM) return + if(!action_checks(target) || src.loc.z == ZLEVEL_CENTCOM) + return var/turf/T = get_turf(target) if(T) do_teleport(chassis, T, 4) @@ -112,7 +113,8 @@ else atoms = orange(3, target) for(var/atom/movable/A in atoms) - if(A.anchored) continue + if(A.anchored) + continue spawn(0) var/iter = 5-get_dist(A,target) for(var/i=0 to iter) @@ -208,7 +210,8 @@ ..() /obj/item/mecha_parts/mecha_equipment/repair_droid/get_equip_info() - if(!chassis) return + if(!chassis) + return return "*  [src.name] - [equip_ready?"A":"Dea"]ctivate" @@ -315,7 +318,8 @@ log_message("Deactivated.") /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/get_equip_info() - if(!chassis) return + if(!chassis) + return return "*  [src.name] - [equip_ready?"A":"Dea"]ctivate" diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index b82f02353c24..8909e6463e11 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -52,7 +52,8 @@ else if(isliving(target)) var/mob/living/M = target - if(M.stat == DEAD) return + if(M.stat == DEAD) + return if(chassis.occupant.a_intent == INTENT_HARM) M.take_overall_damage(dam_force) if(!M) @@ -103,7 +104,8 @@ else if(isliving(target)) var/mob/living/M = target - if(M.stat == DEAD) return + if(M.stat == DEAD) + return if(chassis.occupant.a_intent == INTENT_HARM) target.visible_message("[chassis] destroys [target] in an unholy fury.", \ "[chassis] destroys [target] in an unholy fury.") diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 200f77105893..a1c3bf6ca56c 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -580,7 +580,8 @@ /////////////////////////////////// /obj/mecha/proc/check_for_internal_damage(list/possible_int_damage,ignore_threshold=null) - if(!islist(possible_int_damage) || isemptylist(possible_int_damage)) return + if(!islist(possible_int_damage) || isemptylist(possible_int_damage)) + return if(prob(20)) if(ignore_threshold || obj_integrity*100/max_integrity < internal_damage_threshold) for(var/T in possible_int_damage) diff --git a/code/game/mecha/mecha_topic.dm b/code/game/mecha/mecha_topic.dm index 87009ac292f3..27256d8b0b18 100644 --- a/code/game/mecha/mecha_topic.dm +++ b/code/game/mecha/mecha_topic.dm @@ -159,7 +159,8 @@ /obj/mecha/proc/output_access_dialog(obj/item/card/id/id_card, mob/user) - if(!id_card || !user) return + if(!id_card || !user) + return . = {"