diff --git a/code/__DEFINES/MC.dm b/code/__DEFINES/MC.dm index 49b28ccf638..d790cd095d9 100644 --- a/code/__DEFINES/MC.dm +++ b/code/__DEFINES/MC.dm @@ -28,7 +28,7 @@ #define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;} -#define START_PROCESSING(Processor, Datum) if (!Datum.isprocessing) {Datum.isprocessing = TRUE;Processor.processing += Datum} +#define START_PROCESSING(Processor, Datum) if(!Datum.isprocessing) {Datum.isprocessing = TRUE;Processor.processing += Datum} #define STOP_PROCESSING(Processor, Datum) Datum.isprocessing = FALSE;Processor.processing -= Datum //SubSystem flags (Please design any new flags so that the default is off, to make adding flags to subsystems easier) diff --git a/code/__DEFINES/lighting_defines.dm b/code/__DEFINES/lighting_defines.dm index 667038cd8b8..87bde728432 100644 --- a/code/__DEFINES/lighting_defines.dm +++ b/code/__DEFINES/lighting_defines.dm @@ -120,7 +120,7 @@ GLOBAL_LIST_INIT(em_mask_matrix, EM_MASK_MATRIX) /// Parse the hexadecimal color into lumcounts of each perspective. #define PARSE_LIGHT_COLOR(source) \ do { \ - if (source.light_color) { \ + if(source.light_color) { \ var/__light_color = source.light_color; \ source.lum_r = GETREDPART(__light_color) / 255; \ source.lum_g = GETGREENPART(__light_color) / 255; \ @@ -130,4 +130,4 @@ do { \ source.lum_g = 1; \ source.lum_b = 1; \ }; \ -} while (FALSE) +} while(FALSE) diff --git a/code/__DEFINES/rust_g.dm b/code/__DEFINES/rust_g.dm index 6f4a9a910fb..23b11a55347 100644 --- a/code/__DEFINES/rust_g.dm +++ b/code/__DEFINES/rust_g.dm @@ -19,14 +19,14 @@ /* This comment bypasses grep checks */ /var/__rust_g /proc/__detect_rust_g() - if (world.system_type == UNIX) - if (fexists("./librust_g.so")) + if(world.system_type == UNIX) + if(fexists("./librust_g.so")) // No need for LD_LIBRARY_PATH badness. return __rust_g = "./librust_g.so" - else if (fexists("./rust_g")) + else if(fexists("./rust_g")) // Old dumb filename. return __rust_g = "./rust_g" - else if (fexists("[world.GetConfig("env", "HOME")]/.byond/bin/rust_g")) + else if(fexists("[world.GetConfig("env", "HOME")]/.byond/bin/rust_g")) // Old dumb filename in `~/.byond/bin`. return __rust_g = "rust_g" else @@ -278,7 +278,7 @@ /proc/rustg_read_toml_file(path) var/list/output = rustg_raw_read_toml_file(path) - if (output["success"]) + if(output["success"]) return json_decode(output["content"]) else CRASH(output["content"]) @@ -287,7 +287,7 @@ /proc/rustg_toml_encode(value) var/list/output = rustg_raw_toml_encode(value) - if (output["success"]) + if(output["success"]) return output["content"] else CRASH(output["content"]) diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 8b2ceed2ef8..9ffaedd9351 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -127,7 +127,7 @@ #define RUNLEVELS_DEFAULT (RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME) -// This do{} WHILE (FALSE) syntax may look stupid, but it speeds things up because BYOND memes +// This do{} WHILE(FALSE) syntax may look stupid, but it speeds things up because BYOND memes #define COMPILE_OVERLAYS(A)\ do { \ var/list/ad = A.add_overlays;\ @@ -145,7 +145,7 @@ A.overlays |= po;\ }\ A.flags_2 &= ~OVERLAY_QUEUED_2;\ -} while (FALSE) +} while(FALSE) // SS CPU display category flags #define SS_CPUDISPLAY_LOW 1 diff --git a/code/__HELPERS/bitflag_lists.dm b/code/__HELPERS/bitflag_lists.dm index a665d92cd41..ace6e0720ac 100644 --- a/code/__HELPERS/bitflag_lists.dm +++ b/code/__HELPERS/bitflag_lists.dm @@ -22,4 +22,4 @@ GLOBAL_LIST_EMPTY(bitflag_lists) GLOB.bitflag_lists[txt_signature] = new_bitflag_list; \ }; \ target = GLOB.bitflag_lists[txt_signature]; \ - } while (FALSE) + } while(FALSE) diff --git a/code/__HELPERS/debugger.dm b/code/__HELPERS/debugger.dm index 481ee8892d6..e66fa8b3eb1 100644 --- a/code/__HELPERS/debugger.dm +++ b/code/__HELPERS/debugger.dm @@ -13,12 +13,12 @@ /world/proc/enable_auxtools_debugger() var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") - if (debug_server) + if(debug_server) CALL_EXT(debug_server, "auxtools_init")() enable_debugging() // Called in world/Del(). This is VERY important, otherwise you get phantom threads which try to lookup RAM they arent allowed to /world/proc/disable_auxtools_debugger() var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") - if (debug_server) + if(debug_server) CALL_EXT(debug_server, "auxtools_shutdown")() diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index f14c9e0a7de..397c05c466c 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -62,7 +62,7 @@ var/list/exploded = splittext(path, ".") var/extension = exploded[length(exploded)] - if( !fexists(path) || !(extension in valid_extensions) ) + if(!fexists(path) || !(extension in valid_extensions)) to_chat(src, "Error: browse_files(): File not found/Invalid file([path]).") return diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index ac36ea86129..f784be66aef 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -111,7 +111,7 @@ var/datum/robolimb/R = new limb_type() GLOB.all_robolimbs[R.company] = R if(!R.unavailable_at_chargen) - if(R != "head" && R != "chest" && R != "groin" ) //Part of the method that ensures only IPCs can access head, chest and groin prosthetics. + if(R != "head" && R != "chest" && R != "groin") //Part of the method that ensures only IPCs can access head, chest and groin prosthetics. if(R.has_subtypes) //Ensures solos get added to the list as well be incorporating has_subtypes == 1 and has_subtypes == 2. GLOB.chargen_robolimbs[R.company] = R //List only main brands and solo parts. if(R.selectable) diff --git a/code/__HELPERS/icon_helpers.dm b/code/__HELPERS/icon_helpers.dm index a64f4e5c7e9..da7a0cfb9be 100644 --- a/code/__HELPERS/icon_helpers.dm +++ b/code/__HELPERS/icon_helpers.dm @@ -17,7 +17,7 @@ SELF_ICON.Blend(A.color,ICON_MULTIPLY)} \ } \ ##SETVAR=SELF_ICON;\ - } while (0) + } while(0) #define INDEX_X_LOW 1 #define INDEX_X_HIGH 2 #define INDEX_Y_LOW 3 diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index 7ba181bb075..c4f932574a6 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -678,9 +678,9 @@ //Picks from the list, with some safeties, and returns the "default" arg if it fails #define DEFAULTPICK(L, default) ((istype(L, /list) && L:len) ? pick(L) : default) -#define LAZYINITLIST(L) if (!L) L = list() +#define LAZYINITLIST(L) if(!L) L = list() -#define UNSETEMPTY(L) if (L && !L.len) L = null +#define UNSETEMPTY(L) if(L && !L.len) L = null #define LAZYREMOVE(L, I) if(L) { L -= I; if(!L.len) { L = null; } } #define LAZYADD(L, I) if(!L) { L = list(); } L += I; /// Adds I to L, initializing L if necessary, if I is not already in L diff --git a/code/__HELPERS/trait_helpers.dm b/code/__HELPERS/trait_helpers.dm index 85d8945c054..f465d8e65e5 100644 --- a/code/__HELPERS/trait_helpers.dm +++ b/code/__HELPERS/trait_helpers.dm @@ -22,7 +22,7 @@ } \ \ SEND_SIGNAL(target, SIGNAL_ADDTRAIT(trait), trait); \ - } while (0) + } while(0) /** * Removes a status trait from a target datum. @@ -50,7 +50,7 @@ } \ } \ } \ - } while (0) + } while(0) /** * Removes all status traits from a target datum which were NOT added by `sources`. @@ -82,7 +82,7 @@ target.status_traits = null; \ } \ } \ - } while (0) + } while(0) /** * Removes all status traits from a target datum which were added by `sources`. @@ -114,7 +114,7 @@ target.status_traits = null; \ } \ } \ - } while (0) + } while(0) #define HAS_TRAIT(target, trait) (target.status_traits ? (target.status_traits[trait] ? TRUE : FALSE) : FALSE) diff --git a/code/__HELPERS/typelists.dm b/code/__HELPERS/typelists.dm index 3519eb60f3a..5cd63baf8b5 100644 --- a/code/__HELPERS/typelists.dm +++ b/code/__HELPERS/typelists.dm @@ -9,11 +9,11 @@ GLOBAL_LIST_EMPTY(typelists) #else // mostly the same code as above, just more verbose, slower and has tallying for saved lists /datum/proc/typelist(key, list/values) - if (!values) + if(!values) values = list() GLOB.typelistkeys |= key - if (GLOB.typelists[type]) - if (GLOB.typelists[type][key]) + if(GLOB.typelists[type]) + if(GLOB.typelists[type][key]) GLOB.typelists[type]["[key]-saved"]++ return GLOB.typelists[type][key] else @@ -28,16 +28,16 @@ GLOBAL_LIST_EMPTY(typelistkeys) /proc/tallytypelistsavings() var/savings = list() var/saveditems = list() - for (var/key in GLOB.typelistkeys) + for(var/key in GLOB.typelistkeys) savings[key] = 0 saveditems[key] = 0 - for (var/type in GLOB.typelists) - for (var/saving in savings) - if (GLOB.typelists[type]["[saving]-saved"]) + for(var/type in GLOB.typelists) + for(var/saving in savings) + if(GLOB.typelists[type]["[saving]-saved"]) savings[saving] += GLOB.typelists[type]["[saving]-saved"] saveditems[saving] += (GLOB.typelists[type]["[saving]-saved"] * length(GLOB.typelists[type][saving])) - for (var/saving in savings) + for(var/saving in savings) to_chat(world, "Savings for [saving]: [savings[saving]] lists, [saveditems[saving]] items") #endif diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 96b729cfef7..9198d4e3632 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -122,7 +122,7 @@ Turf and target are seperate in case you want to teleport some distance from a t var/turf/center = locate((destination.x+xoffset),(destination.y+yoffset),location.z)//So now, find the new center. //Now to find a box from center location and make that our destination. - for(var/turf/T in block(locate(center.x+b1xerror,center.y+b1yerror,location.z), locate(center.x+b2xerror,center.y+b2yerror,location.z) )) + for(var/turf/T in block(locate(center.x+b1xerror,center.y+b1yerror,location.z), locate(center.x+b2xerror,center.y+b2yerror,location.z))) if(density&&T.density) continue//If density was specified. if(T.x>world.maxx || T.x<1) continue//Don't want them to teleport off the map. if(T.y>world.maxy || T.y<1) continue @@ -436,11 +436,11 @@ Turf and target are seperate in case you want to teleport some distance from a t // Format an energy value in J, kJ, MJ, or GJ. 1W = 1J/s. /proc/DisplayJoules(units) - if (units < 1000) // Less than a kJ + if(units < 1000) // Less than a kJ return "[round(units, 0.1)] J" - else if (units < 1000000) // Less than a MJ + else if(units < 1000000) // Less than a MJ return "[round(units * 0.001, 0.01)] kJ" - else if (units < 1000000000) // Less than a GJ + else if(units < 1000000000) // Less than a GJ return "[round(units * 0.000001, 0.001)] MJ" return "[round(units * 0.000000001, 0.0001)] GJ" @@ -1596,7 +1596,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) if(!orange) L += t_center - while( c_dist <= dist ) + while(c_dist <= dist) y = t_center.y + c_dist x = t_center.x - c_dist + 1 for(x in x to t_center.x+c_dist) diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm index 49211cf7c25..b7bab7b28bf 100644 --- a/code/_onclick/adjacent.dm +++ b/code/_onclick/adjacent.dm @@ -87,13 +87,13 @@ */ /turf/proc/ClickCross(target_dir, border_only, target_atom = null) for(var/obj/O in src) - if( !O.density || O == target_atom || (O.pass_flags & LETPASSTHROW)) + if(!O.density || O == target_atom || (O.pass_flags & LETPASSTHROW)) continue // LETPASSTHROW is used for anything you can click through - if( O.flags&ON_BORDER) // windows are on border, check them first - if( O.dir & target_dir || O.dir&(O.dir-1) ) // full tile windows are just diagonals mechanically + if(O.flags&ON_BORDER) // windows are on border, check them first + if(O.dir & target_dir || O.dir&(O.dir-1)) // full tile windows are just diagonals mechanically return 0 - else if( !border_only ) // dense, not on border, cannot pass over + else if(!border_only) // dense, not on border, cannot pass over return 0 return 1 diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 32c75816276..5a0c22cbdba 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -392,7 +392,7 @@ // Simple helper to face what you clicked on, in case it should be needed in more than one place /mob/proc/face_atom(atom/A) - if( stat || buckled || !A || !x || !y || !A.x || !A.y ) return + if(stat || buckled || !A || !x || !y || !A.x || !A.y) return var/dx = A.x - x var/dy = A.y - y if(!dx && !dy) return diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index 5424db78a81..86949ea31c7 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -79,7 +79,7 @@ return // buckled cannot prevent machine interlinking but stops arm movement - if( buckled ) + if(buckled) return if(W == A) diff --git a/code/_onclick/hud/fullscreen.dm b/code/_onclick/hud/fullscreen.dm index 72117f4b326..64c96c3e67e 100644 --- a/code/_onclick/hud/fullscreen.dm +++ b/code/_onclick/hud/fullscreen.dm @@ -1,16 +1,16 @@ /mob/proc/overlay_fullscreen(category, type, severity) var/obj/screen/fullscreen/screen = screens[category] - if (!screen || screen.type != type) + if(!screen || screen.type != type) // needs to be recreated clear_fullscreen(category, FALSE) screens[category] = screen = new type() - else if ((!severity || severity == screen.severity) && (!client || screen.screen_loc != "CENTER-7,CENTER-7" || screen.view == client.view)) + else if((!severity || severity == screen.severity) && (!client || screen.screen_loc != "CENTER-7,CENTER-7" || screen.view == client.view)) // doesn't need to be updated return screen screen.icon_state = "[initial(screen.icon_state)][severity]" screen.severity = severity - if (client && screen.should_show_to(src)) + if(client && screen.should_show_to(src)) screen.update_for_view(client.view) client.screen += screen @@ -63,7 +63,7 @@ var/show_when_dead = FALSE /obj/screen/fullscreen/proc/update_for_view(client_view) - if (screen_loc == "CENTER-7,CENTER-7" && view != client_view) + if(screen_loc == "CENTER-7,CENTER-7" && view != client_view) var/list/actualview = getviewsize(client_view) view = client_view transform = matrix(actualview[1]/FULLSCREEN_OVERLAY_RESOLUTION_X, 0, 0, 0, actualview[2]/FULLSCREEN_OVERLAY_RESOLUTION_Y, 0) diff --git a/code/_onclick/hud/parallax.dm b/code/_onclick/hud/parallax.dm index 91608660609..fa53a7c6e0d 100644 --- a/code/_onclick/hud/parallax.dm +++ b/code/_onclick/hud/parallax.dm @@ -62,22 +62,22 @@ if(isnull(pref)) pref = PARALLAX_HIGH switch(C.prefs.parallax) - if (PARALLAX_INSANE) + if(PARALLAX_INSANE) C.parallax_throttle = FALSE C.parallax_layers_max = 5 return TRUE - if (PARALLAX_MED) + if(PARALLAX_MED) C.parallax_throttle = PARALLAX_DELAY_MED C.parallax_layers_max = 3 return TRUE - if (PARALLAX_LOW) + if(PARALLAX_LOW) C.parallax_throttle = PARALLAX_DELAY_LOW C.parallax_layers_max = 1 return TRUE - if (PARALLAX_DISABLE) + if(PARALLAX_DISABLE) return FALSE //This is high parallax. diff --git a/code/_onclick/hud/robot_hud.dm b/code/_onclick/hud/robot_hud.dm index 38e05cab03c..1ec455d9274 100644 --- a/code/_onclick/hud/robot_hud.dm +++ b/code/_onclick/hud/robot_hud.dm @@ -229,7 +229,7 @@ var/y = 1 for(var/atom/movable/A in R.module.modules) - if( (A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3) ) + if((A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3)) //Module is not currently active R.client.screen += A if(x < 0) @@ -249,7 +249,7 @@ R.client.screen -= module_store_icon for(var/atom/A in R.module.modules) - if( (A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3) ) + if((A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3)) //Module is not currently active R.client.screen -= A R.shown_robot_modules = FALSE diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 65d55420230..492e0e01cb5 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -164,7 +164,7 @@ return TRUE /obj/screen/storage/proc/is_item_accessible(obj/item/I, mob/user) - if (!user || !I) + if(!user || !I) return FALSE var/storage_depth = I.storage_depth(user) diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 0a7707e0275..c8559d59c60 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -89,7 +89,7 @@ //stops TK grabs being equipped anywhere but into hands /obj/item/tk_grab/equipped(mob/user, slot) - if( (slot == SLOT_HUD_LEFT_HAND) || (slot== SLOT_HUD_RIGHT_HAND) ) + if((slot == SLOT_HUD_LEFT_HAND) || (slot== SLOT_HUD_RIGHT_HAND)) return qdel(src) diff --git a/code/controllers/configuration/sections/gamemode_configuration.dm b/code/controllers/configuration/sections/gamemode_configuration.dm index 4f427a2488b..d9be626883f 100644 --- a/code/controllers/configuration/sections/gamemode_configuration.dm +++ b/code/controllers/configuration/sections/gamemode_configuration.dm @@ -6,7 +6,7 @@ var/list/gamemode_names = list() /// Assoc list of gamemode probabilities (key: config-tag | value: probability) var/list/probabilities = list() - /// List of all gamemodes that can be voted for (value: config-tag) + /// List of all gamemodes that can be voted for, (value: config-tag) var/list/votable_modes = list() /// Should antags be restricted based on account age? var/antag_account_age_restriction = FALSE diff --git a/code/controllers/configuration/sections/vote_configuration.dm b/code/controllers/configuration/sections/vote_configuration.dm index dca4a78c241..43973d26712 100644 --- a/code/controllers/configuration/sections/vote_configuration.dm +++ b/code/controllers/configuration/sections/vote_configuration.dm @@ -1,6 +1,6 @@ /// Config holder for stuff relating to the ingame vote system /datum/configuration_section/vote_configuration - /// How long will a vote last for (deciseconds) + /// How long will a vote last for in deciseconds var/vote_time = 60 SECONDS // 60 seconds /// Time before the first shuttle vote (deciseconds) var/autotransfer_initial_time = 2 HOURS // 2 hours diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 2d8f6d192e5..3fb4ad3dda0 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -160,7 +160,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new /datum/controller/master/Recover() var/msg = "## DEBUG: [time2text(world.timeofday)] MC restarted. Reports:\n" for(var/varname in Master.vars) - switch (varname) + switch(varname) if("name", "tag", "bestF", "type", "parent_type", "vars", "statclick") // Built-in junk. continue else diff --git a/code/controllers/subsystem/SSnano_mob_hunter.dm b/code/controllers/subsystem/SSnano_mob_hunter.dm index 9e0e1454328..49b433ca6b0 100644 --- a/code/controllers/subsystem/SSnano_mob_hunter.dm +++ b/code/controllers/subsystem/SSnano_mob_hunter.dm @@ -129,7 +129,7 @@ SUBSYSTEM_DEF(mob_hunt) if(loser == "Red") loser_terminal = red_terminal winner_terminal = blue_terminal - else if (loser == "Blue") + else if(loser == "Blue") loser_terminal = blue_terminal winner_terminal = red_terminal battle_turn = null diff --git a/code/controllers/subsystem/SSparallax.dm b/code/controllers/subsystem/SSparallax.dm index ea912440228..c0beb503d66 100644 --- a/code/controllers/subsystem/SSparallax.dm +++ b/code/controllers/subsystem/SSparallax.dm @@ -40,7 +40,7 @@ SUBSYSTEM_DEF(parallax) var/atom/movable/A = C.eye if(!istype(A)) continue - for (A; isatom(A.loc) && !isturf(A.loc); A = A.loc); + for(A; isatom(A.loc) && !isturf(A.loc); A = A.loc); if(A != C.movingmob) if(C.movingmob != null && C.movingmob.client_mobs_in_contents) diff --git a/code/controllers/subsystem/SSradiation.dm b/code/controllers/subsystem/SSradiation.dm index 52a71c99cba..540e56ce19a 100644 --- a/code/controllers/subsystem/SSradiation.dm +++ b/code/controllers/subsystem/SSradiation.dm @@ -34,7 +34,7 @@ PROCESSING_SUBSYSTEM_DEF(radiation) . = ..() /datum/controller/subsystem/processing/radiation/proc/get_turf_radiation(turf/place) - if (prev_rad_cache[place]) + if(prev_rad_cache[place]) return prev_rad_cache[place] else return 0 diff --git a/code/controllers/subsystem/SSsecurity_level.dm b/code/controllers/subsystem/SSsecurity_level.dm index b1e66f866e7..6859a52c27f 100644 --- a/code/controllers/subsystem/SSsecurity_level.dm +++ b/code/controllers/subsystem/SSsecurity_level.dm @@ -14,12 +14,12 @@ SUBSYSTEM_DEF(security_level) var/list/available_levels = list() /datum/controller/subsystem/security_level/Initialize() - if (!length(available_levels)) + if(!length(available_levels)) for(var/security_level_type in subtypesof(/datum/security_level)) var/datum/security_level/new_security_level = new security_level_type available_levels[new_security_level.name] = new_security_level - if (!current_security_level) + if(!current_security_level) current_security_level = available_levels[number_level_to_text(DEFAULT_SECURITY_LEVEL_NUMBER)] /datum/controller/subsystem/security_level/Recover() diff --git a/code/controllers/subsystem/SSspacedrift.dm b/code/controllers/subsystem/SSspacedrift.dm index 3bc055c5fde..96aa68a8e2a 100644 --- a/code/controllers/subsystem/SSspacedrift.dm +++ b/code/controllers/subsystem/SSspacedrift.dm @@ -31,12 +31,12 @@ SUBSYSTEM_DEF(spacedrift) currentrun.len-- if(!AM) processing -= AM - if (MC_TICK_CHECK) + if(MC_TICK_CHECK) return continue if(AM.inertia_next_move > world.time) - if (MC_TICK_CHECK) + if(MC_TICK_CHECK) return continue @@ -46,7 +46,7 @@ SUBSYSTEM_DEF(spacedrift) if(!AM.inertia_dir) AM.inertia_last_loc = null processing -= AM - if (MC_TICK_CHECK) + if(MC_TICK_CHECK) return continue diff --git a/code/controllers/subsystem/SStgui.dm b/code/controllers/subsystem/SStgui.dm index 29798705710..8ef9384f09c 100644 --- a/code/controllers/subsystem/SStgui.dm +++ b/code/controllers/subsystem/SStgui.dm @@ -35,7 +35,7 @@ SUBSYSTEM_DEF(tgui) /datum/controller/subsystem/tgui/fire(resumed = 0) - if (!resumed) + if(!resumed) src.currentrun = processing_uis.Copy() //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun @@ -47,7 +47,7 @@ SUBSYSTEM_DEF(tgui) ui.process() else processing_uis.Remove(ui) - if (MC_TICK_CHECK) + if(MC_TICK_CHECK) return /** diff --git a/code/controllers/subsystem/SSthrowing.dm b/code/controllers/subsystem/SSthrowing.dm index b31673d3312..606c762bb10 100644 --- a/code/controllers/subsystem/SSthrowing.dm +++ b/code/controllers/subsystem/SSthrowing.dm @@ -103,7 +103,7 @@ SUBSYSTEM_DEF(throwing) step = get_step(AM, init_dir) if(!pure_diagonal && !diagonals_first) // not a purely diagonal trajectory and we don't want all diagonal moves to be done first - if (diagonal_error >= 0 && max(dist_x, dist_y) - dist_travelled != 1) //we do a step forward unless we're right before the target + if(diagonal_error >= 0 && max(dist_x, dist_y) - dist_travelled != 1) //we do a step forward unless we're right before the target step = get_step(AM, dx) diagonal_error += (diagonal_error < 0) ? dist_x / 2 : -dist_y diff --git a/code/controllers/subsystem/SSticker.dm b/code/controllers/subsystem/SSticker.dm index 55fa36fac95..2aaa50f2815 100644 --- a/code/controllers/subsystem/SSticker.dm +++ b/code/controllers/subsystem/SSticker.dm @@ -89,7 +89,7 @@ SUBSYSTEM_DEF(ticker) current_state = GAME_STATE_PREGAME fire() // TG says this is a good idea for(var/mob/new_player/N in GLOB.player_list) - if (N.client) + if(N.client) N.new_player_panel_proc() // to enable the observe option if(GAME_STATE_PREGAME) if(!SSticker.ticker_going) // This has to be referenced like this, and I dont know why. If you dont put SSticker. it will break diff --git a/code/controllers/subsystem/SStime_track.dm b/code/controllers/subsystem/SStime_track.dm index 58cb144080e..5f15a1bf9e4 100644 --- a/code/controllers/subsystem/SStime_track.dm +++ b/code/controllers/subsystem/SStime_track.dm @@ -21,7 +21,7 @@ SUBSYSTEM_DEF(time_track) var/current_byondtime = world.time var/current_tickcount = world.time / world.tick_lag - if (!first_run) + if(!first_run) var/tick_drift = max(0, (((current_realtime - last_tick_realtime) - (current_byondtime - last_tick_byond_time)) / world.tick_lag)) time_dilation_current = tick_drift / (current_tickcount - last_tick_tickcount) * 100 diff --git a/code/controllers/subsystem/SStimer.dm b/code/controllers/subsystem/SStimer.dm index 2c1e345994e..53571e6eb7d 100644 --- a/code/controllers/subsystem/SStimer.dm +++ b/code/controllers/subsystem/SStimer.dm @@ -64,10 +64,10 @@ SUBSYSTEM_DEF(timer) /datum/controller/subsystem/timer/proc/dump_timer_buckets(full = TRUE) var/list/to_log = list("Timer bucket reset. world.time: [world.time], head_offset: [head_offset], practical_offset: [practical_offset]") - if (full) - for (var/i in 1 to length(bucket_list)) + if(full) + for(var/i in 1 to length(bucket_list)) var/datum/timedevent/bucket_head = bucket_list[i] - if (!bucket_head) + if(!bucket_head) continue to_log += "Active timers at index [i]:" @@ -113,20 +113,20 @@ SUBSYSTEM_DEF(timer) bucket_resolution = 0 // Process client-time timers - if (next_clienttime_timer_index) + if(next_clienttime_timer_index) clienttime_timers.Cut(1, next_clienttime_timer_index+1) next_clienttime_timer_index = 0 - for (next_clienttime_timer_index in 1 to length(clienttime_timers)) - if (MC_TICK_CHECK) + for(next_clienttime_timer_index in 1 to length(clienttime_timers)) + if(MC_TICK_CHECK) next_clienttime_timer_index-- break var/datum/timedevent/ctime_timer = clienttime_timers[next_clienttime_timer_index] - if (ctime_timer.timeToRun > REALTIMEOFDAY) + if(ctime_timer.timeToRun > REALTIMEOFDAY) next_clienttime_timer_index-- break var/datum/callback/callBack = ctime_timer.callBack - if (!callBack) + if(!callBack) CRASH("Invalid timer: [get_timer_debug_string(ctime_timer)] world.time: [world.time], \ head_offset: [head_offset], practical_offset: [practical_offset], REALTIMEOFDAY: [REALTIMEOFDAY]") @@ -141,83 +141,83 @@ SUBSYSTEM_DEF(timer) qdel(ctime_timer) // Remove invoked client-time timers - if (next_clienttime_timer_index) + if(next_clienttime_timer_index) clienttime_timers.Cut(1, next_clienttime_timer_index+1) next_clienttime_timer_index = 0 // Check for when we need to loop the buckets, this occurs when // the head_offset is approaching BUCKET_LEN ticks in the past - if (practical_offset > BUCKET_LEN) + if(practical_offset > BUCKET_LEN) head_offset += TICKS2DS(BUCKET_LEN) practical_offset = 1 resumed = FALSE // Check for when we have to reset buckets, typically from auto-reset - if ((length(bucket_list) != BUCKET_LEN) || (world.tick_lag != bucket_resolution)) + if((length(bucket_list) != BUCKET_LEN) || (world.tick_lag != bucket_resolution)) reset_buckets() bucket_list = src.bucket_list resumed = FALSE // Iterate through each bucket starting from the practical offset - while (practical_offset <= BUCKET_LEN && head_offset + ((practical_offset - 1) * world.tick_lag) <= world.time) + while(practical_offset <= BUCKET_LEN && head_offset + ((practical_offset - 1) * world.tick_lag) <= world.time) var/datum/timedevent/timer - while ((timer = bucket_list[practical_offset])) + while((timer = bucket_list[practical_offset])) var/datum/callback/callBack = timer.callBack - if (!callBack) + if(!callBack) stack_trace("Invalid timer: [get_timer_debug_string(timer)] world.time: [world.time], \ head_offset: [head_offset], practical_offset: [practical_offset], bucket_joined: [timer.bucket_joined]") - if (!timer.spent) + if(!timer.spent) bucket_resolution = null // force bucket recreation return timer.bucketEject() //pop the timer off of the bucket list. // Invoke callback if possible - if (!timer.spent) + if(!timer.spent) timer.spent = world.time callBack.InvokeAsync() last_invoke_tick = world.time - if (timer.flags & TIMER_LOOP) // Prepare looping timers to re-enter the queue + if(timer.flags & TIMER_LOOP) // Prepare looping timers to re-enter the queue timer.spent = 0 timer.timeToRun = world.time + timer.wait timer.bucketJoin() else qdel(timer) - if (MC_TICK_CHECK) + if(MC_TICK_CHECK) break - if (!bucket_list[practical_offset]) + if(!bucket_list[practical_offset]) // Empty the bucket, check if anything in the secondary queue should be shifted to this bucket bucket_list[practical_offset] = null // Just in case practical_offset++ var/i = 0 - for (i in 1 to length(second_queue)) + for(i in 1 to length(second_queue)) timer = second_queue[i] - if (timer.timeToRun >= TIMER_MAX) + if(timer.timeToRun >= TIMER_MAX) i-- break // Check for timers that are scheduled to run in the past - if (timer.timeToRun < head_offset) + if(timer.timeToRun < head_offset) bucket_resolution = null // force bucket recreation 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]") break // Check for timers that are not capable of being scheduled to run without rebuilding buckets - if (timer.timeToRun < head_offset + TICKS2DS(practical_offset - 1)) + if(timer.timeToRun < head_offset + TICKS2DS(practical_offset - 1)) bucket_resolution = null // force bucket recreation 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]") break timer.bucketJoin() - if (i) + if(i) second_queue.Cut(1, i+1) - if (MC_TICK_CHECK) + if(MC_TICK_CHECK) break /** @@ -244,8 +244,8 @@ SUBSYSTEM_DEF(timer) var/list/alltimers = list() // Get all timers currently in the buckets - for (var/bucket_head in bucket_list) - if (!bucket_head) // if bucket is empty for this tick + for(var/bucket_head in bucket_list) + if(!bucket_head) // if bucket is empty for this tick continue var/datum/timedevent/bucket_node = bucket_head do @@ -266,7 +266,7 @@ SUBSYSTEM_DEF(timer) // Add all timed events from the secondary queue as well alltimers += second_queue - for (var/datum/timedevent/t in alltimers) + for(var/datum/timedevent/t in alltimers) t.bucket_joined = FALSE t.bucket_pos = -1 t.prev = null @@ -274,7 +274,7 @@ SUBSYSTEM_DEF(timer) // If there are no timers being tracked by the subsystem, // there is no need to do any further rebuilding - if (!length(alltimers)) + if(!length(alltimers)) return // Sort all timers by time to run @@ -284,7 +284,7 @@ SUBSYSTEM_DEF(timer) // then set the head offset appropriately to be the earliest time tracked by the // current set of buckets var/datum/timedevent/head = alltimers[1] - if (head.timeToRun < head_offset) + if(head.timeToRun < head_offset) head_offset = head.timeToRun // Iterate through each timed event and insert it into an appropriate bucket, @@ -293,21 +293,21 @@ SUBSYSTEM_DEF(timer) // secondary queue var/new_bucket_count var/i = 1 - for (i in 1 to length(alltimers)) + for(i in 1 to length(alltimers)) var/datum/timedevent/timer = alltimers[i] - if (!timer) + if(!timer) continue // Check that the TTR is within the range covered by buckets, when exceeded we've finished - if (timer.timeToRun >= TIMER_MAX) + if(timer.timeToRun >= TIMER_MAX) i-- break // Check that timer has a valid callback and hasn't been invoked - if (!timer.callBack || timer.spent) + if(!timer.callBack || timer.spent) WARNING("Invalid timer: [get_timer_debug_string(timer)] world.time: [world.time], \ head_offset: [head_offset], practical_offset: [practical_offset]") - if (timer.callBack) + if(timer.callBack) qdel(timer) continue @@ -318,7 +318,7 @@ SUBSYSTEM_DEF(timer) timer.bucket_joined = TRUE var/datum/timedevent/bucket_head = bucket_list[bucket_pos] - if (!bucket_head) + if(!bucket_head) bucket_list[bucket_pos] = timer timer.next = null timer.prev = null @@ -330,7 +330,7 @@ SUBSYSTEM_DEF(timer) bucket_list[bucket_pos] = timer // Cut the timers that are tracked by the buckets from the secondary queue - if (i) + if(i) alltimers.Cut(1, i + 1) second_queue = alltimers bucket_count = new_bucket_count @@ -403,53 +403,53 @@ SUBSYSTEM_DEF(timer) timeToRun = (flags & TIMER_CLIENT_TIME ? REALTIMEOFDAY : world.time) + wait // Include the timer in the hash table if the timer is unique - if (flags & TIMER_UNIQUE) + if(flags & TIMER_UNIQUE) SStimer.hashes[hash] = src // Generate ID for the timer if the timer is stoppable, include in the timer id dictionary - if (flags & TIMER_STOPPABLE) + if(flags & TIMER_STOPPABLE) id = num2text(nextid, 100) - if (nextid >= SHORT_REAL_LIMIT) + if(nextid >= SHORT_REAL_LIMIT) nextid += min(1, 2 ** round(nextid / SHORT_REAL_LIMIT)) else nextid++ SStimer.timer_id_dict[id] = src - if ((timeToRun < world.time || timeToRun < SStimer.head_offset) && !(flags & TIMER_CLIENT_TIME)) + if((timeToRun < world.time || timeToRun < SStimer.head_offset) && !(flags & TIMER_CLIENT_TIME)) CRASH("Invalid timer state: Timer created that would require a backtrack to run (addtimer would never let this happen): [SStimer.get_timer_debug_string(src)]") - if (callBack.object != GLOBAL_PROC && !QDESTROYING(callBack.object)) + if(callBack.object != GLOBAL_PROC && !QDESTROYING(callBack.object)) LAZYADD(callBack.object.active_timers, src) bucketJoin() /datum/timedevent/Destroy() ..() - if (flags & TIMER_UNIQUE && hash) + if(flags & TIMER_UNIQUE && hash) SStimer.hashes -= hash - if (callBack && callBack.object && callBack.object != GLOBAL_PROC && callBack.object.active_timers) + if(callBack && callBack.object && callBack.object != GLOBAL_PROC && callBack.object.active_timers) callBack.object.active_timers -= src UNSETEMPTY(callBack.object.active_timers) callBack = null - if (flags & TIMER_STOPPABLE) + if(flags & TIMER_STOPPABLE) SStimer.timer_id_dict -= id - if (flags & TIMER_CLIENT_TIME) - if (!spent) + if(flags & TIMER_CLIENT_TIME) + if(!spent) spent = world.time SStimer.clienttime_timers -= src return QDEL_HINT_IWILLGC - if (!spent) + if(!spent) spent = world.time bucketEject() else - if (prev && prev.next == src) + if(prev && prev.next == src) prev.next = next - if (next && next.prev == src) + if(next && next.prev == src) next.prev = prev next = null prev = null @@ -485,9 +485,9 @@ SUBSYSTEM_DEF(timer) // Remove the timed event from the bucket, ensuring to maintain // the integrity of the bucket's list if relevant - if (prev && prev.next == src) + if(prev && prev.next == src) prev.next = next - if (next && next.prev == src) + if(next && next.prev == src) next.prev = prev prev = next = null bucket_pos = -1 @@ -508,14 +508,14 @@ SUBSYSTEM_DEF(timer) callBack: \ref[callBack], callBack.object: [callBack.object]\ref[callBack.object]([getcallingtype()]), \ callBack.delegate:[callBack.delegate]([callBack.arguments ? callBack.arguments.Join(", ") : ""]), source: [source]" - if (bucket_joined) + if(bucket_joined) stack_trace("Bucket already joined! [name]") // Check if this timed event should be diverted to the client time bucket, or the secondary queue var/list/L - if (flags & TIMER_CLIENT_TIME) + if(flags & TIMER_CLIENT_TIME) L = SStimer.clienttime_timers - else if (timeToRun >= TIMER_MAX) + else if(timeToRun >= TIMER_MAX) L = SStimer.second_queue if(L) BINARY_INSERT_TG(src, L, /datum/timedevent, src, timeToRun, COMPARE_KEY) @@ -527,7 +527,7 @@ SUBSYSTEM_DEF(timer) // Find the correct bucket for this timed event bucket_pos = BUCKET_POS(src) - if (bucket_pos < SStimer.practical_offset && timeToRun < (SStimer.head_offset + TICKS2DS(BUCKET_LEN))) + if(bucket_pos < SStimer.practical_offset && timeToRun < (SStimer.head_offset + TICKS2DS(BUCKET_LEN))) WARNING("Bucket pos in past: bucket_pos = [bucket_pos] < practical_offset = [SStimer.practical_offset] \ && timeToRun = [timeToRun] < [SStimer.head_offset + TICKS2DS(BUCKET_LEN)], Timer: [name]") bucket_pos = SStimer.practical_offset // Recover bucket_pos to avoid timer blocking queue @@ -537,7 +537,7 @@ SUBSYSTEM_DEF(timer) // If there is no timed event at this position, then the bucket is 'empty' // and we can just set this event to that position - if (!bucket_head) + if(!bucket_head) bucket_joined = TRUE bucket_list[bucket_pos] = src return @@ -555,7 +555,7 @@ SUBSYSTEM_DEF(timer) */ /datum/timedevent/proc/getcallingtype() . = "ERROR" - if (callBack.object == GLOBAL_PROC) + if(callBack.object == GLOBAL_PROC) . = "GLOBAL_PROC" else if(isnull(callBack.object)) @@ -646,13 +646,13 @@ GLOBAL_LIST_EMPTY(timers_by_type) * * flags flags for this timer, see: code\__DEFINES\subsystems.dm */ /proc/addtimer(datum/callback/callback, wait = 0, flags = 0) - if (!callback) + if(!callback) CRASH("addtimer called without a callback") - if (wait < 0) + if(wait < 0) stack_trace("addtimer called with a negative wait. Converting to [world.tick_lag]") - if (callback.object != GLOBAL_PROC && QDELETED(callback.object) && !QDESTROYING(callback.object)) + if(callback.object != GLOBAL_PROC && QDELETED(callback.object) && !QDESTROYING(callback.object)) 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") @@ -663,7 +663,7 @@ GLOBAL_LIST_EMPTY(timers_by_type) // Generate hash if relevant for timed events with the TIMER_UNIQUE flag var/hash - if (flags & TIMER_UNIQUE) + if(flags & TIMER_UNIQUE) var/list/hashlist = list(callback.object, "(\ref[callback.object])", callback.delegate, flags & TIMER_CLIENT_TIME) if(!(flags & TIMER_NO_HASH_WAIT)) hashlist += wait @@ -672,14 +672,14 @@ GLOBAL_LIST_EMPTY(timers_by_type) var/datum/timedevent/hash_timer = SStimer.hashes[hash] if(hash_timer) - if (hash_timer.spent) // it's pending deletion, pretend it doesn't exist. + if(hash_timer.spent) // it's pending deletion, pretend it doesn't exist. hash_timer.hash = null // but keep it from accidentally deleting us else - if (flags & TIMER_OVERRIDE) + if(flags & TIMER_OVERRIDE) hash_timer.hash = null // no need having it delete it's hash if we are going to replace it qdel(hash_timer) else - if (hash_timer.flags & TIMER_STOPPABLE) + if(hash_timer.flags & TIMER_STOPPABLE) . = hash_timer.id return else if(flags & TIMER_OVERRIDE) @@ -695,16 +695,16 @@ GLOBAL_LIST_EMPTY(timers_by_type) * * id a timerid or a /datum/timedevent */ /proc/deltimer(id) - if (!id) + if(!id) return FALSE - if (id == TIMER_ID_NULL) + if(id == TIMER_ID_NULL) CRASH("Tried to delete a null timerid. Use TIMER_STOPPABLE flag") - if (istype(id, /datum/timedevent)) + if(istype(id, /datum/timedevent)) qdel(id) return TRUE //id is string var/datum/timedevent/timer = SStimer.timer_id_dict[id] - if (timer && (!timer.spent || timer.flags & TIMER_DELETE_ME)) + if(timer && (!timer.spent || timer.flags & TIMER_DELETE_ME)) qdel(timer) return TRUE return FALSE diff --git a/code/datums/armor.dm b/code/datums/armor.dm index f555b0dc4b5..4d16aad94bd 100644 --- a/code/datums/armor.dm +++ b/code/datums/armor.dm @@ -2,7 +2,7 @@ /proc/getArmor(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, rad = 0, fire = 0, acid = 0, magic = 0) . = locate(ARMORID) - if (!.) + if(!.) . = new /datum/armor(melee, bullet, laser, energy, bomb, rad, fire, acid, magic) /datum/armor @@ -58,7 +58,7 @@ return getArmor(melee - AA.melee, bullet - AA.bullet, laser - AA.laser, energy - AA.energy, bomb - AA.bomb, rad - AA.rad, fire - AA.fire, acid - AA.acid, magic - AA.magic) /datum/armor/vv_edit_var(var_name, var_value) - if (var_name == NAMEOF(src, tag)) + if(var_name == NAMEOF(src, tag)) return FALSE . = ..() tag = ARMORID // update tag in case armor values were edited diff --git a/code/datums/cache/powermonitor.dm b/code/datums/cache/powermonitor.dm index f299679b4c7..95cae49386e 100644 --- a/code/datums/cache/powermonitor.dm +++ b/code/datums/cache/powermonitor.dm @@ -12,7 +12,7 @@ GLOBAL_DATUM_INIT(powermonitor_repository, /datum/repository/powermonitor, new() return cache_entry.data for(var/obj/machinery/computer/monitor/pMon in GLOB.power_monitors) - if( !(pMon.stat & (NOPOWER|BROKEN)) && !pMon.is_secret_monitor ) + if(!(pMon.stat & (NOPOWER|BROKEN)) && !pMon.is_secret_monitor) pMonData[++pMonData.len] = list ("Area" = get_area_name(pMon), "uid" = "[pMon.UID()]") cache_entry.timestamp = world.time //+ 30 SECONDS diff --git a/code/datums/components/_component.dm b/code/datums/components/_component.dm index 7a410642ff1..27ee68f0189 100644 --- a/code/datums/components/_component.dm +++ b/code/datums/components/_component.dm @@ -299,7 +299,7 @@ var/current_type = parent_type . = list(our_type, current_type) //and since most components are root level + 1, this won't even have to run - while (current_type != /datum/component) + while(current_type != /datum/component) current_type = type2parent(current_type) . += current_type diff --git a/code/datums/components/defibrillator.dm b/code/datums/components/defibrillator.dm index 180308aa05d..44d35fdf8b8 100644 --- a/code/datums/components/defibrillator.dm +++ b/code/datums/components/defibrillator.dm @@ -252,7 +252,7 @@ else if(HAS_TRAIT(target, TRAIT_HUSK)) user.visible_message("[defib_ref] buzzes: Resuscitation failed - Subject is husked.") defib_success = FALSE - else if (target.blood_volume < BLOOD_VOLUME_SURVIVE) + else if(target.blood_volume < BLOOD_VOLUME_SURVIVE) user.visible_message("[defib_ref] buzzes: Resuscitation failed - Patient blood volume critically low.") defib_success = FALSE else if(!target.get_organ_slot("brain")) // So things like headless clings don't get outed diff --git a/code/datums/components/orbiter.dm b/code/datums/components/orbiter.dm index c5ab688434d..e9c36989d87 100644 --- a/code/datums/components/orbiter.dm +++ b/code/datums/components/orbiter.dm @@ -43,7 +43,7 @@ /// See atom/movable/proc/orbit for parameter definitions /datum/component/orbiter/Initialize(atom/movable/orbiter, radius = 10, clockwise = FALSE, rotation_speed = 20, rotation_segments = 36, pre_rotation = TRUE, lock_in_orbit = FALSE, force_move = FALSE, orbit_layer = FLY_LAYER) - if (!istype(orbiter) || !isatom(parent) || isarea(parent)) + if(!istype(orbiter) || !isatom(parent) || isarea(parent)) return COMPONENT_INCOMPATIBLE orbiter_list = list() diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index e18b17ae294..b49d193f76a 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -269,11 +269,11 @@ if(event.keyCode == 13){ //Enter / return var vars_ol = document.getElementById('vars'); var lis = vars_ol.getElementsByTagName("li"); - for ( var i = 0; i < lis.length; ++i ) + for(var i = 0; i < lis.length; ++i) { try{ var li = lis\[i\]; - if ( li.style.backgroundColor == "#ffee88" ) + if(li.style.backgroundColor == "#ffee88") { alist = lis\[i\].getElementsByTagName("a") if(alist.length > 0){ @@ -287,13 +287,13 @@ if(event.keyCode == 38){ //Up arrow var vars_ol = document.getElementById('vars'); var lis = vars_ol.getElementsByTagName("li"); - for ( var i = 0; i < lis.length; ++i ) + for(var i = 0; i < lis.length; ++i) { try{ var li = lis\[i\]; - if ( li.style.backgroundColor == "#ffee88" ) + if(li.style.backgroundColor == "#ffee88") { - if( (i-1) >= 0){ + if((i-1) >= 0){ var li_new = lis\[i-1\]; li.style.backgroundColor = "white"; li_new.style.backgroundColor = "#ffee88"; @@ -307,13 +307,13 @@ if(event.keyCode == 40){ //Down arrow var vars_ol = document.getElementById('vars'); var lis = vars_ol.getElementsByTagName("li"); - for ( var i = 0; i < lis.length; ++i ) + for(var i = 0; i < lis.length; ++i) { try{ var li = lis\[i\]; - if ( li.style.backgroundColor == "#ffee88" ) + if(li.style.backgroundColor == "#ffee88") { - if( (i+1) < lis.length){ + if((i+1) < lis.length){ var li_new = lis\[i+1\]; li.style.backgroundColor = "white"; li_new.style.backgroundColor = "#ffee88"; @@ -336,11 +336,11 @@ }else{ var vars_ol = document.getElementById('vars'); var lis = vars_ol.getElementsByTagName("li"); - for ( var i = 0; i < lis.length; ++i ) + for(var i = 0; i < lis.length; ++i) { try{ var li = lis\[i\]; - if ( li.innerText.toLowerCase().indexOf(filter) == -1 ) + if(li.innerText.toLowerCase().indexOf(filter) == -1) { vars_ol.removeChild(li); i--; @@ -349,10 +349,10 @@ } } var lis_new = vars_ol.getElementsByTagName("li"); - for ( var j = 0; j < lis_new.length; ++j ) + for(var j = 0; j < lis_new.length; ++j) { var li1 = lis\[j\]; - if (j == 0){ + if(j == 0){ li1.style.backgroundColor = "#ffee88"; }else{ li1.style.backgroundColor = "white"; @@ -364,7 +364,7 @@ filter_text.focus(); filter_text.select(); var lastsearch = getCookie("[refid][cookieoffset]search"); - if (lastsearch) { + if(lastsearch) { filter_text.value = lastsearch; updateSearch(); } @@ -380,8 +380,8 @@ var ca = document.cookie.split(';'); for(var i=0; i i_count || (N_i== i_count && N_r > r_count )) + if(N_i > i_count || (N_i== i_count && N_r > r_count)) r_count = N_r i_count = N_i . = recipe diff --git a/code/datums/spells/night_vision.dm b/code/datums/spells/night_vision.dm index 485528cb8cc..ad854eed601 100644 --- a/code/datums/spells/night_vision.dm +++ b/code/datums/spells/night_vision.dm @@ -13,13 +13,13 @@ /obj/effect/proc_holder/spell/night_vision/cast(list/targets, mob/user = usr) for(var/mob/living/target in targets) switch(target.lighting_alpha) - if (LIGHTING_PLANE_ALPHA_VISIBLE) + if(LIGHTING_PLANE_ALPHA_VISIBLE) target.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE name = "Toggle Nightvision \[More]" - if (LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE) + if(LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE) target.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE name = "Toggle Nightvision \[Full]" - if (LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE) + if(LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE) target.lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE name = "Toggle Nightvision \[OFF]" else diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index aa83c9e1bc9..46241823383 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -248,7 +248,7 @@ var/datum/light_source/L var/thing - for (thing in light_sources) // Cycle through the light sources on this atom and tell them to update. + for(thing in light_sources) // Cycle through the light sources on this atom and tell them to update. L = thing L.source_atom.update_light() return TRUE diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 97dfe21356e..7adac734b9f 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -27,7 +27,7 @@ return TRUE /datum/atom_hud/data/human/medical/basic/add_to_single_hud(mob/M, mob/living/carbon/H) - if(check_sensors(H) || isobserver(M) ) + if(check_sensors(H) || isobserver(M)) ..() /datum/atom_hud/data/human/medical/basic/proc/update_suit_sensors(mob/living/carbon/H) diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 37db37cd824..8b95f5126ef 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -159,7 +159,7 @@ return for(var/datum/AI_Module/AM in possible_modules) - if (href_list[AM.mod_pick_name]) + if(href_list[AM.mod_pick_name]) // Cost check if(AM.cost > processing_time) diff --git a/code/game/gamemodes/miniantags/guardian/types/ranged.dm b/code/game/gamemodes/miniantags/guardian/types/ranged.dm index a47ea8fc521..563146095f9 100644 --- a/code/game/gamemodes/miniantags/guardian/types/ranged.dm +++ b/code/game/gamemodes/miniantags/guardian/types/ranged.dm @@ -61,13 +61,13 @@ /mob/living/simple_animal/hostile/guardian/ranged/ToggleLight() var/msg switch(lighting_alpha) - if (LIGHTING_PLANE_ALPHA_VISIBLE) + if(LIGHTING_PLANE_ALPHA_VISIBLE) lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE msg = "You activate your night vision." - if (LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE) + if(LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE) lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE msg = "You increase your night vision." - if (LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE) + if(LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE) lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE msg = "You maximize your night vision." else diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index 3e0c904097f..41701ab2931 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -417,7 +417,7 @@ available_accesses = get_region_accesses(i) for(var/access in available_accesses) var/access_desc = (i == REGION_CENTCOMM) ? get_centcom_access_desc(access) : get_access_desc(access) - if (access_desc) + if(access_desc) accesses += list(list( "desc" = replacetext(access_desc, " ", " "), "ref" = access, diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 6edaf00c8e8..8df25705253 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -117,7 +117,7 @@ GLOB.cameranet.updateVisibility(src, 0) /obj/machinery/camera/singularity_pull(S, current_size) - if (status && current_size >= STAGE_FIVE) // If the singulo is strong enough to pull anchored objects and the camera is still active, turn off the camera as it gets ripped off the wall. + if(status && current_size >= STAGE_FIVE) // If the singulo is strong enough to pull anchored objects and the camera is still active, turn off the camera as it gets ripped off the wall. toggle_cam(null, 0) ..() @@ -149,7 +149,7 @@ // OTHER else if((istype(I, /obj/item/paper) || istype(I, /obj/item/pda)) && isliving(user)) - if (!can_use()) + if(!can_use()) to_chat(user, "You can't show something to a disabled camera!") return diff --git a/code/game/machinery/clonepod.dm b/code/game/machinery/clonepod.dm index e4b7fee98bd..5051daab729 100644 --- a/code/game/machinery/clonepod.dm +++ b/code/game/machinery/clonepod.dm @@ -225,7 +225,7 @@ GLOBAL_LIST_INIT(cloner_biomass_items, list(\ if(clonemind.current && clonemind.current.stat != DEAD) //mind is associated with a non-dead body return 0 if(clonemind.active) //somebody is using that mind - if(ckey(clonemind.key) != R.ckey ) + if(ckey(clonemind.key) != R.ckey) return 0 if(clonemind.suicided) // and stay out! malfunction(go_easy = 0) diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index 0157838c26c..79fd1330e8a 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -216,7 +216,7 @@ if(nextTick < world.time) nextTick=world.time + OP_COMPUTER_COOLDOWN - if(crit && table.patient.health <= -50 ) + if(crit && table.patient.health <= -50) playsound(src.loc, 'sound/machines/defib_success.ogg', 50, 0) if(oxy && table.patient.getOxyLoss()>oxyAlarm) playsound(src.loc, 'sound/machines/defib_saftyoff.ogg', 50, 0) diff --git a/code/game/machinery/computer/brigcells.dm b/code/game/machinery/computer/brigcells.dm index c9474a410b2..27001c5f8b7 100644 --- a/code/game/machinery/computer/brigcells.dm +++ b/code/game/machinery/computer/brigcells.dm @@ -46,17 +46,17 @@ return data /obj/machinery/computer/brigcells/ui_act(action, params) - if (..()) + if(..()) return FALSE if(!allowed(usr)) to_chat(usr, "Access denied.") return FALSE - if (action == "release") + if(action == "release") var/ref = params["ref"] var/obj/machinery/door_timer/T = locate(ref) - if (T) + if(T) T.timer_end() T.Radio.autosay("Timer stopped manually from a cell management console.", T.name, "Security", list(z)) return TRUE diff --git a/code/game/machinery/computer/camera_console.dm b/code/game/machinery/computer/camera_console.dm index c053728b747..a55fed5f1e4 100644 --- a/code/game/machinery/computer/camera_console.dm +++ b/code/game/machinery/computer/camera_console.dm @@ -145,7 +145,7 @@ // Returns the list of cameras accessible from this computer /obj/machinery/computer/security/proc/get_available_cameras() var/list/L = list() - for (var/obj/machinery/camera/C in GLOB.cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) if((is_away_level(z) || is_away_level(C.z)) && (C.z != z))//if on away mission, can only receive feed from same z_level cameras continue L.Add(C) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 169e0f5719a..7dff98bf42b 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1557,7 +1557,7 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays) return FALSE if(!wirecutters_used) - if (ishuman(user) && (user.a_intent == INTENT_GRAB)) //grab that note + if(ishuman(user) && (user.a_intent == INTENT_GRAB)) //grab that note user.visible_message("[user] removes [note] from [src].", "You remove [note] from [src].") playsound(src, 'sound/items/poster_ripped.ogg', 50, 1) else diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 1df547e1062..5c25a0695fe 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -220,7 +220,7 @@ FIRE ALARM alarm() /obj/machinery/firealarm/singularity_pull(S, current_size) - if (current_size >= STAGE_FIVE) // If the singulo is strong enough to pull anchored objects, the fire alarm experiences integrity failure + if(current_size >= STAGE_FIVE) // If the singulo is strong enough to pull anchored objects, the fire alarm experiences integrity failure deconstruct() ..() diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 0e98871bdcb..a2fb89910f8 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -72,7 +72,7 @@ to_chat(user, "You attach [I] to [src].") update_icon(UPDATE_OVERLAYS) START_PROCESSING(SSmachines, src) - else if (bag && istype(I, /obj/item/reagent_containers)) + else if(bag && istype(I, /obj/item/reagent_containers)) bag.attackby(I) I.afterattack(bag, usr, TRUE) update_icon(UPDATE_OVERLAYS) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 401ec6048bf..c1cd7049fd0 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -505,7 +505,7 @@ /obj/machinery/proc/adjust_item_drop_location(atom/movable/AM) // Adjust item drop location to a 3x3 grid inside the tile, returns slot id from 0 to 8 var/md5 = md5(AM.name) // Oh, and it's deterministic too. A specific item will always drop from the same slot. - for (var/i in 1 to 32) + for(var/i in 1 to 32) . += hex2num(md5[i]) . = . % 9 AM.pixel_x = -8 + ((.%3)*8) diff --git a/code/game/machinery/poolcontroller.dm b/code/game/machinery/poolcontroller.dm index 15618a97134..d3e0865feb4 100644 --- a/code/game/machinery/poolcontroller.dm +++ b/code/game/machinery/poolcontroller.dm @@ -181,7 +181,7 @@ return "scalding" /obj/machinery/poolcontroller/proc/set_temp(val) - if (val != WARM && val != NORMAL && val != COOL && !(emagged && (val == SCALDING || val == FRIGID))) + if(val != WARM && val != NORMAL && val != COOL && !(emagged && (val == SCALDING || val == FRIGID))) return if(val == SCALDING) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 6e913b03149..502705595f7 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -249,7 +249,7 @@ GLOBAL_LIST_EMPTY(turret_icons) return data /obj/machinery/porta_turret/ui_act(action, params) - if (..()) + if(..()) return if(isLocked(usr)) return diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 19e11fbb30a..480b8a112f6 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -553,7 +553,7 @@ "You start kicking against the doors... (this will take about [DisplayTimeText(breakout_time)].)", \ "You hear a thump from [src].") if(do_after(user,(breakout_time), target = src)) - if(!user || user.stat != CONSCIOUS || user.loc != src ) + if(!user || user.stat != CONSCIOUS || user.loc != src) return user.visible_message("[user] successfully broke out of [src]!", \ "You successfully break out of [src]!") diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 86498aa2958..6dc6c55a039 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -613,7 +613,7 @@ to_chat(user, "You load [src] with [I].") ttv = I I.forceMove(src) - else if (ttv) + else if(ttv) to_chat(user, "Another tank transfer valve is already loaded.") else to_chat(user, "Remove the attached assembly component first.") @@ -632,7 +632,7 @@ /obj/item/bombcore/toxins/proc/check_attached(obj/item/transfer_valve/ttv) - if (ttv.attached_device) + if(ttv.attached_device) return TRUE else return FALSE diff --git a/code/game/machinery/tcomms/nttc.dm b/code/game/machinery/tcomms/nttc.dm index 977692c8bee..a375e56cdef 100644 --- a/code/game/machinery/tcomms/nttc.dm +++ b/code/game/machinery/tcomms/nttc.dm @@ -255,7 +255,7 @@ var/job = tcm.sender_job var/rank = tcm.sender_rank //if the job title is not custom, just use that to decide the rules of formatting - if (job in all_jobs) + if(job in all_jobs) job_class = all_jobs[job] else job_class = all_jobs[rank] diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index 4bd81735219..0aec21cfcc4 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -168,7 +168,7 @@ return data /obj/machinery/turretid/ui_act(action, params) - if (..()) + if(..()) return if(isLocked(usr)) return diff --git a/code/game/machinery/vendors/vending.dm b/code/game/machinery/vendors/vending.dm index 2937c9c0b9a..2e9e0f3d21b 100644 --- a/code/game/machinery/vendors/vending.dm +++ b/code/game/machinery/vendors/vending.dm @@ -621,7 +621,7 @@ data["user"]["job"] = C.rank ? C.rank : "No Job" data["stock"] = list() - for (var/datum/data/vending_product/R in product_records + hidden_records) + for(var/datum/data/vending_product/R in product_records + hidden_records) data["stock"][R.name] = R.amount data["extended_inventory"] = extended_inventory data["vend_ready"] = vend_ready @@ -648,7 +648,7 @@ ) data["product_records"] += list(data_pr) data["hidden_records"] = list() - for (var/datum/data/vending_product/R in hidden_records) + for(var/datum/data/vending_product/R in hidden_records) var/list/data_hr = list( path = replacetext(replacetext("[R.product_path]", "/obj/item/", ""), "/", "-"), name = R.name, diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index 9e355cfee20..4eefbfe2685 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -35,7 +35,7 @@ to_chat(user, "The washing machine cannot run in this state.") return - if( locate(/mob,contents) ) + if(locate(/mob,contents)) state = 8 else state = 5 @@ -188,7 +188,7 @@ QDEL_NULL(crayon) - if( locate(/mob,contents) ) + if(locate(/mob,contents)) state = 7 gibs_ready = 1 else @@ -202,7 +202,7 @@ if(default_unfasten_wrench(user, W)) return if(istype(W,/obj/item/toy/crayon) ||istype(W,/obj/item/stamp)) - if( state in list( 1, 3, 6 ) ) + if(state in list( 1, 3, 6)) if(!crayon) user.drop_item() crayon = W @@ -213,7 +213,7 @@ else return ..() else if(istype(W,/obj/item/grab)) - if( (state == 1) && hacked) + if((state == 1) && hacked) var/obj/item/grab/G = W if(ishuman(G.assailant) && iscorgi(G.affecting)) G.affecting.loc = src @@ -232,43 +232,43 @@ istype(W,/obj/item/bedsheet)) //YES, it's hardcoded... saves a var/can_be_washed for every single clothing item. - if( istype(W,/obj/item/clothing/under/plasmaman ) ) + if(istype(W,/obj/item/clothing/under/plasmaman)) to_chat(user, "This item does not fit.") return - if( istype(W,/obj/item/clothing/suit/space ) ) + if(istype(W,/obj/item/clothing/suit/space)) to_chat(user, "This item does not fit.") return - if( istype(W,/obj/item/clothing/suit/syndicatefake ) ) + if(istype(W,/obj/item/clothing/suit/syndicatefake)) to_chat(user, "This item does not fit.") return -// if( istype(W,/obj/item/clothing/suit/powered ) ) +// if(istype(W,/obj/item/clothing/suit/powered)) // to_chat(user, "This item does not fit.") // return - if( istype(W,/obj/item/clothing/suit/cyborg_suit ) ) + if(istype(W,/obj/item/clothing/suit/cyborg_suit)) to_chat(user, "This item does not fit.") return - if( istype(W,/obj/item/clothing/suit/bomb_suit ) ) + if(istype(W,/obj/item/clothing/suit/bomb_suit)) to_chat(user, "This item does not fit.") return - if( istype(W,/obj/item/clothing/suit/armor ) ) + if(istype(W,/obj/item/clothing/suit/armor)) to_chat(user, "This item does not fit.") return - if( istype(W,/obj/item/clothing/mask/gas ) ) + if(istype(W,/obj/item/clothing/mask/gas)) to_chat(user, "This item does not fit.") return - if( istype(W,/obj/item/clothing/mask/cigarette ) ) + if(istype(W,/obj/item/clothing/mask/cigarette)) to_chat(user, "This item does not fit.") return - if( istype(W,/obj/item/clothing/head/syndicatefake ) ) + if(istype(W,/obj/item/clothing/head/syndicatefake)) to_chat(user, "This item does not fit.") return -// if( istype(W,/obj/item/clothing/head/powered ) ) +// if(istype(W,/obj/item/clothing/head/powered)) // to_chat(user, "This item does not fit.") // return - if( istype(W,/obj/item/clothing/head/helmet ) ) + if(istype(W,/obj/item/clothing/head/helmet)) to_chat(user, "This item does not fit.") return - if( istype(W,/obj/item/clothing/gloves/furgloves ) ) + if(istype(W,/obj/item/clothing/gloves/furgloves)) to_chat(user, "This item does not fit.") return if(istype(W, /obj/item/clothing/gloves/color/black/krav_maga/sec)) @@ -279,7 +279,7 @@ return if(contents.len < 5) - if( state in list(1, 3) ) + if(state in list(1, 3)) user.drop_item() W.loc = src state = 3 diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 18d5a5fd7ff..8fb9c54c26c 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -186,7 +186,7 @@ radio.talk_into(M, message_pieces) /obj/mecha/proc/click_action(atom/target, mob/user, params) - if(!occupant || occupant != user ) + if(!occupant || occupant != user) return if(user.incapacitated()) return diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 9b6b476870c..196b9a48b11 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -135,8 +135,8 @@ if(!in_range(user, src) || !isturf(user.loc) || user.incapacitated() || M.anchored) return FALSE - if (isguardian(user)) - if (M.loc == user.loc || user.alpha == 60) //Alpha is for detecting ranged guardians in scout mode + if(isguardian(user)) + if(M.loc == user.loc || user.alpha == 60) //Alpha is for detecting ranged guardians in scout mode return //unmanifested guardians shouldn't be able to buckle mobs add_fingerprint(user) diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index e1f1239d017..650e512a681 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -117,7 +117,7 @@ if(teleport_x_offset && teleport_y_offset && teleport_z_offset) var/turf/T = locate(rand(teleport_x, teleport_x_offset), rand(teleport_y, teleport_y_offset), rand(teleport_z, teleport_z_offset)) - if (T) + if(T) A.forceMove(T) /* Fancy teleporter, creates sparks and smokes when used */ diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 805333f1ce1..2f3140a86f4 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -293,7 +293,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons if(!H.gloves || (!(H.gloves.resistance_flags & (UNACIDABLE|ACID_PROOF)))) to_chat(user, "The acid on [src] burns your hand!") var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_arm") - if(affecting && affecting.receive_damage( 0, 5 )) // 5 burn damage + if(affecting && affecting.receive_damage(0, 5)) // 5 burn damage H.UpdateDamageIcon() if(isstorage(src.loc)) diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 8f706558445..dc95e0909d6 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -184,7 +184,7 @@ /area/wizard_station ) for(var/type in SPECIALS) - if( istype(A,type) ) + if(istype(A,type)) return AREA_SPECIAL return AREA_STATION diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index fb7d2d1f8ec..275ef815682 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -138,7 +138,7 @@ break if(power_drained > max_power * 0.98) - if (!admins_warned) + if(!admins_warned) admins_warned = TRUE message_admins("Power sink at ([x],[y],[z] - JMP) is 95% full. Explosion imminent.") playsound(src, 'sound/effects/screech.ogg', 100, 1, 1) diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index a3100bc6459..0c653374304 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -145,7 +145,7 @@ new/obj/effect/temp_visual/teleport_abductor/syndi_teleporter(mobloc) playsound(destination, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) new/obj/effect/temp_visual/teleport_abductor/syndi_teleporter(destination) - else if (EMP_D == FALSE && !(bagholding.len && !flawless)) // This is where the fun begins + else if(EMP_D == FALSE && !(bagholding.len && !flawless)) // This is where the fun begins var/direction = get_dir(user, destination) panic_teleport(user, destination, direction) else // Emp activated? Bag of holding? No saving throw for you diff --git a/code/game/objects/items/latexballoon.dm b/code/game/objects/items/latexballoon.dm index dcb5bb2d7cd..d936ec32227 100644 --- a/code/game/objects/items/latexballoon.dm +++ b/code/game/objects/items/latexballoon.dm @@ -40,10 +40,10 @@ /obj/item/latexballon/ex_act(severity) burst() switch(severity) - if (1) + if(1) qdel(src) - if (2) - if (prob(50)) + if(2) + if(prob(50)) qdel(src) /obj/item/latexballon/bullet_act(obj/item/projectile/P) diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index ccf7805ef8b..b5ea687025e 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -372,7 +372,7 @@ cyborg.cell.use(5) repair_tick = 0 - if((world.time - 2000) > msg_cooldown ) + if((world.time - 2000) > msg_cooldown) var/msgmode = "standby" if(cyborg.health < 0) msgmode = "critical" diff --git a/code/game/objects/items/stacks/medical_packs.dm b/code/game/objects/items/stacks/medical_packs.dm index 61bc4a348ff..dae725637d8 100644 --- a/code/game/objects/items/stacks/medical_packs.dm +++ b/code/game/objects/items/stacks/medical_packs.dm @@ -58,7 +58,7 @@ if(!(critter.healable)) to_chat(user, "You cannot use [src] on [critter]!") return - else if (critter.health == critter.maxHealth) + else if(critter.health == critter.maxHealth) to_chat(user, "[critter] is at full health.") return else if(heal_brute < 1) diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm index a4f64dbc237..d0fce583b73 100644 --- a/code/game/objects/items/stacks/nanopaste.dm +++ b/code/game/objects/items/stacks/nanopaste.dm @@ -15,7 +15,7 @@ return 0 if(isrobot(M)) //Repairing cyborgs var/mob/living/silicon/robot/R = M - if(R.getBruteLoss() || R.getFireLoss() ) + if(R.getBruteLoss() || R.getFireLoss()) R.heal_overall_damage(15, 15) use(1) user.visible_message("\The [user] applied some [src] at [R]'s damaged areas.",\ diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index aacb1acf1e3..a8b4bec2255 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -71,7 +71,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( to_chat(user, "You attach wire to [src].") new /obj/item/stack/light_w(user.loc) use(1) - else if( istype(W, /obj/item/stack/rods) ) + else if(istype(W, /obj/item/stack/rods)) var/obj/item/stack/rods/V = W var/obj/item/stack/sheet/rglass/RG = new (user.loc) RG.add_fingerprint(user) @@ -164,7 +164,7 @@ GLOBAL_LIST_INIT(pglass_recipes, list ( /obj/item/stack/sheet/plasmaglass/attackby(obj/item/W, mob/user, params) ..() - if( istype(W, /obj/item/stack/rods) ) + if(istype(W, /obj/item/stack/rods)) var/obj/item/stack/rods/V = W var/obj/item/stack/sheet/plasmarglass/RG = new (user.loc) RG.add_fingerprint(user) diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index 8c5f037798e..dbceeea68f1 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -29,7 +29,7 @@ if(!I.use_tool(src, user, volume = I.tool_volume)) to_chat(user, "You can not reform this!") return - if (mineralType == "metal") + if(mineralType == "metal") var/obj/item/stack/sheet/metal/new_item = new(user.loc) user.visible_message("[user.name] shaped [src] into metal with the welding tool.", \ "You shaped [src] into metal with the welding tool.", \ diff --git a/code/game/objects/items/tools/screwdriver.dm b/code/game/objects/items/tools/screwdriver.dm index 00c1c14f9e8..6f0587188fa 100644 --- a/code/game/objects/items/tools/screwdriver.dm +++ b/code/game/objects/items/tools/screwdriver.dm @@ -47,7 +47,7 @@ icon_state = "screwdriver_[param_color]" belt_icon = "screwdriver_[param_color]" - if (prob(75)) + if(prob(75)) src.pixel_y = rand(0, 16) /obj/item/screwdriver/attack(mob/living/carbon/M, mob/living/carbon/user) diff --git a/code/game/objects/items/weapons/lighters.dm b/code/game/objects/items/weapons/lighters.dm index 1ebdfd2ea39..eafb2d61e26 100644 --- a/code/game/objects/items/weapons/lighters.dm +++ b/code/game/objects/items/weapons/lighters.dm @@ -59,7 +59,7 @@ else var/mob/living/carbon/human/H = user var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand") - if(affecting.receive_damage( 0, 5 )) //INFERNO + if(affecting.receive_damage(0, 5)) //INFERNO H.UpdateDamageIcon() to_chat(user,"You light [src], but you burn your hand in the process.") if(world.time > next_on_message) diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm index 3601c5617a5..8c5f3034ab2 100644 --- a/code/game/objects/items/weapons/soap.dm +++ b/code/game/objects/items/weapons/soap.dm @@ -56,7 +56,7 @@ . += "[src] has been eaten down to a sliver!" /obj/item/soap/attack(mob/target as mob, mob/user as mob) - if(target && user && ishuman(target) && ishuman(user) && !target.stat && !user.stat && user.zone_selected == "mouth" ) + if(target && user && ishuman(target) && ishuman(user) && !target.stat && !user.stat && user.zone_selected == "mouth") user.visible_message("[user] starts washing [target]'s mouth out with [name]!") if(do_after(user, cleanspeed, target = target)) user.visible_message("[user] washes [target]'s mouth out with [name]!") diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index 7d7ef8c5ba1..6fed959f886 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -459,7 +459,7 @@ /obj/item/storage/bag/tray/cyborg /obj/item/storage/bag/tray/cyborg/afterattack(atom/target, mob/user as mob) - if( isturf(target) || istype(target,/obj/structure/table) ) + if(isturf(target) || istype(target,/obj/structure/table)) var/found_table = istype(target,/obj/structure/table/) if(!found_table) //it must be a turf! for(var/obj/structure/table/T in target) @@ -469,7 +469,7 @@ var/turf/dropspot if(!found_table) // don't unload things onto walls or other silly places. dropspot = user.loc - else if( isturf(target) ) // they clicked on a turf with a table in it + else if(isturf(target)) // they clicked on a turf with a table in it dropspot = target else // they clicked on a table dropspot = target.loc diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm index 6051a579d89..cd73c8b7e10 100644 --- a/code/game/objects/items/weapons/storage/internal.dm +++ b/code/game/objects/items/weapons/storage/internal.dm @@ -39,7 +39,7 @@ open(user) return 0 - if(!( istype(over_object, /obj/screen) )) + if(!istype(over_object, /obj/screen)) return 1 //makes sure master_item is equipped before putting it in hand, so that we can't drag it into our hand from miles away. @@ -47,7 +47,7 @@ if(!(master_item.loc == user) || (master_item.loc && master_item.loc.loc == user)) return 0 - if(!( user.restrained() ) && !( user.stat )) + if(!user.restrained() && !user.stat) switch(over_object.name) if("r_hand") user.unEquip(master_item, silent = TRUE) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 68175b9739b..ffd73efa883 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -239,7 +239,7 @@ return if(user.restrained() || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) return - if((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src))) + if((!istype(O, /atom/movable) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src))) return if(!ishuman(user) && !isrobot(user)) //No ghosts, you cannot shove people into fucking lockers return diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm index 841c3338bda..0888040b8ae 100644 --- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm +++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm @@ -90,7 +90,7 @@ if(W != user.get_active_hand()) to_chat(user, "You must be holding the pen to perform this action.") return - if(! Adjacent(user)) + if(!Adjacent(user)) to_chat(user, "You have moved too far away from the cardboard box.") return decalselection = replacetext(decalselection, " ", "_") diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index b021b1808fa..dba2daeb782 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -22,9 +22,9 @@ . = ..() if(start_showpieces.len && !start_showpiece_type) var/list/showpiece_entry = pick(start_showpieces) - if (showpiece_entry && showpiece_entry["type"]) + if(showpiece_entry && showpiece_entry["type"]) start_showpiece_type = showpiece_entry["type"] - if (showpiece_entry["trophy_message"]) + if(showpiece_entry["trophy_message"]) trophy_message = showpiece_entry["trophy_message"] if(start_showpiece_type) showpiece = new start_showpiece_type (src) diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 7a9e4e71187..fdfe4194b5a 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -119,7 +119,7 @@ update_appearance(UPDATE_NAME | UPDATE_OVERLAYS) /obj/structure/door_assembly/crowbar_act(mob/user, obj/item/I) - if(state != AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER ) + if(state != AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER) return . = TRUE if(!I.tool_use_check(user, 0)) @@ -140,7 +140,7 @@ update_appearance(UPDATE_NAME | UPDATE_OVERLAYS) /obj/structure/door_assembly/screwdriver_act(mob/user, obj/item/I) - if(state != AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER ) + if(state != AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER) return . = TRUE if(!I.tool_use_check(user, 0)) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index faad01cd7b4..0ffb9b51f24 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -107,7 +107,7 @@ to_chat(user, "You need at least five rods to add plating!") return to_chat(user, "You start adding plating...") - if (do_after(user, 40, target = src)) + if(do_after(user, 40, target = src)) if(!loc || !S || S.get_amount() < 5) return S.use(5) diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm index e6274e2d5ec..c0d34365027 100644 --- a/code/game/objects/structures/kitchen_spike.dm +++ b/code/game/objects/structures/kitchen_spike.dm @@ -84,7 +84,7 @@ return ..() /obj/structure/kitchenspike/MouseDrop_T(mob/living/victim, mob/living/user) - if (!user.Adjacent(src) || !user.Adjacent(victim) || isAI(user) || !ismob(victim)) + if(!user.Adjacent(src) || !user.Adjacent(victim) || isAI(user) || !ismob(victim)) return if(isanimal(user) && victim != user) return // animals cannot put mobs other than themselves onto spikes diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm index bcc7a7e0515..8b5f6a8365a 100644 --- a/code/game/objects/structures/ladders.dm +++ b/code/game/objects/structures/ladders.dm @@ -11,11 +11,11 @@ /obj/structure/ladder/Initialize(mapload, obj/structure/ladder/up, obj/structure/ladder/down) . = ..() - if (up) + if(up) src.up = up up.down = src up.update_icon() - if (down) + if(down) src.down = down down.up = src down.update_icon() @@ -38,7 +38,7 @@ L.update_icon() break if(!up) - for (var/obj/structure/ladder/L in locate(T.x, T.y, T.z + 1)) + for(var/obj/structure/ladder/L in locate(T.x, T.y, T.z + 1)) up = L L.down = src // Don't waste effort looping the other way L.update_icon() @@ -93,7 +93,7 @@ if(up && down) var/result = alert("Go up or down [src]?", "[name]", "Up", "Down", "Cancel") - if (!is_ghost && !in_range(src, user)) + if(!is_ghost && !in_range(src, user)) return // nice try switch(result) if("Up") @@ -164,13 +164,13 @@ down = L L.up = src L.update_icon() - if (up) + if(up) break // break if both our connections are filled else if(!up && L.height == height + 1) up = L L.down = src L.update_icon() - if (down) + if(down) break // break if both our connections are filled update_icon() diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 2ba9225189a..b95835e6f8b 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -138,7 +138,7 @@ /obj/structure/morgue/attack_hand(mob/user as mob) if(connected) for(var/atom/movable/A in connected.loc) - if(!(A.anchored)) + if(!A.anchored) A.forceMove(src) get_revivable(TRUE) playsound(loc, open_sound, 50, 1) @@ -241,7 +241,7 @@ /obj/structure/m_tray/attack_hand(mob/user as mob) if(connected) for(var/atom/movable/A as mob|obj in loc) - if(!( A.anchored )) + if(!A.anchored) A.forceMove(connected) connected.connected = null connected.update_icon(connected.update_state()) @@ -544,7 +544,7 @@ GLOBAL_LIST_EMPTY(crematoriums) /obj/structure/c_tray/MouseDrop_T(atom/movable/O, mob/living/user) - if((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src) || user.contents.Find(O))) + if((!istype(O, /atom/movable) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src) || user.contents.Find(O))) return if(!ismob(O) && !istype(O, /obj/structure/closet/body_bag)) return diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 0b5c57b0134..5c1c3f7074f 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -72,7 +72,7 @@ if(flipped) var/type = 0 var/subtype = null - for(var/direction in list(turn(dir,90), turn(dir,-90)) ) + for(var/direction in list(turn(dir,90), turn(dir,-90))) var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction)) if(T && T.flipped) type++ @@ -190,7 +190,7 @@ /obj/structure/table/MouseDrop_T(obj/O, mob/user) if(..()) return TRUE - if((!( isitem(O) ) || user.get_active_hand() != O)) + if((!isitem(O) || user.get_active_hand() != O)) return if(isrobot(user)) return @@ -346,7 +346,7 @@ if(flipped) return 0 - if( !straight_table_check(turn(direction,90)) || !straight_table_check(turn(direction,-90)) ) + if(!straight_table_check(turn(direction,90)) || !straight_table_check(turn(direction,-90))) return 0 dir = direction @@ -893,7 +893,7 @@ . = . || mover.checkpass(PASSTABLE) /obj/structure/rack/MouseDrop_T(obj/O, mob/user) - if((!( isitem(O) ) || user.get_active_hand() != O)) + if((!isitem(O) || user.get_active_hand() != O)) return if(isrobot(user)) return diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index aa0f52677d9..94b47c75569 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -43,7 +43,7 @@ GLOBAL_LIST_INIT(icons_to_ignore_at_floor_init, list("damaged1","damaged2","dama //turf/simulated/floor/CanPass(atom/movable/mover, turf/target, height=0) // if((istype(mover, /obj/machinery/vehicle) && !(src.burnt))) -// if(!( locate(/obj/machinery/mass_driver, src) )) +// if(!( locate(/obj/machinery/mass_driver, src))) // return 0 // return ..() diff --git a/code/game/turfs/simulated/floor/asteroid_floors.dm b/code/game/turfs/simulated/floor/asteroid_floors.dm index 9d374ffda3a..ff25fb1ae58 100644 --- a/code/game/turfs/simulated/floor/asteroid_floors.dm +++ b/code/game/turfs/simulated/floor/asteroid_floors.dm @@ -197,11 +197,11 @@ GLOBAL_LIST_INIT(megafauna_spawn_list, list(/mob/living/simple_animal/hostile/me has_data = TRUE /turf/simulated/floor/plating/asteroid/airless/cave/Initialize(mapload) - if (!mob_spawn_list) + if(!mob_spawn_list) mob_spawn_list = list(/mob/living/simple_animal/hostile/asteroid/goldgrub = 1, /mob/living/simple_animal/hostile/asteroid/goliath = 5, /mob/living/simple_animal/hostile/asteroid/basilisk = 4, /mob/living/simple_animal/hostile/asteroid/hivelord = 3) - if (!megafauna_spawn_list) + if(!megafauna_spawn_list) megafauna_spawn_list = GLOB.megafauna_spawn_list - if (!flora_spawn_list) + if(!flora_spawn_list) flora_spawn_list = list(/obj/structure/flora/ash/leaf_shroom = 2, /obj/structure/flora/ash/cap_shroom = 2, /obj/structure/flora/ash/stem_shroom = 2, /obj/structure/flora/ash/cacti = 1, /obj/structure/flora/ash/tall_shroom = 2, /obj/structure/flora/ash/rock/style_random = 1) if(SSmapping.cave_theme == BLOCKED_BURROWS) flora_spawn_list += list(/obj/structure/flora/ash/rock/style_random = 3) //Let us see how this goes diff --git a/code/game/turfs/simulated/minerals.dm b/code/game/turfs/simulated/minerals.dm index 888deff4c87..e8cbb28dd80 100644 --- a/code/game/turfs/simulated/minerals.dm +++ b/code/game/turfs/simulated/minerals.dm @@ -124,10 +124,10 @@ ..() switch(severity) if(3) - if (prob(75)) + if(prob(75)) gets_drilled(null, 1) if(2) - if (prob(90)) + if(prob(90)) gets_drilled(null, 1) if(1) gets_drilled(null, 1) @@ -144,7 +144,7 @@ mineralSpawnChanceList = typelist("mineralSpawnChanceList", mineralSpawnChanceList) . = ..() - if (prob(mineralChance)) + if(prob(mineralChance)) var/path = pickweight(mineralSpawnChanceList) var/turf/T = ChangeTurf(path, FALSE, TRUE, TRUE) diff --git a/code/game/turfs/simulated/river.dm b/code/game/turfs/simulated/river.dm index 20a9b1a89c7..0f1c8242e27 100644 --- a/code/game/turfs/simulated/river.dm +++ b/code/game/turfs/simulated/river.dm @@ -20,7 +20,7 @@ //make some randomly pathing rivers for(var/A in river_nodes) var/obj/effect/landmark/river_waypoint/W = A - if (W.z != target_z || W.connected) + if(W.z != target_z || W.connected) continue W.connected = TRUE var/turf/cur_turf = get_turf(W) @@ -80,7 +80,7 @@ for(var/F in RANGE_TURFS(1, src) - src) var/turf/T = F var/area/new_area = get_area(T) - if(!T || (T.density && !ismineralturf(T)) || istype(T, /turf/simulated/floor/indestructible) || (whitelisted_area && !istype(new_area, whitelisted_area)) || (T.flags & NO_LAVA_GEN) ) + if(!T || (T.density && !ismineralturf(T)) || istype(T, /turf/simulated/floor/indestructible) || (whitelisted_area && !istype(new_area, whitelisted_area)) || (T.flags & NO_LAVA_GEN)) continue if(!logged_turf_type && ismineralturf(T)) diff --git a/code/game/turfs/space/space_turf.dm b/code/game/turfs/space/space_turf.dm index b943673c14b..5e89ba1d44d 100644 --- a/code/game/turfs/space/space_turf.dm +++ b/code/game/turfs/space/space_turf.dm @@ -42,10 +42,10 @@ if(!IS_DYNAMIC_LIGHTING(src) && IS_DYNAMIC_LIGHTING(A)) add_overlay(/obj/effect/fullbright) - if (light_power && light_range) + if(light_power && light_range) update_light() - if (opacity) + if(opacity) has_opaque_atom = TRUE return INITIALIZE_HINT_NORMAL diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index 1587e6ab9f8..9d84ec41216 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -21,7 +21,7 @@ var/ckey = ckey(key) var/client/C = GLOB.directory[ckey] - if (C && ckey == C.ckey && computer_id == C.computer_id && address == C.address) + if(C && ckey == C.ckey && computer_id == C.computer_id && address == C.address) return //don't recheck connected clients. if((ckey in GLOB.admin_datums) || (ckey in GLOB.de_admins)) diff --git a/code/modules/admin/db_ban/functions.dm b/code/modules/admin/db_ban/functions.dm index b6cd3cd4cd5..f98979861cd 100644 --- a/code/modules/admin/db_ban/functions.dm +++ b/code/modules/admin/db_ban/functions.dm @@ -53,9 +53,9 @@ blockselfban = 1 kickbannedckey = 1 - if( !bantype_pass ) return - if( !istext(reason) ) return - if( !isnum(duration) ) return + if(!bantype_pass) return + if(!istext(reason)) return + if(!isnum(duration)) return var/ckey var/computerid @@ -229,7 +229,7 @@ if(BANTYPE_ANY_FULLBAN) bantype_str = "ANY" bantype_pass = 1 - if( !bantype_pass ) return + if(!bantype_pass) return var/bantype_sql if(bantype_str == "ANY") diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 9c0091e1aba..3274482fe70 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -120,7 +120,7 @@ you will have to do something like if(client.holder.rights & R_ADMIN) yourself. if(!other || !other.holder) return 1 if(usr.client.holder.rights != other.holder.rights) - if( (usr.client.holder.rights & other.holder.rights) == other.holder.rights ) + if((usr.client.holder.rights & other.holder.rights) == other.holder.rights) return 1 //we have all the rights they have and more to_chat(usr, "Error: Cannot proceed. They have more or equal rights to us.") return 0 diff --git a/code/modules/admin/misc_admin_procs.dm b/code/modules/admin/misc_admin_procs.dm index 005fa9861bf..c31abb1294a 100644 --- a/code/modules/admin/misc_admin_procs.dm +++ b/code/modules/admin/misc_admin_procs.dm @@ -537,8 +537,8 @@ GLOBAL_VAR_INIT(nologevent, 0) if(!check_rights(R_SERVER)) return - GLOB.enter_allowed = !( GLOB.enter_allowed ) - if(!( GLOB.enter_allowed )) + GLOB.enter_allowed = !GLOB.enter_allowed + if(!GLOB.enter_allowed) to_chat(world, "New players may no longer enter the game.") else to_chat(world, "New players may now enter the game.") diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index c19cd604c70..a0f797bdaad 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -33,7 +33,7 @@ var maintable_data = document.getElementById('maintable_data'); var ltr = maintable_data.getElementsByTagName("tr"); - for( var i = 0; i < ltr.length; ++i ) + for(var i = 0; i < ltr.length; ++i) { try{ var tr = ltr\[i\]; @@ -46,7 +46,7 @@ var search = lsearch\[0\]; //var inner_span = li.getElementsByTagName("span")\[1\] //Should only ever contain one element. //document.write("

"+search.innerText+"
"+filter+"
"+search.innerText.indexOf(filter)) - if( search.innerText.toLowerCase().indexOf(filter) == -1 ) + if(search.innerText.toLowerCase().indexOf(filter) == -1) { //document.write("a"); //ltr.removeChild(tr); diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index a348cc5a388..cad7508614c 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -64,7 +64,7 @@ if(1) if(check_rights((R_EVENT|R_SERVER),0)) var/security_levels_data = "" - for (var/level_name in SSsecurity_level.available_levels) + for(var/level_name in SSsecurity_level.available_levels) var/datum/security_level/this_level = SSsecurity_level.available_levels[level_name] security_levels_data += "[this_level.name]" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 7c120efe042..1bc9895b417 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -390,31 +390,31 @@ if("Yes") delmob = 1 switch(href_list["simplemake"]) - if("observer") M.change_mob_type( /mob/dead/observer , null, null, delmob, 1 ) - if("drone") M.change_mob_type( /mob/living/carbon/alien/humanoid/drone , null, null, delmob, 1 ) - if("hunter") M.change_mob_type( /mob/living/carbon/alien/humanoid/hunter , null, null, delmob, 1 ) - if("queen") M.change_mob_type( /mob/living/carbon/alien/humanoid/queen/large , null, null, delmob, 1 ) - if("sentinel") M.change_mob_type( /mob/living/carbon/alien/humanoid/sentinel , null, null, delmob, 1 ) - if("larva") M.change_mob_type( /mob/living/carbon/alien/larva , null, null, delmob, 1 ) + if("observer") M.change_mob_type( /mob/dead/observer , null, null, delmob, 1) + if("drone") M.change_mob_type( /mob/living/carbon/alien/humanoid/drone , null, null, delmob, 1) + if("hunter") M.change_mob_type( /mob/living/carbon/alien/humanoid/hunter , null, null, delmob, 1) + if("queen") M.change_mob_type( /mob/living/carbon/alien/humanoid/queen/large , null, null, delmob, 1) + if("sentinel") M.change_mob_type( /mob/living/carbon/alien/humanoid/sentinel , null, null, delmob, 1) + if("larva") M.change_mob_type( /mob/living/carbon/alien/larva , null, null, delmob, 1) if("human") var/posttransformoutfit = usr.client.robust_dress_shop() var/mob/living/carbon/human/newmob = M.change_mob_type(/mob/living/carbon/human, null, null, delmob, 1) if(posttransformoutfit && istype(newmob)) newmob.equipOutfit(posttransformoutfit) - if("slime") M.change_mob_type( /mob/living/simple_animal/slime , null, null, delmob, 1 ) - if("monkey") M.change_mob_type( /mob/living/carbon/human/monkey , null, null, delmob, 1 ) - if("robot") M.change_mob_type( /mob/living/silicon/robot , null, null, delmob, 1 ) - if("cat") M.change_mob_type( /mob/living/simple_animal/pet/cat , null, null, delmob, 1 ) - if("runtime") M.change_mob_type( /mob/living/simple_animal/pet/cat/Runtime , null, null, delmob, 1 ) - if("corgi") M.change_mob_type( /mob/living/simple_animal/pet/dog/corgi , null, null, delmob, 1 ) - if("crab") M.change_mob_type( /mob/living/simple_animal/crab , null, null, delmob, 1 ) - if("coffee") M.change_mob_type( /mob/living/simple_animal/crab/Coffee , null, null, delmob, 1 ) - if("parrot") M.change_mob_type( /mob/living/simple_animal/parrot , null, null, delmob, 1 ) - if("polyparrot") M.change_mob_type( /mob/living/simple_animal/parrot/Poly , null, null, delmob, 1 ) - if("constructarmoured") M.change_mob_type( /mob/living/simple_animal/hostile/construct/armoured , null, null, delmob, 1 ) - if("constructbuilder") M.change_mob_type( /mob/living/simple_animal/hostile/construct/builder , null, null, delmob, 1 ) - if("constructwraith") M.change_mob_type( /mob/living/simple_animal/hostile/construct/wraith , null, null, delmob, 1 ) - if("shade") M.change_mob_type( /mob/living/simple_animal/shade , null, null, delmob, 1 ) + if("slime") M.change_mob_type( /mob/living/simple_animal/slime , null, null, delmob, 1) + if("monkey") M.change_mob_type( /mob/living/carbon/human/monkey , null, null, delmob, 1) + if("robot") M.change_mob_type( /mob/living/silicon/robot , null, null, delmob, 1) + if("cat") M.change_mob_type( /mob/living/simple_animal/pet/cat , null, null, delmob, 1) + if("runtime") M.change_mob_type( /mob/living/simple_animal/pet/cat/Runtime , null, null, delmob, 1) + if("corgi") M.change_mob_type( /mob/living/simple_animal/pet/dog/corgi , null, null, delmob, 1) + if("crab") M.change_mob_type( /mob/living/simple_animal/crab , null, null, delmob, 1) + if("coffee") M.change_mob_type( /mob/living/simple_animal/crab/Coffee , null, null, delmob, 1) + if("parrot") M.change_mob_type( /mob/living/simple_animal/parrot , null, null, delmob, 1) + if("polyparrot") M.change_mob_type( /mob/living/simple_animal/parrot/Poly , null, null, delmob, 1) + if("constructarmoured") M.change_mob_type( /mob/living/simple_animal/hostile/construct/armoured , null, null, delmob, 1) + if("constructbuilder") M.change_mob_type( /mob/living/simple_animal/hostile/construct/builder , null, null, delmob, 1) + if("constructwraith") M.change_mob_type( /mob/living/simple_animal/hostile/construct/wraith , null, null, delmob, 1) + if("shade") M.change_mob_type( /mob/living/simple_animal/shade , null, null, delmob, 1) log_admin("[key_name(usr)] has used rudimentary transformation on [key_name(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]") message_admins("[key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]", 1) @@ -2696,7 +2696,7 @@ var/atom/target //Where the object will be spawned var/where = href_list["object_where"] - if(!( where in list("onfloor","inhand","inmarked") )) + if(!( where in list("onfloor","inhand","inmarked"))) where = "onfloor" diff --git a/code/modules/admin/verbs/antag-ooc.dm b/code/modules/admin/verbs/antag-ooc.dm index 8dbb539657c..1dcfc679094 100644 --- a/code/modules/admin/verbs/antag-ooc.dm +++ b/code/modules/admin/verbs/antag-ooc.dm @@ -13,7 +13,7 @@ display_name = holder.fakekey for(var/mob/M in GLOB.mob_list) - if((M.mind && M.mind.special_role && M.client) || (M.client && M.client.holder && (M.client.holder.rights & R_ADMIN)) ) + if((M.mind && M.mind.special_role && M.client) || (M.client && M.client.holder && (M.client.holder.rights & R_ADMIN))) to_chat(M, "AOOC: [display_name]: [msg]") diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index e40c6931917..542d9f6cdc3 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -497,7 +497,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention) log_admin("[key_name(usr)] assumed direct control of [M].") var/mob/adminmob = src.mob M.ckey = src.ckey - if( isobserver(adminmob) ) + if(isobserver(adminmob)) qdel(adminmob) SSblackbox.record_feedback("tally", "admin_verb", 1, "Assume Direct Control") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -644,7 +644,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention) if(alert("Should the items in their pockets be dropped? Selecting \"No\" will delete them.", "Robust quick dress shop", "Yes", "No") == "No") delete_pocket = TRUE - for (var/obj/item/I in H.get_equipped_items(delete_pocket)) + for(var/obj/item/I in H.get_equipped_items(delete_pocket)) qdel(I) if(dresscode != "Naked") H.equipOutfit(dresscode) diff --git a/code/modules/admin/verbs/getlogs.dm b/code/modules/admin/verbs/getlogs.dm index 88bcc889a22..146d66cad4f 100644 --- a/code/modules/admin/verbs/getlogs.dm +++ b/code/modules/admin/verbs/getlogs.dm @@ -29,11 +29,11 @@ message_admins("[key_name_admin(src)] accessed file: [path]") switch(alert("View (in game), Open (in your system's text editor), or Download?", path, "View", "Open", "Download")) - if ("View") + if("View") src << browse("

[html_encode(wrap_file2text(wrap_file(path)))]
", list2params(list("window" = "viewfile.[path]"))) - if ("Open") + if("Open") src << run(wrap_file(path)) - if ("Download") + if("Download") src << ftp(wrap_file(path)) else return diff --git a/code/modules/admin/verbs/infiltratorteam_syndicate.dm b/code/modules/admin/verbs/infiltratorteam_syndicate.dm index 988f5e155ed..212519d85fb 100644 --- a/code/modules/admin/verbs/infiltratorteam_syndicate.dm +++ b/code/modules/admin/verbs/infiltratorteam_syndicate.dm @@ -156,7 +156,7 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0) // Uplink var/obj/item/implant/uplink/sit/U = new /obj/item/implant/uplink/sit(src) U.implant(src) - if (flag_mgmt) + if(flag_mgmt) U.hidden_uplink.uses = 2500 else U.hidden_uplink.uses = num_tc @@ -174,7 +174,7 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0) equip_to_slot_or_del(new /obj/item/clothing/shoes/chameleon/noslip(src), SLOT_HUD_SHOES) var/obj/item/card/id/syndicate/W = new(src) - if (flag_mgmt) + if(flag_mgmt) W.icon_state = "commander" else W.icon_state = "id" diff --git a/code/modules/admin/verbs/mapping_verbs.dm b/code/modules/admin/verbs/mapping_verbs.dm index 1b4d5a18851..ce193e1b289 100644 --- a/code/modules/admin/verbs/mapping_verbs.dm +++ b/code/modules/admin/verbs/mapping_verbs.dm @@ -84,7 +84,7 @@ GLOBAL_VAR_INIT(intercom_range_display_status, 0) if(C1.loc == C2.loc) output += "
  • overlapping sec. cameras at \[[C1.x], [C1.y], [C1.z]\] ([C1.loc.loc]) Networks: [C1.network] and [C2.network]
  • " var/turf/T = get_step(C1,turn(C1.dir,180)) - if(!T || !isturf(T) || !T.density ) + if(!T || !isturf(T) || !T.density) if(!(locate(/obj/structure/grille,T))) var/window_check = 0 for(var/obj/structure/window/W in T) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 3ae974bf76d..12de20e5eca 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -142,7 +142,7 @@ var/msg = clean_input("Message:", "Enter the text you wish to appear to your target:") - if( !msg ) + if(!msg) return msg = admin_pencode_to_html(msg) diff --git a/code/modules/atmospherics/environmental/LINDA_fire.dm b/code/modules/atmospherics/environmental/LINDA_fire.dm index f9965facdf2..2dc8bd21e1d 100644 --- a/code/modules/atmospherics/environmental/LINDA_fire.dm +++ b/code/modules/atmospherics/environmental/LINDA_fire.dm @@ -311,7 +311,7 @@ for(var/dir in GLOB.cardinal) var/turf/link = get_step(T, dir) - if (!link) + if(!link) continue // Check if it wasn't already visited and if you can get to that turf if(!closed[link] && T.CanAtmosPass(link)) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm index ef2a0d5bfcc..e15a07cda7b 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm @@ -78,7 +78,7 @@ Thus, the two variables affect pump operation are set in New(): var/output_starting_pressure = air2.return_pressure() - if( (target_pressure - output_starting_pressure) < 0.01) + if((target_pressure - output_starting_pressure) < 0.01) //No need to pump gas if target is already reached! return 1 diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index 988d3c897c7..6aad4743a2b 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -100,7 +100,7 @@ var/output_starting_pressure = air3.return_pressure() - if(output_starting_pressure >= target_pressure || air2.return_pressure() >= target_pressure ) + if(output_starting_pressure >= target_pressure || air2.return_pressure() >= target_pressure) //No need to mix if target is already full! return 1 diff --git a/code/modules/atmospherics/machinery/other/area_atmos_computer.dm b/code/modules/atmospherics/machinery/other/area_atmos_computer.dm index 71103e4f29c..97d4206e44d 100644 --- a/code/modules/atmospherics/machinery/other/area_atmos_computer.dm +++ b/code/modules/atmospherics/machinery/other/area_atmos_computer.dm @@ -168,7 +168,7 @@ var/turf/T2 = get_turf(scrubber) if(T2 && T2.loc) var/area/A2 = T2.loc - if(istype(A2) && A2 == A ) + if(istype(A2) && A2 == A) connectedscrubbers += scrubber found = 1 diff --git a/code/modules/buildmode/submodes/advanced.dm b/code/modules/buildmode/submodes/advanced.dm index 2cf90277c03..ef49d6183c5 100644 --- a/code/modules/buildmode/submodes/advanced.dm +++ b/code/modules/buildmode/submodes/advanced.dm @@ -36,7 +36,7 @@ var/alt_click = pa.Find("alt") if(left_click && alt_click) - if (isturf(object) || isobj(object) || ismob(object)) + if(isturf(object) || isobj(object) || ismob(object)) objholder = object.type to_chat(user, "[initial(object.name)] ([object.type]) selected.") else diff --git a/code/modules/client/preference/character.dm b/code/modules/client/preference/character.dm index 2532e1d3235..f882175d260 100644 --- a/code/modules/client/preference/character.dm +++ b/code/modules/client/preference/character.dm @@ -941,7 +941,7 @@ if(hair_style.secondary_theme) var/icon/hair_secondary_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_[hair_style.secondary_theme]_s") - if(!hair_style.no_sec_colour && hair_style.do_colouration ) + if(!hair_style.no_sec_colour && hair_style.do_colouration) hair_secondary_s.Blend(h_sec_colour, ICON_ADD) hair_s.Blend(hair_secondary_s, ICON_OVERLAY) diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 6fa752aba28..b1f2c18063c 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -416,7 +416,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts if(GLOB.configuration.general.allow_character_metadata) dat += "OOC Notes: Edit
    " dat += "Parallax (Fancy Space): " - switch (parallax) + switch(parallax) if(PARALLAX_LOW) dat += "Low" if(PARALLAX_MED) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index f4383659f97..ed5f8178d20 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -161,7 +161,7 @@ return var/obj/item/clothing/ears/O - if(slot_flags & SLOT_FLAG_TWOEARS ) + if(slot_flags & SLOT_FLAG_TWOEARS) O = (H.l_ear == src ? H.r_ear : H.l_ear) user.unEquip(O) if(!istype(src, /obj/item/clothing/ears/offear)) diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm index 98c399eeef2..b3dbe8df3f8 100644 --- a/code/modules/clothing/masks/breath.dm +++ b/code/modules/clothing/masks/breath.dm @@ -26,7 +26,7 @@ /obj/item/clothing/mask/breath/AltClick(mob/user) ..() - if( (!in_range(src, user)) || user.stat || user.restrained() ) + if((!in_range(src, user)) || user.stat || user.restrained()) return adjustmask(user) diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 98b2ced23e2..fbcab10b206 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -336,7 +336,7 @@ var/key = phrase_list[phrase] var/message = phrase_list[key] - if (!safety) + if(!safety) to_chat(user, "You set the restrictor to: FUCK YOUR CUNT YOU SHIT EATING COCKSUCKER MAN EAT A DONG FUCKING ASS RAMMING SHIT FUCK EAT PENISES IN YOUR FUCK FACE AND SHIT OUT ABORTIONS OF FUCK AND DO SHIT IN YOUR ASS YOU COCK FUCK SHIT MONKEY FUCK ASS WANKER FROM THE DEPTHS OF SHIT.") return diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index 10b42b57ffc..a67c28f39e2 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -41,10 +41,10 @@ var/mob/M = has_suit.loc A.Grant(M) - if (islist(has_suit.armor) || isnull(has_suit.armor)) // This proc can run before /obj/Initialize has run for U and src, + if(islist(has_suit.armor) || isnull(has_suit.armor)) // This proc can run before /obj/Initialize has run for U and src, has_suit.armor = getArmor(arglist(has_suit.armor)) // we have to check that the armor list has been transformed into a datum before we try to call a proc on it // This is safe to do as /obj/Initialize only handles setting up the datum if actually needed. - if (islist(armor) || isnull(armor)) + if(islist(armor) || isnull(armor)) armor = getArmor(arglist(armor)) has_suit.armor = has_suit.armor.attachArmor(armor) diff --git a/code/modules/clothing/under/jobs/plasmamen/_plasmamen.dm b/code/modules/clothing/under/jobs/plasmamen/_plasmamen.dm index 798f3b696bb..a558758822b 100644 --- a/code/modules/clothing/under/jobs/plasmamen/_plasmamen.dm +++ b/code/modules/clothing/under/jobs/plasmamen/_plasmamen.dm @@ -37,8 +37,8 @@ return FALSE /obj/item/clothing/under/plasmaman/attackby(obj/item/E, mob/user, params) - if (istype(E, /obj/item/extinguisher_refill)) - if (extinguishes_left == 5) + if(istype(E, /obj/item/extinguisher_refill)) + if(extinguishes_left == 5) to_chat(user, "The inbuilt extinguisher is full.") return else diff --git a/code/modules/crafting/craft.dm b/code/modules/crafting/craft.dm index 63934be525d..22ccf9d3d98 100644 --- a/code/modules/crafting/craft.dm +++ b/code/modules/crafting/craft.dm @@ -52,7 +52,7 @@ var/needed_amount = R.reqs[A] for(var/B in contents) if(ispath(B, A)) - if (R.blacklist.Find(B)) + if(R.blacklist.Find(B)) continue if(contents[B] >= R.reqs[A]) continue main_loop @@ -379,7 +379,7 @@ //Next works nicely with modular arithmetic /datum/personal_crafting/proc/next_cat(readonly = TRUE) - if (!readonly) + if(!readonly) viewing_subcategory = 1 . = viewing_category % categories.len + 1 @@ -391,7 +391,7 @@ //Previous can go fuck itself /datum/personal_crafting/proc/prev_cat(readonly = TRUE) - if (!readonly) + if(!readonly) viewing_subcategory = 1 if(viewing_category == categories.len) . = viewing_category-1 diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index 03b7d8144ae..c72524f7638 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -100,7 +100,7 @@ /obj/item/fluff/tattoo_gun/elliot_cybernetic_tat/attack_self(mob/user as mob) if(!used) var/ink_color = input("Please select an ink color.", "Tattoo Ink Color", rgb(tattoo_r, tattoo_g, tattoo_b)) as color|null - if(ink_color && !(user.incapacitated() || used) ) + if(ink_color && !(user.incapacitated() || used)) tattoo_r = color2R(ink_color) tattoo_g = color2G(ink_color) tattoo_b = color2B(ink_color) diff --git a/code/modules/economy/economy_machinery/atm.dm b/code/modules/economy/economy_machinery/atm.dm index 47d2d1c7c49..8d75ef68f40 100644 --- a/code/modules/economy/economy_machinery/atm.dm +++ b/code/modules/economy/economy_machinery/atm.dm @@ -131,7 +131,7 @@ /obj/machinery/economy/atm/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) - if (!ui) + if(!ui) ui = new(user, src, ui_key, "ATM", name, 550, 650) ui.open() diff --git a/code/modules/events/blob/blob_powers.dm b/code/modules/events/blob/blob_powers.dm index 915dee590b1..0dc7c75625a 100644 --- a/code/modules/events/blob/blob_powers.dm +++ b/code/modules/events/blob/blob_powers.dm @@ -80,7 +80,7 @@ to_chat(src, "This shield blob is too damaged to be modified properly!") return - else if (!can_buy(15)) + else if(!can_buy(15)) return to_chat(src, "You secrete a reflective ooze over the shield blob, allowing it to reflect energy projectiles at the cost of reduced intregrity.") diff --git a/code/modules/food_and_drinks/food/foods/meat.dm b/code/modules/food_and_drinks/food/foods/meat.dm index 30c72cfffef..921a42adf7d 100644 --- a/code/modules/food_and_drinks/food/foods/meat.dm +++ b/code/modules/food_and_drinks/food/foods/meat.dm @@ -397,7 +397,7 @@ qdel(src) /obj/item/reagent_containers/food/snacks/egg/attackby(obj/item/W, mob/user, params) - if(istype( W, /obj/item/toy/crayon )) + if(istype(W, /obj/item/toy/crayon)) var/obj/item/toy/crayon/C = W var/clr = C.colourName diff --git a/code/modules/holiday/christmas.dm b/code/modules/holiday/christmas.dm index 7ba71091e22..3a2325d8f7a 100644 --- a/code/modules/holiday/christmas.dm +++ b/code/modules/holiday/christmas.dm @@ -34,7 +34,7 @@ var/cracked = 0 /obj/item/toy/xmas_cracker/attack(mob/target, mob/user) - if( !cracked && ishuman(target) && (target.stat == CONSCIOUS) && !target.get_active_hand() ) + if(!cracked && ishuman(target) && (target.stat == CONSCIOUS) && !target.get_active_hand()) target.visible_message("[user] and [target] pop \an [src]! *pop*", "You pull \an [src] with [target]! *pop*", "You hear a *pop*.") var/obj/item/paper/Joke = new /obj/item/paper(user.loc) Joke.name = "[pick("awful","terrible","unfunny")] joke" diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 8ff81d93954..5147d391d50 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -91,7 +91,7 @@ qdel(src) return ..() - if (istype(O, /obj/item/plant_analyzer)) + if(istype(O, /obj/item/plant_analyzer)) var/msg = "This is \a [src].\n" if(seed) msg += seed.get_analyzer_text() diff --git a/code/modules/hydroponics/growninedible.dm b/code/modules/hydroponics/growninedible.dm index 5a07e59d95a..9190650405f 100644 --- a/code/modules/hydroponics/growninedible.dm +++ b/code/modules/hydroponics/growninedible.dm @@ -37,7 +37,7 @@ /obj/item/grown/attackby(obj/item/O, mob/user, params) ..() - if (istype(O, /obj/item/plant_analyzer)) + if(istype(O, /obj/item/plant_analyzer)) var/msg = "This is \a [src]\n" if(seed) msg += seed.get_analyzer_text() diff --git a/code/modules/hydroponics/hydroponics_tray.dm b/code/modules/hydroponics/hydroponics_tray.dm index 2dae223177d..f75d2a7a6f9 100644 --- a/code/modules/hydroponics/hydroponics_tray.dm +++ b/code/modules/hydroponics/hydroponics_tray.dm @@ -62,9 +62,9 @@ /obj/machinery/hydroponics/constructable/RefreshParts() var/tmp_capacity = 0 - for (var/obj/item/stock_parts/matter_bin/M in component_parts) + for(var/obj/item/stock_parts/matter_bin/M in component_parts) tmp_capacity += M.rating - for (var/obj/item/stock_parts/manipulator/M in component_parts) + for(var/obj/item/stock_parts/manipulator/M in component_parts) rating = M.rating maxwater = tmp_capacity * 50 // Up to 300 maxnutri = tmp_capacity * 5 // Up to 30 @@ -252,20 +252,20 @@ else weedinvasion() // Weed invasion into empty tray needs_update = 1 - if (needs_update) + if(needs_update) update_state() return /obj/machinery/hydroponics/proc/nutrimentMutation() - if (mutmod == 0) + if(mutmod == 0) return - if (mutmod == 1) + if(mutmod == 1) if(prob(80)) //80% mutate() else if(prob(75)) //15% hardmutate() return - if (mutmod == 2) + if(mutmod == 2) if(prob(50)) //50% mutate() else if(prob(50)) //25% @@ -347,11 +347,11 @@ . += "It has the [myseed.variant] variant of [myseed.plantname] planted." else . += "It has [myseed.plantname] planted." - if (dead) + if(dead) . += "It's dead!" - else if (harvest) + else if(harvest) . += "It's ready to harvest." - else if (plant_health <= (myseed.endurance / 2)) + else if(plant_health <= (myseed.endurance / 2)) . += "It looks unhealthy." else . += "[src] is empty." @@ -445,7 +445,7 @@ /obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent instead. Mind you, this pretty much destroys the old plant - if( weedlevel > 5 ) + if(weedlevel > 5) QDEL_NULL(myseed) var/newWeed = pick(/obj/item/seeds/liberty, /obj/item/seeds/angel, /obj/item/seeds/nettle/death, /obj/item/seeds/kudzu) myseed = new newWeed @@ -673,7 +673,7 @@ if(S.has_reagent("saltpetre", 1)) var/salt = S.get_reagent_amount("saltpetre") adjustHealth(round(salt * 0.25)) - if (myseed) + if(myseed) myseed.adjust_production(-round(salt/100)-prob(salt%100)) myseed.adjust_potency(round(salt*0.50)) // Ash is also used IRL in gardening, as a fertilizer enhancer and weed killer @@ -779,7 +779,7 @@ if(irrigate && transfer_amount > 30 && reagent_source.reagents.total_volume >= 30 && using_irrigation) trays = FindConnected() - if (trays.len > 1) + if(trays.len > 1) visi_msg += ", setting off the irrigation system" if(visi_msg) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 7e07f3f37a0..a52ac4f43db 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -267,7 +267,7 @@ /datum/plant_gene/trait/cell_charge // Cell recharging trait. Charges all mob's power cells to (potency*rate)% mark when eaten. // Generates sparks on squash. - // Small (potency*rate*5) chance to shock squish or slip target for (potency*rate*5) damage. + // Small (potency*rate*5) chance to shock squish or slip target for damage (potency*rate*5). // Multiplies max charge by (rate*100) when used in potato power cells. name = "Electrical Activity" rate = 0.2 diff --git a/code/modules/hydroponics/seed_extractor.dm b/code/modules/hydroponics/seed_extractor.dm index ac1f07a94ed..608ba17e3c8 100644 --- a/code/modules/hydroponics/seed_extractor.dm +++ b/code/modules/hydroponics/seed_extractor.dm @@ -94,7 +94,7 @@ loaded++ add_seed(G, user) - if (loaded) + if(loaded) to_chat(user, "You transfer [loaded] seeds from [O] into [src].") else to_chat(user, "There are no seeds in [O].") @@ -103,7 +103,7 @@ else if(seedify(O,-1, src, user)) to_chat(user, "You extract some seeds.") return - else if (istype(O,/obj/item/seeds)) + else if(istype(O,/obj/item/seeds)) if(add_seed(O, user)) to_chat(user, "You add [O] to [name].") updateUsrDialog() @@ -209,7 +209,7 @@ S.remove_from_storage(O, src) for(var/datum/seed_pile/N in piles) //this for loop physically hurts me - if (O.plantname == N.name && O.variant == N.variant && O.lifespan == N.lifespan && O.endurance == N.endurance && O.maturation == N.maturation && O.production == N.production && O.yield == N.yield && O.potency == N.potency) + if(O.plantname == N.name && O.variant == N.variant && O.lifespan == N.lifespan && O.endurance == N.endurance && O.maturation == N.maturation && O.production == N.production && O.yield == N.yield && O.potency == N.potency) N.amount++ O.forceMove(src) return diff --git a/code/modules/library/library_catalog.dm b/code/modules/library/library_catalog.dm index 6b19e2ff613..6e351833ee9 100644 --- a/code/modules/library/library_catalog.dm +++ b/code/modules/library/library_catalog.dm @@ -434,7 +434,7 @@ //Alright now that we've triple checked that we're ready to do this: //Has this player reported this book already this round? for(var/datum/flagged_book/book in flagged_books) - if (book.bookid == bookid && book.reporter == ckey) + if(book.bookid == bookid && book.reporter == ckey) return FALSE //If not, have they report this book in a previous round? for(var/datum/flagged_book/book in reportedbook.reports) diff --git a/code/modules/lighting/lighting_area.dm b/code/modules/lighting/lighting_area.dm index 6a85fc730c6..b3e3106d523 100644 --- a/code/modules/lighting/lighting_area.dm +++ b/code/modules/lighting/lighting_area.dm @@ -10,13 +10,13 @@ if(IS_DYNAMIC_LIGHTING(src)) cut_overlay(/obj/effect/fullbright) - for (var/turf/T in src) + for(var/turf/T in src) if(IS_DYNAMIC_LIGHTING(T)) T.lighting_build_overlay() else add_overlay(/obj/effect/fullbright) - for (var/turf/T in src) + for(var/turf/T in src) if(T.lighting_object) T.lighting_clear_overlay() diff --git a/code/modules/lighting/lighting_atom.dm b/code/modules/lighting/lighting_atom.dm index d2d4c87eadd..731dfebc6f5 100644 --- a/code/modules/lighting/lighting_atom.dm +++ b/code/modules/lighting/lighting_atom.dm @@ -88,7 +88,7 @@ T.reconsider_lights() /atom/vv_edit_var(var_name, var_value) - switch (var_name) + switch(var_name) if("light_range") set_light(l_range=var_value) return TRUE diff --git a/code/modules/lighting/lighting_source.dm b/code/modules/lighting/lighting_source.dm index c56b91fa172..0e48a81cce4 100644 --- a/code/modules/lighting/lighting_source.dm +++ b/code/modules/lighting/lighting_source.dm @@ -131,14 +131,14 @@ /datum/light_source/proc/remove_lum() applied = FALSE var/thing - for (thing in affecting_turfs) + for(thing in affecting_turfs) var/turf/T = thing LAZYREMOVE(T.affecting_lights, src) affecting_turfs = null var/datum/lighting_corner/C - for (thing in effect_str) + for(thing in effect_str) C = thing REMOVE_CORNER(C) @@ -239,19 +239,19 @@ LAZYINITLIST(affecting_turfs) var/list/L = turfs - affecting_turfs // New turfs, add us to the affecting lights of them. affecting_turfs += L - for (thing in L) + for(thing in L) T = thing LAZYADD(T.affecting_lights, src) L = affecting_turfs - turfs // Now-gone turfs, remove us from the affecting lights. affecting_turfs -= L - for (thing in L) + for(thing in L) T = thing LAZYREMOVE(T.affecting_lights, src) LAZYINITLIST(effect_str) if(needs_update == LIGHTING_VIS_UPDATE) - for (thing in corners - effect_str) // New corners + for(thing in corners - effect_str) // New corners C = thing LAZYADD(C.affecting, src) if(!C.active) @@ -260,7 +260,7 @@ APPLY_CORNER(C) else L = corners - effect_str - for (thing in L) // New corners + for(thing in L) // New corners C = thing LAZYADD(C.affecting, src) if(!C.active) @@ -268,7 +268,7 @@ continue APPLY_CORNER(C) - for (thing in corners - L) // Existing corners + for(thing in corners - L) // Existing corners C = thing if(!C.active) effect_str[C] = 0 @@ -276,7 +276,7 @@ APPLY_CORNER(C) L = effect_str - corners - for (thing in L) // Old, now gone, corners. + for(thing in L) // Old, now gone, corners. C = thing REMOVE_CORNER(C) LAZYREMOVE(C.affecting, src) diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index 5483eebf4e1..366f552e2d4 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -13,7 +13,7 @@ /turf/proc/reconsider_lights() var/datum/light_source/L var/thing - for (thing in affecting_lights) + for(thing in affecting_lights) L = thing L.vis_update() @@ -23,7 +23,7 @@ var/datum/lighting_corner/C var/thing - for (thing in corners) + for(thing in corners) if(!thing) continue C = thing @@ -46,12 +46,12 @@ var/thing var/datum/lighting_corner/C var/datum/light_source/S - for (thing in corners) + for(thing in corners) if(!thing) continue C = thing if(!C.active) // We would activate the corner, calculate the lighting for it. - for (thing in C.affecting) + for(thing in C.affecting) S = thing S.recalc_corner(C) C.active = TRUE @@ -64,7 +64,7 @@ var/totallums = 0 var/thing var/datum/lighting_corner/L - for (thing in corners) + for(thing in corners) if(!thing) continue L = thing @@ -90,7 +90,7 @@ /turf/proc/recalc_atom_opacity() has_opaque_atom = opacity if(!has_opaque_atom) - for (var/atom/A in src.contents) // Loop through every movable atom on our tile PLUS ourselves (we matter too...) + for(var/atom/A in src.contents) // Loop through every movable atom on our tile PLUS ourselves (we matter too...) if(A.opacity) has_opaque_atom = TRUE break @@ -117,7 +117,7 @@ if(!corners) corners = list(null, null, null, null) - for (var/i = 1 to 4) + for(var/i = 1 to 4) if(corners[i]) // Already have a corner on this direction. continue diff --git a/code/modules/maze_generation/maze_generator.dm b/code/modules/maze_generation/maze_generator.dm index 339b595f084..c01115acf16 100644 --- a/code/modules/maze_generation/maze_generator.dm +++ b/code/modules/maze_generation/maze_generator.dm @@ -15,7 +15,7 @@ do { \ var/timer = start_watch(); \ proc2run ;\ log_debug("\[MAZE] Operation '[opname]' on maze at [x],[y],[z] took [stop_watch(timer)]s"); \ -} while (FALSE) +} while(FALSE) // These defines are used to mark the cells as explored or not diff --git a/code/modules/mob/dead/dead.dm b/code/modules/mob/dead/dead.dm index fc53de0a391..6e58372a539 100644 --- a/code/modules/mob/dead/dead.dm +++ b/code/modules/mob/dead/dead.dm @@ -1,7 +1,7 @@ /mob/dead/Login() . = ..() var/turf/T = get_turf(src) - if (isturf(T)) + if(isturf(T)) update_z(T.z) /mob/dead/Logout() @@ -11,7 +11,7 @@ /mob/dead/forceMove(atom/destination, direction = NONE) var/turf/old_turf = get_turf(src) var/turf/new_turf = get_turf(destination) - if (old_turf?.z != new_turf?.z) + if(old_turf?.z != new_turf?.z) onTransitZ(old_turf?.z, new_turf?.z) var/oldloc = loc loc = destination @@ -22,11 +22,11 @@ update_z(new_z) /mob/dead/proc/update_z(new_z) // 1+ to register, null to unregister - if (registered_z != new_z) - if (registered_z) + if(registered_z != new_z) + if(registered_z) SSmobs.dead_players_by_zlevel[registered_z] -= src - if (client) - if (new_z) + if(client) + if(new_z) SSmobs.dead_players_by_zlevel[new_z] += src registered_z = new_z else diff --git a/code/modules/mob/dead/observer/observer_base.dm b/code/modules/mob/dead/observer/observer_base.dm index f640cc7afa8..3250aa20176 100644 --- a/code/modules/mob/dead/observer/observer_base.dm +++ b/code/modules/mob/dead/observer/observer_base.dm @@ -369,7 +369,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp H.remove_hud_from(src) /mob/dead/observer/proc/set_radiation_view(enabled) - if (enabled) + if(enabled) seerads = TRUE START_PROCESSING(SSobj, src) else @@ -711,7 +711,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp update_sight() /mob/dead/observer/update_sight() - if (!ghostvision) + if(!ghostvision) see_invisible = SEE_INVISIBLE_LIVING else see_invisible = SEE_INVISIBLE_OBSERVER diff --git a/code/modules/mob/dead/observer/spells.dm b/code/modules/mob/dead/observer/spells.dm index 60777a4718d..afcd7421196 100644 --- a/code/modules/mob/dead/observer/spells.dm +++ b/code/modules/mob/dead/observer/spells.dm @@ -41,7 +41,7 @@ GLOBAL_LIST_INIT(boo_phrases, list( if(target.get_spooked()) var/area/spook_zone = get_area(target) - if (spook_zone.is_haunted == TRUE) + if(spook_zone.is_haunted == TRUE) to_chat(usr, "The veil is weak in [spook_zone], it took less effort to influence [target].") cooldown_handler.start_recharge(cooldown_handler.recharge_duration / 2) return diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid_update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid_update_icons.dm index 4bbc647996b..9c168e564c4 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid_update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid_update_icons.dm @@ -98,7 +98,7 @@ if(wear_suit.blood_DNA) var/t_suit = "suit" - if( istype(wear_suit, /obj/item/clothing/suit/armor) ) + if(istype(wear_suit, /obj/item/clothing/suit/armor)) t_suit = "armor" standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[t_suit]blood") diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index dc0bbe531fa..c245a8acbfc 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1160,7 +1160,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven if(ispill(toEat)) to_chat(src, "You [toEat.apply_method] [toEat].") else - if(toEat.junkiness && satiety < -150 && nutrition > NUTRITION_LEVEL_STARVING + 50 ) + if(toEat.junkiness && satiety < -150 && nutrition > NUTRITION_LEVEL_STARVING + 50) to_chat(src, "You don't feel like eating any more junk food at the moment.") return 0 if(fullness <= 50) diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm index f6dcb76dd2d..d67b86bd826 100644 --- a/code/modules/mob/living/carbon/examine.dm +++ b/code/modules/mob/living/carbon/examine.dm @@ -291,7 +291,7 @@ msg += "" if(pose) - if( findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0 ) + if(findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0) pose = addtext(pose,".") //Makes sure all emotes end with a period. msg += "\n[p_they(TRUE)] [p_are()] [pose]" diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 8a7d57efd64..ea52824c452 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -264,7 +264,7 @@ var/list/obj/item/organ/external/parts = get_damaged_organs(brute,burn) var/update = 0 - while(parts.len && ( brute > 0 || burn > 0) ) + while(parts.len && ( brute > 0 || burn > 0)) var/obj/item/organ/external/picked = pick(parts) var/brute_was = picked.brute_dam @@ -289,7 +289,7 @@ var/list/obj/item/organ/external/parts = get_damageable_organs() var/update = 0 - while(parts.len && (brute>0 || burn>0) ) + while(parts.len && (brute>0 || burn>0)) var/obj/item/organ/external/picked = pick(parts) var/brute_per_part = brute/parts.len var/burn_per_part = burn/parts.len diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 7abeee4e13f..30cd59debc0 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -748,7 +748,7 @@ emp_act playsound(src, 'sound/effects/space_wind.ogg', 50, TRUE) if(shoes && isclothing(shoes)) var/obj/item/clothing/S = shoes - if (S.flags & NOSLIP) + if(S.flags & NOSLIP) return FALSE return ..() diff --git a/code/modules/mob/living/carbon/human/human_mob.dm b/code/modules/mob/living/carbon/human/human_mob.dm index 39ed2fd66fe..2e51866049d 100644 --- a/code/modules/mob/living/carbon/human/human_mob.dm +++ b/code/modules/mob/living/carbon/human/human_mob.dm @@ -1226,7 +1226,7 @@ if(include_species_change) set_species(new_dna.species.type, retain_damage = TRUE, transformation = TRUE, keep_missing_bodyparts = TRUE) dna = new_dna.Clone() - if (include_species_change) //We have to call this after new_dna.Clone() so that species actions don't get overwritten + if(include_species_change) //We have to call this after new_dna.Clone() so that species actions don't get overwritten dna.species.on_species_gain(src) real_name = new_dna.real_name domutcheck(src, MUTCHK_FORCED) //Ensures species that get powers by the species proc handle_dna keep them @@ -1618,7 +1618,7 @@ Eyes need to have significantly high darksight to shine unless the mob has the X /mob/living/carbon/human/singularity_act() . = 20 if(mind) - if((mind.assigned_role == "Station Engineer") || (mind.assigned_role == "Chief Engineer") ) + if((mind.assigned_role == "Station Engineer") || (mind.assigned_role == "Chief Engineer")) . = 100 if(mind.assigned_role == "Clown") . = rand(-1000, 1000) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 55336d6a6fa..3543ba03393 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -582,7 +582,7 @@ if(pulledby && moving_diagonally != FIRST_DIAG_STEP && get_dist(src, pulledby) > 1) //seperated from our puller and not in the middle of a diagonal move pulledby.stop_pulling() - if(s_active && !(s_active in contents) && get_turf(s_active) != get_turf(src)) //check !( s_active in contents ) first so we hopefully don't have to call get_turf() so much. + if(s_active && !(s_active in contents) && get_turf(s_active) != get_turf(src)) //check !( s_active in contents) first so we hopefully don't have to call get_turf() so much. s_active.close(src) /mob/living/proc/pull_pulled(turf/dest, atom/movable/pullee, movetime) @@ -714,7 +714,7 @@ if(has_limbs) var/turf/T = get_step(src, angle2dir(dir2angle(direction) + 90)) - if (T) + if(T) turfs_to_check += T T = get_step(src, angle2dir(dir2angle(direction) - 90)) @@ -1094,9 +1094,9 @@ if(client) if(new_z) SSmobs.clients_by_zlevel[new_z] += src - for (var/I in length(SSidlenpcpool.idle_mobs_by_zlevel[new_z]) to 1 step -1) //Backwards loop because we're removing (guarantees optimal rather than worst-case performance), it's fine to use .len here but doesn't compile on 511 + for(var/I in length(SSidlenpcpool.idle_mobs_by_zlevel[new_z]) to 1 step -1) //Backwards loop because we're removing (guarantees optimal rather than worst-case performance), it's fine to use .len here but doesn't compile on 511 var/mob/living/simple_animal/SA = SSidlenpcpool.idle_mobs_by_zlevel[new_z][I] - if (SA) + if(SA) SA.toggle_ai(AI_ON) // Guarantees responsiveness for when appearing right next to mobs else SSidlenpcpool.idle_mobs_by_zlevel[new_z] -= SA diff --git a/code/modules/mob/living/living_life.dm b/code/modules/mob/living/living_life.dm index 8fd00117bee..197a7f084ce 100644 --- a/code/modules/mob/living/living_life.dm +++ b/code/modules/mob/living/living_life.dm @@ -11,7 +11,7 @@ message_admins("[src] [ADMIN_FLW(src, "FLW")] has somehow ended up in Z-level [T.z] despite being registered in Z-level [registered_z]. If you could ask them how that happened and notify the coders, it would be appreciated.") log_game("Z-TRACKING: [src] has somehow ended up in Z-level [T.z] despite being registered in Z-level [registered_z].") update_z(T.z) - else if (!client && registered_z) + else if(!client && registered_z) log_game("Z-TRACKING: [src] of type [src.type] has a Z-registration despite not having a client.") update_z(null) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index d65ec5227f9..06b880e98c8 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -380,7 +380,7 @@ msg += "\n[print_flavor_text()]" if(pose) - if( findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0 ) + if(findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0) pose = addtext(pose,".") //Makes sure all emotes end with a period. msg += "\nIt is [pose]" msg += "\n" diff --git a/code/modules/mob/living/silicon/robot/misc_robot_items.dm b/code/modules/mob/living/silicon/robot/misc_robot_items.dm index aae4bbfed08..2079d157fe3 100644 --- a/code/modules/mob/living/silicon/robot/misc_robot_items.dm +++ b/code/modules/mob/living/silicon/robot/misc_robot_items.dm @@ -30,10 +30,10 @@ // see code\modules\paperwork\paper.dm line 62 /obj/item/pen/multi/robopen/proc/RenamePaper(mob/user as mob,obj/paper as obj) - if( !user || !paper ) + if(!user || !paper) return var/n_name = input(user, "What would you like to label the paper?", "Paper Labelling", null) as text - if( !user || !paper ) + if(!user || !paper) return n_name = copytext(n_name, 1, 32) diff --git a/code/modules/mob/living/silicon/robot/robot_damage.dm b/code/modules/mob/living/silicon/robot/robot_damage.dm index 98cb57afc16..2473a05eddb 100644 --- a/code/modules/mob/living/silicon/robot/robot_damage.dm +++ b/code/modules/mob/living/silicon/robot/robot_damage.dm @@ -87,7 +87,7 @@ /mob/living/silicon/robot/heal_overall_damage(brute, burn, updating_health = TRUE) var/list/datum/robot_component/parts = get_damaged_components(brute, burn) - while(LAZYLEN(parts) && (brute > 0 || burn > 0) ) + while(LAZYLEN(parts) && (brute > 0 || burn > 0)) var/datum/robot_component/picked = pick(parts) var/brute_was = picked.brute_damage @@ -117,7 +117,7 @@ A.take_damage(brute, burn, sharp) return - while(LAZYLEN(parts) && (brute > 0 || burn > 0) ) + while(LAZYLEN(parts) && (brute > 0 || burn > 0)) var/datum/robot_component/picked = pick(parts) var/brute_was = picked.brute_damage diff --git a/code/modules/mob/living/silicon/robot/robot_examine.dm b/code/modules/mob/living/silicon/robot/robot_examine.dm index 26f4f65cfa4..16bf9b6b1a1 100644 --- a/code/modules/mob/living/silicon/robot/robot_examine.dm +++ b/code/modules/mob/living/silicon/robot/robot_examine.dm @@ -51,7 +51,7 @@ msg += "\n[print_flavor_text()]\n" if(pose) - if( findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0 ) + if(findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0) pose = addtext(pose,".") //Makes sure all emotes end with a period. msg += "\nIt is [pose]" diff --git a/code/modules/mob/living/silicon/silicon_say.dm b/code/modules/mob/living/silicon/silicon_say.dm index edc655368f3..0420cccf33f 100644 --- a/code/modules/mob/living/silicon/silicon_say.dm +++ b/code/modules/mob/living/silicon/silicon_say.dm @@ -76,7 +76,7 @@ var/obj/machinery/hologram/holopad/T = current if(istype(T) && T.masters[src]) var/obj/effect/overlay/holo_pad_hologram/H = T.masters[src] - if ((client?.prefs.toggles2 & PREFTOGGLE_2_RUNECHAT) && can_hear()) + if((client?.prefs.toggles2 & PREFTOGGLE_2_RUNECHAT) && can_hear()) var/message = combine_message(message_pieces, null, src) create_chat_message(H, message) for(var/mob/M in hearers(T.loc))//The location is the object, default distance. diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 62dc99525db..3271da6504f 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -480,7 +480,7 @@ Pass the desired type path itself, declaring a temporary var beforehand is not r var/atom/A = scan if(!istype(A, scan_type)) //Check that the thing we found is the type we want! continue //If not, keep searching! - if((A.UID() in ignore_list) || (A == old_target) ) //Filter for blacklisted elements, usually unreachable or previously processed oness + if((A.UID() in ignore_list) || (A == old_target)) //Filter for blacklisted elements, usually unreachable or previously processed oness continue var/scan_result = process_scan(A) //Some bots may require additional processing when a result is selected. if(scan_result) diff --git a/code/modules/mob/living/simple_animal/bot/bot_construction.dm b/code/modules/mob/living/simple_animal/bot/bot_construction.dm index 08b35a7994a..875fc6e1a45 100644 --- a/code/modules/mob/living/simple_animal/bot/bot_construction.dm +++ b/code/modules/mob/living/simple_animal/bot/bot_construction.dm @@ -566,7 +566,7 @@ /obj/item/griefsky_assembly/attackby(obj/item/I, mob/user, params) ..() - if((istype(I, /obj/item/melee/energy/sword)) && (build_step < 3 )) + if((istype(I, /obj/item/melee/energy/sword)) && (build_step < 3)) if(!user.unEquip(I)) return build_step++ @@ -581,7 +581,7 @@ qdel(I) qdel(src) - else if((istype(I, /obj/item/toy/sword)) && (toy_step < 3 )) + else if((istype(I, /obj/item/toy/sword)) && (toy_step < 3)) if(!user.unEquip(I)) return toy_step++ diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm index 88c4434625d..7c21d451ec3 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -204,7 +204,7 @@ return data /mob/living/simple_animal/bot/cleanbot/ui_act(action, params) - if (..()) + if(..()) return if(topic_denied(usr)) to_chat(usr, "[src]'s interface is not responding!") diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index d7b062e3b67..95ef953291f 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -66,7 +66,7 @@ if(created_name == initial(name) || !created_name) if(lasercolor == "b") name = pick("BLUE BALLER","SANIC","BLUE KILLDEATH MURDERBOT") - else if (lasercolor == "r") + else if(lasercolor == "r") name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT") /mob/living/simple_animal/bot/ed209/proc/setup_access() @@ -118,7 +118,7 @@ return data /mob/living/simple_animal/bot/ed209/ui_act(action, params) - if (..()) + if(..()) return if(topic_denied(usr)) to_chat(usr, "[src]'s interface is not responding!") @@ -435,7 +435,7 @@ lastfired = world.time var/turf/T = loc var/atom/U = (istype(target, /atom/movable) ? target.loc : target) - if((!( U ) || !( T ))) + if((!U || !T)) return while(!isturf(U)) U = U.loc diff --git a/code/modules/mob/living/simple_animal/bot/griefsky.dm b/code/modules/mob/living/simple_animal/bot/griefsky.dm index 1130805024f..278899b0d0f 100644 --- a/code/modules/mob/living/simple_animal/bot/griefsky.dm +++ b/code/modules/mob/living/simple_animal/bot/griefsky.dm @@ -154,7 +154,7 @@ /mob/living/simple_animal/bot/secbot/griefsky/look_for_perp() anchored = FALSE - for (var/mob/living/carbon/C in view(7,src)) //Let's find us a criminal + for(var/mob/living/carbon/C in view(7,src)) //Let's find us a criminal if((C.stat) || (C.handcuffed)) continue diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index dab20fadc0e..03ca50c23d8 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -187,7 +187,7 @@ return data /mob/living/simple_animal/bot/medbot/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) - if (..()) + if(..()) return if(topic_denied(usr)) to_chat(usr, "[src]'s interface is not responding!") diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 8b1fc0d8efc..e0a775dade6 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -133,7 +133,7 @@ return data /mob/living/simple_animal/bot/secbot/ui_act(action, params) - if (..()) + if(..()) return if(topic_denied(usr)) to_chat(usr, "[src]'s interface is not responding!") @@ -330,7 +330,7 @@ if(BOT_PREP_ARREST) // preparing to arrest target // see if he got away. If he's no no longer adjacent or inside a closet or about to get up, we hunt again. - if( !Adjacent(target) || !isturf(target.loc) || world.time - target.stam_regen_start_time < 4 SECONDS && target.getStaminaLoss() <= 100) + if(!Adjacent(target) || !isturf(target.loc) || world.time - target.stam_regen_start_time < 4 SECONDS && target.getStaminaLoss() <= 100) back_to_hunt() return diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index cf27a9e6f60..d702d7c42d2 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -159,7 +159,7 @@ if((movement_target) && !(isturf(movement_target.loc) || ishuman(movement_target.loc))) movement_target = null stop_automated_movement = FALSE - if( !movement_target || !(movement_target.loc in oview(src, 3)) ) + if(!movement_target || !(movement_target.loc in oview(src, 3))) movement_target = null stop_automated_movement = FALSE for(var/mob/living/simple_animal/mouse/snack in oview(src,3)) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index e57f21ab13e..4f4862be4cc 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -106,7 +106,7 @@ var/static/list/cardinal_sidestep_directions = list(-90, -45, 0, 45, 90) var/static/list/diagonal_sidestep_directions = list(-45, 0, 45) var/chosen_dir = 0 - if (target_dir & (target_dir - 1)) + if(target_dir & (target_dir - 1)) chosen_dir = pick(diagonal_sidestep_directions) else chosen_dir = pick(cardinal_sidestep_directions) @@ -392,7 +392,7 @@ ranged_cooldown = world.time + ranged_cooldown_time /mob/living/simple_animal/hostile/proc/Shoot(atom/targeted_atom) - if( QDELETED(targeted_atom) || targeted_atom == targets_from.loc || targeted_atom == targets_from ) + if(QDELETED(targeted_atom) || targeted_atom == targets_from.loc || targeted_atom == targets_from) return var/turf/startloc = get_turf(targets_from) if(casingtype) diff --git a/code/modules/mob/living/simple_animal/hostile/mushroom.dm b/code/modules/mob/living/simple_animal/hostile/mushroom.dm index 88e955363dc..ded4a05c710 100644 --- a/code/modules/mob/living/simple_animal/hostile/mushroom.dm +++ b/code/modules/mob/living/simple_animal/hostile/mushroom.dm @@ -72,7 +72,7 @@ if(isliving(the_target)) var/mob/living/L = the_target - if (!faction_check_mob(L) && attack_same == 2) + if(!faction_check_mob(L) && attack_same == 2) return FALSE if(L.stat > stat_attack) return FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm index fc4269a7e0e..b406f470d33 100644 --- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm +++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/reproduction.dm @@ -67,14 +67,14 @@ if(A == src) if(score > 0) new /obj/effect/temp_visual/heart(T) // heart symbol, I am safe here, protected by a friendly spider - else if (score == 0) + else if(score == 0) new /obj/effect/temp_visual/heal(T) // white "+" symbol, I am neutral here else new /obj/effect/temp_visual/at_shield(T) // octagon symbol, I am unsafe here, I need to flee else if(score > 0) new /obj/effect/temp_visual/telekinesis(T) // blue sparks, this is a safe area, I want to go here - else if (score == 0) + else if(score == 0) new /obj/effect/temp_visual/revenant(T) // purple sparks, this is a neutral area, an acceptable choice else new /obj/effect/temp_visual/cult/sparks(T) // red sparks, this is an unsafe area, I won't go here unless fleeing something worse diff --git a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm index 764244207c3..39b5bc47bd6 100644 --- a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm +++ b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm @@ -107,8 +107,8 @@ /mob/living/simple_animal/hostile/venus_human_trap/OpenFire(atom/the_target) - for(var/turf/T in get_line(src,target)) - if (T.density) + for(var/turf/T in get_line(src, target)) + if(T.density) return for(var/obj/O in T) if(O.density) diff --git a/code/modules/mob/living/simple_animal/posessed_object.dm b/code/modules/mob/living/simple_animal/posessed_object.dm index d94cd92e79b..55c2dbffda5 100644 --- a/code/modules/mob/living/simple_animal/posessed_object.dm +++ b/code/modules/mob/living/simple_animal/posessed_object.dm @@ -147,8 +147,8 @@ else ..() - if( possessed_item.loc != src ) - if ( isturf(possessed_item.loc) ) // If we've, say, placed the possessed item on the table move onto the table ourselves instead and put it back inside of us. + if(possessed_item.loc != src) + if(isturf(possessed_item.loc)) // If we've, say, placed the possessed item on the table move onto the table ourselves instead and put it back inside of us. forceMove(possessed_item.loc) possessed_item.forceMove(src) else // If we're inside a toolbox or something, we are inside the item rather than the item inside us. This is so people can see the item in the toolbox. diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 5ca0bd8b87d..ae452633bee 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -174,7 +174,7 @@ nest = null var/turf/T = get_turf(src) - if (T && AIStatus == AI_Z_OFF) + if(T && AIStatus == AI_Z_OFF) SSidlenpcpool.idle_mobs_by_zlevel[T.z] -= src return ..() diff --git a/code/modules/mob/living/simple_animal/slime/slime_life.dm b/code/modules/mob/living/simple_animal/slime/slime_life.dm index 6f261dd9d17..8617910d8fa 100644 --- a/code/modules/mob/living/simple_animal/slime/slime_life.dm +++ b/code/modules/mob/living/simple_animal/slime/slime_life.dm @@ -27,9 +27,9 @@ return var/hungry = 0 - if (nutrition < get_starve_nutrition()) + if(nutrition < get_starve_nutrition()) hungry = 2 - else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition()) + else if(nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition()) hungry = 1 AIproc = TRUE @@ -278,7 +278,7 @@ if(Target) --target_patience - if (target_patience <= 0 || SStun > world.time || Discipline || attacked || docile) // Tired of chasing or something draws out attention + if(target_patience <= 0 || SStun > world.time || Discipline || attacked || docile) // Tired of chasing or something draws out attention target_patience = 0 Target = null @@ -287,9 +287,9 @@ var/hungry = 0 // determines if the slime is hungry - if (nutrition < get_starve_nutrition()) + if(nutrition < get_starve_nutrition()) hungry = 2 - else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition()) + else if(nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition()) hungry = 1 if(!Target) @@ -333,7 +333,7 @@ Target = C break - if (Target) + if(Target) target_patience = rand(5, 7) if(is_adult) target_patience += 3 @@ -352,20 +352,20 @@ /mob/living/simple_animal/slime/proc/handle_mood() var/newmood = "" - if (rabid || attacked) + if(rabid || attacked) newmood = "angry" - else if (docile) + else if(docile) newmood = ":3" - else if (Target) + else if(Target) newmood = "mischievous" - if (!newmood) - if (Discipline && prob(25)) + if(!newmood) + if(Discipline && prob(25)) newmood = "pout" - else if (prob(1)) + else if(prob(1)) newmood = pick("sad", ":3", "pout") - if ((mood == "sad" || mood == ":3" || mood == "pout") && !newmood) + if((mood == "sad" || mood == ":3" || mood == "pout") && !newmood) if(prob(75)) newmood = mood @@ -383,7 +383,7 @@ for(var/mob/living/L in view(7,src)) if(isslime(L) && L != src) ++slimes_near - if (L.stat == DEAD) + if(L.stat == DEAD) ++dead_slimes if(nutrition < get_hunger_nutrition()) t += 10 diff --git a/code/modules/mob/living/simple_animal/slime/slime_mob.dm b/code/modules/mob/living/simple_animal/slime/slime_mob.dm index 8c87c66cfeb..f9005b355a0 100644 --- a/code/modules/mob/living/simple_animal/slime/slime_mob.dm +++ b/code/modules/mob/living/simple_animal/slime/slime_mob.dm @@ -216,7 +216,7 @@ if(prob(probab)) if(istype(O, /obj/structure/window) || istype(O, /obj/structure/grille)) if(nutrition <= get_hunger_nutrition() && !Atkcool) - if (is_adult || prob(5)) + if(is_adult || prob(5)) O.attack_slime(src) Atkcool = TRUE addtimer(VARSET_CALLBACK(src, Atkcool, FALSE), 4.5 SECONDS) @@ -403,7 +403,7 @@ . += "It appears to be alive but unresponsive." if(getBruteLoss()) . += "" - if (getBruteLoss() < 40) + if(getBruteLoss() < 40) . += "It has some punctures in its flesh!" else . += "It has severe punctures and tears in its flesh!" diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 5daf30d30d9..f7a600a1b44 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -110,13 +110,13 @@ if(type) if(type & EMOTE_VISIBLE && !has_vision(information_only=TRUE))//Vision related - if(!(alt)) + if(!alt) return else msg = alt type = alt_type if(type & EMOTE_AUDIBLE && !can_hear())//Hearing related - if(!( alt )) + if(!alt) return else msg = alt @@ -353,13 +353,13 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ return 0 return 1 if(SLOT_HUD_WEAR_MASK) - if( !(slot_flags & SLOT_FLAG_MASK) ) + if(!(slot_flags & SLOT_FLAG_MASK)) return 0 if(H.wear_mask) return 0 return 1 if(SLOT_HUD_BACK) - if( !(slot_flags & SLOT_FLAG_BACK) ) + if(!(slot_flags & SLOT_FLAG_BACK)) return 0 if(H.back) if(!(H.back.flags & NODROP)) @@ -368,7 +368,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ return 0 return 1 if(SLOT_HUD_OUTER_SUIT) - if( !(slot_flags & SLOT_FLAG_OCLOTHING) ) + if(!(slot_flags & SLOT_FLAG_OCLOTHING)) return 0 if(H.wear_suit) if(!(H.wear_suit.flags & NODROP)) @@ -377,7 +377,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ return 0 return 1 if(SLOT_HUD_GLOVES) - if( !(slot_flags & SLOT_FLAG_GLOVES) ) + if(!(slot_flags & SLOT_FLAG_GLOVES)) return 0 if(H.gloves) if(!(H.gloves.flags & NODROP)) @@ -386,7 +386,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ return 0 return 1 if(SLOT_HUD_SHOES) - if( !(slot_flags & SLOT_FLAG_FEET) ) + if(!(slot_flags & SLOT_FLAG_FEET)) return 0 if(H.shoes) if(!(H.shoes.flags & NODROP)) @@ -399,7 +399,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ if(!disable_warning) to_chat(H, "You need a jumpsuit before you can attach this [name].") return 0 - if( !(slot_flags & SLOT_FLAG_BELT) ) + if(!(slot_flags & SLOT_FLAG_BELT)) return 0 if(H.belt) if(!(H.belt.flags & NODROP)) @@ -408,7 +408,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ return 0 return 1 if(SLOT_HUD_GLASSES) - if( !(slot_flags & SLOT_FLAG_EYES) ) + if(!(slot_flags & SLOT_FLAG_EYES)) return 0 if(H.glasses) if(!(H.glasses.flags & NODROP)) @@ -417,7 +417,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ return 0 return 1 if(SLOT_HUD_HEAD) - if( !(slot_flags & SLOT_FLAG_HEAD) ) + if(!(slot_flags & SLOT_FLAG_HEAD)) return 0 if(H.head) if(!(H.head.flags & NODROP)) @@ -426,7 +426,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ return 0 return 1 if(SLOT_HUD_LEFT_EAR) - if( !(slot_flags & SLOT_HUD_LEFT_EAR) ) + if(!(slot_flags & SLOT_HUD_LEFT_EAR)) return 0 if(H.l_ear) if(!(H.l_ear.flags & NODROP)) @@ -435,7 +435,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ return 0 return 1 if(SLOT_HUD_RIGHT_EAR) - if( !(slot_flags & SLOT_HUD_RIGHT_EAR) ) + if(!(slot_flags & SLOT_HUD_RIGHT_EAR)) return 0 if(H.r_ear) if(!(H.r_ear.flags & NODROP)) @@ -444,7 +444,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ return 0 return 1 if(SLOT_HUD_JUMPSUIT) - if( !(slot_flags & SLOT_FLAG_ICLOTHING) ) + if(!(slot_flags & SLOT_FLAG_ICLOTHING)) return 0 if(H.w_uniform) if(!(H.w_uniform.flags & NODROP)) @@ -457,7 +457,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ if(!disable_warning) to_chat(H, "You need a jumpsuit before you can attach this [name].") return 0 - if( !(slot_flags & SLOT_FLAG_ID) ) + if(!(slot_flags & SLOT_FLAG_ID)) return 0 if(H.wear_id) if(!(H.wear_id.flags & NODROP)) @@ -472,7 +472,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ if(!disable_warning) to_chat(H, "You need a jumpsuit before you can attach this [name].") return 0 - if( w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_FLAG_POCKET) ) + if(w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_FLAG_POCKET)) return 1 if(SLOT_HUD_RIGHT_STORE) if(H.r_store) @@ -481,7 +481,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ if(!disable_warning) to_chat(H, "You need a jumpsuit before you can attach this [name].") return 0 - if( w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_FLAG_POCKET) ) + if(w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_FLAG_POCKET)) return 1 return 0 if(SLOT_HUD_SUIT_STORE) @@ -497,7 +497,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ if(!disable_warning) to_chat(usr, "The [name] is too big to attach.") return 0 - if( istype(src, /obj/item/pda) || is_pen(src) || is_type_in_list(src, H.wear_suit.allowed) ) + if(istype(src, /obj/item/pda) || is_pen(src) || is_type_in_list(src, H.wear_suit.allowed)) if(H.s_store) if(!(H.s_store.flags & NODROP)) return 2 @@ -643,29 +643,29 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ to_chat(src, chat_box_examine(result.Join("\n"))) /mob/proc/ret_grab(obj/effect/list_container/mobl/L as obj, flag) - if((!( istype(l_hand, /obj/item/grab) ) && !( istype(r_hand, /obj/item/grab) ))) - if(!( L )) + if((!istype(l_hand, /obj/item/grab) && !istype(r_hand, /obj/item/grab))) + if(!L) return null else return L.container else - if(!( L )) + if(!L) L = new /obj/effect/list_container/mobl( null ) L.container += src L.master = src if(istype(l_hand, /obj/item/grab)) var/obj/item/grab/G = l_hand - if(!( L.container.Find(G.affecting) )) + if(!L.container.Find(G.affecting)) L.container += G.affecting if(G.affecting) G.affecting.ret_grab(L, 1) if(istype(r_hand, /obj/item/grab)) var/obj/item/grab/G = r_hand - if(!( L.container.Find(G.affecting) )) + if(!L.container.Find(G.affecting)) L.container += G.affecting if(G.affecting) G.affecting.ret_grab(L, 1) - if(!( flag )) + if(!flag) if(L.master == src) var/list/temp = list( ) temp += L.container @@ -1548,7 +1548,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ /mob/proc/show_rads(range) for(var/turf/place in range(range, src)) var/rads = SSradiation.get_turf_radiation(place) - if (rads < RAD_BACKGROUND_RADIATION) + if(rads < RAD_BACKGROUND_RADIATION) continue var/strength = round(rads / 1000, 0.1) @@ -1606,7 +1606,7 @@ GLOBAL_LIST_INIT(holy_areas, typecacheof(list( /world/proc/invoke_callback_with_usr(mob/user_mob, datum/callback/invoked_callback, ...) var/temp = usr usr = user_mob - if (length(args) > 2) + if(length(args) > 2) . = invoked_callback.Invoke(arglist(args.Copy(3))) else . = invoked_callback.Invoke() diff --git a/code/modules/mob/mob_emote.dm b/code/modules/mob/mob_emote.dm index d628fe9af49..f702cb366c1 100644 --- a/code/modules/mob/mob_emote.dm +++ b/code/modules/mob/mob_emote.dm @@ -52,7 +52,7 @@ var/input = "" if(!message && !client) CRASH("An empty custom emote was called from a client-less mob.") - else if (!message) + else if(!message) input = sanitize(copytext(input(src,"Choose an emote to display.") as text|null, 1, MAX_MESSAGE_LEN)) else input = message diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index cac0964ad69..8848d66c45c 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -281,7 +281,7 @@ return 0 if(affecting) - if(!isturf(assailant.loc) || ( !isturf(affecting.loc) || assailant.loc != affecting.loc && get_dist(assailant, affecting) > 1) ) + if(!isturf(assailant.loc) || ( !isturf(affecting.loc) || assailant.loc != affecting.loc && get_dist(assailant, affecting) > 1)) qdel(src) return 0 return 1 diff --git a/code/modules/mob/mob_misc_procs.dm b/code/modules/mob/mob_misc_procs.dm index 8031723971d..99a2207ae6f 100644 --- a/code/modules/mob/mob_misc_procs.dm +++ b/code/modules/mob/mob_misc_procs.dm @@ -632,7 +632,7 @@ GLOBAL_LIST_INIT(intents, list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM var/search_pda = 1 for(var/A in searching) - if( search_id && istype(A,/obj/item/card/id) ) + if(search_id && istype(A,/obj/item/card/id)) var/obj/item/card/id/ID = A if(ID.registered_name == oldname) ID.registered_name = newname @@ -641,7 +641,7 @@ GLOBAL_LIST_INIT(intents, list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM if(!search_pda) break search_id = 0 - else if( search_pda && istype(A,/obj/item/pda) ) + else if(search_pda && istype(A,/obj/item/pda)) var/obj/item/pda/PDA = A if(PDA.owner == oldname) PDA.owner = newname diff --git a/code/modules/mob/mob_transformation_simple.dm b/code/modules/mob/mob_transformation_simple.dm index 6ce59fafc11..0afd7acb56f 100644 --- a/code/modules/mob/mob_transformation_simple.dm +++ b/code/modules/mob/mob_transformation_simple.dm @@ -14,11 +14,11 @@ if(istext(new_type)) new_type = text2path(new_type) - if( !ispath(new_type) ) + if(!ispath(new_type)) to_chat(usr, "Invalid type path (new_type = [new_type]) in change_mob_type(). Contact a coder.") return - if( new_type == /mob/new_player ) + if(new_type == /mob/new_player) to_chat(usr, "cannot convert into a new_player mob type.") return @@ -33,7 +33,7 @@ qdel(M) return - if( istext(new_name) ) + if(istext(new_name)) M.name = new_name M.real_name = new_name else diff --git a/code/modules/newscaster/obj/newscaster.dm b/code/modules/newscaster/obj/newscaster.dm index 680e5742d9d..0fc0a4b566e 100644 --- a/code/modules/newscaster/obj/newscaster.dm +++ b/code/modules/newscaster/obj/newscaster.dm @@ -514,7 +514,7 @@ // Redirect screen = NEWSCASTER_CHANNEL viewing_channel = FC - else if (id == "manage_channel") // Channel management + else if(id == "manage_channel") // Channel management FC = locateUID(arguments["uid"]) if(!FC || !FC.can_modify(usr, get_scanned_user(usr)["name"])) return diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 2386021222e..6c5148dfff9 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -366,7 +366,7 @@ if(pin_text) input_element = usr.mind.initial_account.account_pin topic_href_write(id, input_element) - if(href_list["write"] ) + if(href_list["write"]) var/id = href_list["write"] var/input_element = input("Enter what you want to write:", "Write", null, null) as message topic_href_write(id, input_element) @@ -442,7 +442,7 @@ to_chat(user, "You don't know how to write!") else if(istype(P, /obj/item/stamp)) - if((!in_range(src, usr) && loc != user && !( istype(loc, /obj/item/clipboard) ) && loc.loc != user && user.get_active_hand() != P)) + if((!in_range(src, usr) && loc != user && !( istype(loc, /obj/item/clipboard)) && loc.loc != user && user.get_active_hand() != P)) return if(istype(P, /obj/item/stamp/clown)) diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 3817ba28eed..ec5e896beb3 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -197,7 +197,7 @@ W = photocopy(W, bundled = TRUE) if(use_toner && W) toner -= 5 - if (!W) + if(!W) break W.forceMove(P) P.amount++ diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 40d28417caa..d5bb1253621 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -132,10 +132,10 @@ if(ishuman(usr)) var/mob/M = usr - if(!( istype(over_object, /obj/screen) )) + if(!istype(over_object, /obj/screen)) return ..() playsound(loc, "rustle", 50, 1, -5) - if((!( M.restrained() ) && !( M.stat ) && M.back == src)) + if((!M.restrained() && !M.stat && M.back == src)) switch(over_object.name) if("r_hand") M.unEquip(src) diff --git a/code/modules/pda/PDA.dm b/code/modules/pda/PDA.dm index f65e149bfea..3a351bbe544 100644 --- a/code/modules/pda/PDA.dm +++ b/code/modules/pda/PDA.dm @@ -107,7 +107,7 @@ GLOBAL_LIST_EMPTY(PDAs) var/mob/M = loc if(M.incapacitated()) return 0 - if((src in M.contents) || ( isturf(loc) && in_range(src, M) )) + if((src in M.contents) || (isturf(loc) && in_range(src, M))) return 1 else return 0 diff --git a/code/modules/point/point.dm b/code/modules/point/point.dm index 6d15fdc5dce..c25dc793610 100644 --- a/code/modules/point/point.dm +++ b/code/modules/point/point.dm @@ -75,7 +75,7 @@ var/mutable_appearance/pointed_atom_appearance = new(pointed_atom.appearance) var/hover_outline_index = pointed_atom.get_filter("hover_outline") - if (!isnull(hover_outline_index)) + if(!isnull(hover_outline_index)) pointed_atom_appearance.filters.Cut(hover_outline_index, hover_outline_index + 1) create_point_bubble(pointed_atom_appearance, include_arrow) diff --git a/code/modules/power/cables/cable_coil.dm b/code/modules/power/cables/cable_coil.dm index 0abb47e37ef..8b340f1b0ff 100644 --- a/code/modules/power/cables/cable_coil.dm +++ b/code/modules/power/cables/cable_coil.dm @@ -286,7 +286,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain for(var/obj/structure/cable/LC in T) // check to make sure there's no matching cable if(LC == C) // skip the cable we're interacting with continue - if((LC.d1 == nd1 && LC.d2 == nd2) || (LC.d1 == nd2 && LC.d2 == nd1) ) // make sure no cable matches either direction + if((LC.d1 == nd1 && LC.d2 == nd2) || (LC.d1 == nd2 && LC.d2 == nd1)) // make sure no cable matches either direction to_chat(user, "There's already a cable at that position!") return diff --git a/code/modules/power/powernets/powernet_helpers.dm b/code/modules/power/powernets/powernet_helpers.dm index 59058d29098..0a11352a5c3 100644 --- a/code/modules/power/powernets/powernet_helpers.dm +++ b/code/modules/power/powernets/powernet_helpers.dm @@ -121,6 +121,6 @@ else if(istype(power_source, /datum/regional_powernet)) var/drained_power = drained_energy/GLOB.CELLRATE //convert from "joules" to "watts" PN.queued_power_demand += (min(drained_power, max(PN.queued_power_production - PN.queued_power_demand, 0))) - else if (istype(power_source, /obj/item/stock_parts/cell)) + else if(istype(power_source, /obj/item/stock_parts/cell)) cell.use(drained_energy) return drained_energy diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 1cd6c54fe5c..be68b3cb4ea 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -324,7 +324,7 @@ output_used -= excess - if(clev != chargedisplay() ) //if needed updates the icons overlay + if(clev != chargedisplay()) //if needed updates the icons overlay update_icon() return diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 4e9b851ba38..aa2f0aef163 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -240,7 +240,7 @@ if(!user) break if(!issilicon(user)) - if( i>1 && !(src in get_both_hands(user))) //for burst firing + if(i>1 && !(src in get_both_hands(user))) //for burst firing break if(chambered) sprd = round((pick(0.5, -0.5)) * (randomized_gun_spread + randomized_bonus_spread)) diff --git a/code/modules/reagents/chem_splash.dm b/code/modules/reagents/chem_splash.dm index 9b15b6dca5d..e15c57d068e 100644 --- a/code/modules/reagents/chem_splash.dm +++ b/code/modules/reagents/chem_splash.dm @@ -41,7 +41,7 @@ for(var/turf/T in (orange(i, epicenter) - orange(i-1, epicenter))) turflist |= T for(var/turf/T in turflist) - if( !(get_dir(T,epicenter) in GLOB.cardinal) && (abs(T.x - epicenter.x) == abs(T.y - epicenter.y) )) + if(!(get_dir(T,epicenter) in GLOB.cardinal) && (abs(T.x - epicenter.x) == abs(T.y - epicenter.y))) turflist.Remove(T) turflist.Add(T) // we move the purely diagonal turfs to the end of the list. for(var/turf/T in turflist) diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm index e225788fb0f..0ff9334db4e 100644 --- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm +++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm @@ -348,13 +348,13 @@ SStgui.update_uis(src) /obj/machinery/reagentgrinder/proc/is_allowed(obj/item/reagent_containers/O) - for (var/i in blend_items) + for(var/i in blend_items) if(istype(O, i)) return TRUE return FALSE /obj/machinery/reagentgrinder/proc/get_allowed_by_id(obj/item/O) - for (var/i in blend_items) + for(var/i in blend_items) if(istype(O, i)) return blend_items[i] @@ -405,7 +405,7 @@ SStgui.update_uis(src) //Snacks - for (var/obj/item/reagent_containers/food/snacks/O in holdingitems) + for(var/obj/item/reagent_containers/food/snacks/O in holdingitems) if(beaker.reagents.holder_full()) break @@ -413,7 +413,7 @@ if(isnull(allowed)) break - for (var/r_id in allowed) + for(var/r_id in allowed) var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume var/amount = get_juice_amount(O) @@ -443,7 +443,7 @@ SStgui.update_uis(src) //Snacks and Plants - for (var/obj/item/reagent_containers/food/snacks/O in holdingitems) + for(var/obj/item/reagent_containers/food/snacks/O in holdingitems) if(beaker.reagents.holder_full()) break @@ -451,7 +451,7 @@ if(isnull(allowed)) break - for (var/r_id in allowed) + for(var/r_id in allowed) var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume var/amount = allowed[r_id] @@ -482,7 +482,7 @@ remove_object(O) //Sheets and rods(!) - for (var/obj/item/stack/O in holdingitems) + for(var/obj/item/stack/O in holdingitems) if(beaker.reagents.holder_full()) break @@ -495,7 +495,7 @@ if(!space) //if no free space - exit break O.amount -= 1 //remove one from stack - for (var/r_id in allowed) + for(var/r_id in allowed) var/spaceused = min(allowed[r_id] * efficiency, space) space -= spaceused beaker.reagents.add_reagent(r_id, spaceused) @@ -504,11 +504,11 @@ break //Plants - for (var/obj/item/grown/O in holdingitems) + for(var/obj/item/grown/O in holdingitems) if(beaker.reagents.holder_full()) break var/allowed = get_allowed_by_id(O) - for (var/r_id in allowed) + for(var/r_id in allowed) var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume var/amount = allowed[r_id] if(amount == 0) @@ -522,7 +522,7 @@ remove_object(O) //Slime Extractis - for (var/obj/item/slime_extract/O in holdingitems) + for(var/obj/item/slime_extract/O in holdingitems) if(beaker.reagents.holder_full()) break var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume @@ -534,7 +534,7 @@ remove_object(O) //Everything else - Transfers reagents from it into beaker - for (var/obj/item/reagent_containers/O in holdingitems) + for(var/obj/item/reagent_containers/O in holdingitems) if(beaker.reagents.holder_full()) break var/amount = O.reagents.total_volume diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 783d01f37e1..50807d7b54f 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -222,14 +222,14 @@ var/mouth_covered = 0 var/eyes_covered = 0 var/obj/item/safe_thing = null - if( victim.wear_mask ) + if(victim.wear_mask) if(victim.wear_mask.flags_cover & MASKCOVERSEYES) eyes_covered = 1 safe_thing = victim.wear_mask if(victim.wear_mask.flags_cover & MASKCOVERSMOUTH) mouth_covered = 1 safe_thing = victim.wear_mask - if( victim.head ) + if(victim.head) if(victim.head.flags_cover & MASKCOVERSEYES) eyes_covered = 1 safe_thing = victim.head @@ -238,12 +238,12 @@ safe_thing = victim.head if(victim.glasses) eyes_covered = 1 - if( !safe_thing ) + if(!safe_thing) safe_thing = victim.glasses - if( eyes_covered && mouth_covered ) + if(eyes_covered && mouth_covered) to_chat(victim, "Your [safe_thing] protects you from the pepperspray!") return - else if( mouth_covered ) // Reduced effects if partially protected + else if(mouth_covered) // Reduced effects if partially protected to_chat(victim, "Your [safe_thing] protect you from most of the pepperspray!") if(prob(5)) victim.emote("scream") @@ -254,7 +254,7 @@ victim.Weaken(6 SECONDS) victim.drop_item() return - else if( eyes_covered ) // Eye cover is better than mouth cover + else if(eyes_covered) // Eye cover is better than mouth cover to_chat(victim, "Your [safe_thing] protects your eyes from the pepperspray!") victim.EyeBlurry(6 SECONDS) victim.damageoverlaytemp = 30 diff --git a/code/modules/reagents/reagent_containers/dropper.dm b/code/modules/reagents/reagent_containers/dropper.dm index a20a0792c58..553a468b955 100644 --- a/code/modules/reagents/reagent_containers/dropper.dm +++ b/code/modules/reagents/reagent_containers/dropper.dm @@ -39,7 +39,7 @@ if(H.glasses) safe_thing = H.glasses - if(H.wear_mask ) + if(H.wear_mask) if(H.wear_mask.flags_cover & MASKCOVERSEYES) safe_thing = H.wear_mask if(H.head) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 9b4dfeb9ced..5f6d2b0f681 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -210,7 +210,7 @@ GLOBAL_LIST_INIT(conveyor_switches, list()) return var/move_time = 0 - if (slow_factor>1) // yes, 1 is special + if(slow_factor>1) // yes, 1 is special move_time=CEILING(slow_factor, 2) // yes. AM.Move(get_step(loc, forwards), forwards, move_time) @@ -390,7 +390,7 @@ GLOBAL_LIST_INIT(conveyor_switches, list()) switch(action) if("slowFactor") var/value = text2num(params["value"]) - if (value!=null) + if(value!=null) slow_factor = clamp(value, 1, 50) if("toggleOneWay") if(position != DIRECTION_REVERSED) // If you want to forbid reversing - stop using reverse first! diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index fabd294c99e..6dc15c8126f 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -400,8 +400,8 @@ return flush_count++ - if( flush_count >= flush_every_ticks ) - if( contents.len ) + if(flush_count >= flush_every_ticks) + if(contents.len) if(mode == 2) spawn(0) flush() @@ -409,7 +409,7 @@ src.updateDialog() - if(flush && air_contents.return_pressure() >= SEND_PRESSURE ) // flush can happen even without power + if(flush && air_contents.return_pressure() >= SEND_PRESSURE) // flush can happen even without power flush() if(stat & NOPOWER) // won't charge if no power diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 4945a753bb6..8f3a15c754d 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -198,7 +198,7 @@ return FALSE D.init_welded = C.welded C.welded = TRUE - else if (target.GetComponent(/datum/component/two_handed)) + else if(target.GetComponent(/datum/component/two_handed)) to_chat(user, "[target] is too unwieldy to wrap effectively.") return FALSE else diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index b79e0d74237..90a399617a5 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -732,7 +732,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, var/is_lathe = istype(machine, /obj/machinery/r_n_d/protolathe) var/is_imprinter = istype(machine, /obj/machinery/r_n_d/circuit_imprinter) - if (!is_lathe && !is_imprinter) + if(!is_lathe && !is_imprinter) return var/coeff = machine.efficiency_coeff diff --git a/code/modules/research/research.dm b/code/modules/research/research.dm index 23ed13d0019..50e22ec33ca 100644 --- a/code/modules/research/research.dm +++ b/code/modules/research/research.dm @@ -110,7 +110,7 @@ research holder datum. known_tech[T.id] = T /datum/research/proc/CanAddDesign2Known(datum/design/D) - if (D.id in known_designs) + if(D.id in known_designs) return FALSE if(D.id in blacklisted_designs) return FALSE diff --git a/code/modules/ruins/objects_and_mobs/gym.dm b/code/modules/ruins/objects_and_mobs/gym.dm index 7d9077266e2..6fcec57e452 100644 --- a/code/modules/ruins/objects_and_mobs/gym.dm +++ b/code/modules/ruins/objects_and_mobs/gym.dm @@ -58,8 +58,8 @@ /obj/structure/weightmachine/stacklifter/AnimateMachine(mob/living/user) var/lifts = 0 - while (lifts++ < 6) - if (user.loc != src.loc) + while(lifts++ < 6) + if(user.loc != src.loc) break sleep(3) animate(user, pixel_y = -2, time = 3) @@ -78,10 +78,10 @@ add_overlay(swole_overlay) var/reps = 0 user.pixel_y = 5 - while (reps++ < 6) - if (user.loc != src.loc) + while(reps++ < 6) + if(user.loc != src.loc) break - for (var/innerReps = max(reps, 1), innerReps > 0, innerReps--) + for(var/innerReps = max(reps, 1), innerReps > 0, innerReps--) sleep(3) animate(user, pixel_y = (user.pixel_y == 3) ? 5 : 3, time = 3) playsound(user, 'sound/goonstation/effects/spring.ogg', 60, 1) diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm index 33fa7219a22..9c37adbb8c0 100644 --- a/code/modules/shuttle/navigation_computer.dm +++ b/code/modules/shuttle/navigation_computer.dm @@ -157,7 +157,7 @@ return /obj/machinery/computer/camera_advanced/shuttle_docker/proc/canDesignateTarget() - if(!designating_target_loc || !current_user || (eyeobj.loc != designating_target_loc) || (stat & (NOPOWER|BROKEN)) ) + if(!designating_target_loc || !current_user || (eyeobj.loc != designating_target_loc) || (stat & (NOPOWER|BROKEN))) return FALSE return TRUE diff --git a/code/modules/tgs/v3210/v3_api.dm b/code/modules/tgs/v3210/v3_api.dm index ce5422d1ba6..c62118001f4 100644 --- a/code/modules/tgs/v3210/v3_api.dm +++ b/code/modules/tgs/v3210/v3_api.dm @@ -44,14 +44,14 @@ return new /datum/tgs_version("3.2.1.3") /datum/tgs_api/v3210/proc/trim_left(text) - for (var/i = 1 to length(text)) - if (text2ascii(text, i) > 32) + for(var/i = 1 to length(text)) + if(text2ascii(text, i) > 32) return copytext(text, i) return "" /datum/tgs_api/v3210/proc/trim_right(text) - for (var/i = length(text), i > 0, i--) - if (text2ascii(text, i) > 32) + for(var/i = length(text), i > 0, i--) + if(text2ascii(text, i) > 32) return copytext(text, 1, i + 1) return "" @@ -66,7 +66,7 @@ var/list/logs = TGS_FILE2LIST(".git/logs/HEAD") if(logs.len) logs = splittext(logs[logs.len], " ") - if (logs.len >= 2) + if(logs.len >= 2) commit = logs[2] else TGS_ERROR_LOG("Error parsing commit logs") @@ -74,7 +74,7 @@ logs = TGS_FILE2LIST(".git/logs/refs/remotes/origin/master") if(logs.len) logs = splittext(logs[logs.len], " ") - if (logs.len >= 2) + if(logs.len >= 2) originmastercommit = logs[2] else TGS_ERROR_LOG("Error parsing origin commmit logs") diff --git a/code/modules/tgs/v4/v4_api.dm b/code/modules/tgs/v4/v4_api.dm index b9a75c4abb4..cce3b00bb26 100644 --- a/code/modules/tgs/v4/v4_api.dm +++ b/code/modules/tgs/v4/v4_api.dm @@ -155,7 +155,7 @@ return if(TGS4_TOPIC_CHANGE_PORT) var/new_port = text2num(params[TGS4_PARAMETER_DATA]) - if (!(new_port > 0)) + if(!(new_port > 0)) return "Invalid port: [new_port]" //the topic still completes, miraculously @@ -266,7 +266,7 @@ message = UpgradeDeprecatedChatMessage(message) - if (!length(channels)) + if(!length(channels)) return message = list("message" = message.text, "channelIds" = ids) @@ -279,12 +279,12 @@ var/list/channels = list() for(var/I in ChatChannelInfo()) var/datum/tgs_chat_channel/channel = I - if (!channel.is_private_channel && ((channel.is_admin_channel && admin_only) || (!channel.is_admin_channel && !admin_only))) + if(!channel.is_private_channel && ((channel.is_admin_channel && admin_only) || (!channel.is_admin_channel && !admin_only))) channels += channel.id message = UpgradeDeprecatedChatMessage(message) - if (!length(channels)) + if(!length(channels)) return message = list("message" = message.text, "channelIds" = channels) diff --git a/code/modules/tgs/v5/v5_api.dm b/code/modules/tgs/v5/v5_api.dm index 60f1c00bdaf..fb2c46cc41c 100644 --- a/code/modules/tgs/v5/v5_api.dm +++ b/code/modules/tgs/v5/v5_api.dm @@ -167,7 +167,7 @@ message = UpgradeDeprecatedChatMessage(message) - if (!length(channels)) + if(!length(channels)) return message = message._interop_serialize() @@ -181,12 +181,12 @@ var/list/channels = list() for(var/I in ChatChannelInfo()) var/datum/tgs_chat_channel/channel = I - if (!channel.is_private_channel && ((channel.is_admin_channel && admin_only) || (!channel.is_admin_channel && !admin_only))) + if(!channel.is_private_channel && ((channel.is_admin_channel && admin_only) || (!channel.is_admin_channel && !admin_only))) channels += channel.id message = UpgradeDeprecatedChatMessage(message) - if (!length(channels)) + if(!length(channels)) return message = message._interop_serialize() diff --git a/code/modules/tgs/v5/v5_chunking.dm b/code/modules/tgs/v5/v5_chunking.dm index cd5944d34fb..fa58263f7dc 100644 --- a/code/modules/tgs/v5/v5_chunking.dm +++ b/code/modules/tgs/v5/v5_chunking.dm @@ -14,7 +14,7 @@ chunk_requests = list() for(var/i in 1 to chunk_count) var/start_index = 1 + ((i - 1) * max_chunk_size) - if (start_index > data_length) + if(start_index > data_length) break var/end_index = min(1 + (i * max_chunk_size), data_length + 1) diff --git a/code/modules/tgs/v5/v5_topic.dm b/code/modules/tgs/v5/v5_topic.dm index 56c1824fd97..68d0db27f36 100644 --- a/code/modules/tgs/v5/v5_topic.dm +++ b/code/modules/tgs/v5/v5_topic.dm @@ -69,7 +69,7 @@ return TopicResponse("Invalid or missing [DMAPI5_EVENT_NOTIFICATION_PARAMETERS]!") var/list/event_call = list(event_type) - if (event_type == TGS_EVENT_WATCHDOG_DETACH) + if(event_type == TGS_EVENT_WATCHDOG_DETACH) detached = TRUE chat_channels.Cut() // https://github.com/tgstation/tgstation-server/issues/1490 @@ -86,7 +86,7 @@ if(DMAPI5_TOPIC_COMMAND_CHANGE_PORT) var/new_port = topic_parameters[DMAPI5_TOPIC_PARAMETER_NEW_PORT] - if (!isnum(new_port) || !(new_port > 0)) + if(!isnum(new_port) || !(new_port > 0)) return TopicResponse("Invalid or missing [DMAPI5_TOPIC_PARAMETER_NEW_PORT]]") if(event_handler != null) @@ -131,7 +131,7 @@ if(DMAPI5_TOPIC_COMMAND_SERVER_PORT_UPDATE) var/new_port = topic_parameters[DMAPI5_TOPIC_PARAMETER_NEW_PORT] - if (!isnum(new_port) || !(new_port > 0)) + if(!isnum(new_port) || !(new_port > 0)) return TopicResponse("Invalid or missing [DMAPI5_TOPIC_PARAMETER_NEW_PORT]]") server_port = new_port @@ -146,20 +146,20 @@ detached = FALSE var/new_port = topic_parameters[DMAPI5_TOPIC_PARAMETER_NEW_PORT] var/error_message = null - if (new_port != null) - if (!isnum(new_port) || !(new_port > 0)) + if(new_port != null) + if(!isnum(new_port) || !(new_port > 0)) error_message = "Invalid [DMAPI5_TOPIC_PARAMETER_NEW_PORT]]" else server_port = new_port var/new_version_string = topic_parameters[DMAPI5_TOPIC_PARAMETER_NEW_SERVER_VERSION] - if (!istext(new_version_string)) + if(!istext(new_version_string)) if(error_message != null) error_message += ", " error_message += "Invalid or missing [DMAPI5_TOPIC_PARAMETER_NEW_SERVER_VERSION]]" else var/datum/tgs_version/new_version = new(new_version_string) - if (event_handler) + if(event_handler) event_handler.HandleEvent(TGS_EVENT_WATCHDOG_REATTACH, new_version) version = new_version diff --git a/goon/code/datums/browserOutput.dm b/goon/code/datums/browserOutput.dm index 8beb2894a9e..4ddfff35bcc 100644 --- a/goon/code/datums/browserOutput.dm +++ b/goon/code/datums/browserOutput.dm @@ -195,7 +195,7 @@ GLOBAL_LIST_EMPTY(bicon_cache) CHECK_TICK //Add autoban using the DB_ban_record function //Uh oh this fucker has a history of playing on a banned account!! - if (found.len > 0) + if(found.len > 0) message_admins("[key_name(src.owner)] has a cookie from a banned account! (Matched: [found["ckey"]], [found["ip"]], [found["compid"]])") log_admin("[key_name(src.owner)] has a cookie from a banned account! (Matched: [found["ckey"]], [found["ip"]], [found["compid"]])") new /datum/cookie_record(owner.ckey, found["ckey"], found["ip"], found["compid"]) @@ -237,7 +237,7 @@ GLOBAL_LIST_EMPTY(bicon_cache) // exporting it as text, and then parsing the base64 from that. // (This relies on byond automatically storing icons in savefiles as base64) /proc/icon2base64(icon/icon, iconKey = "misc") - if (!isicon(icon)) return 0 + if(!isicon(icon)) return 0 GLOB.iconCache[iconKey] << icon var/iconData = GLOB.iconCache.ExportText(iconKey) @@ -246,11 +246,11 @@ GLOBAL_LIST_EMPTY(bicon_cache) /proc/bicon(obj, use_class = 1) var/class = use_class ? "class='icon misc'" : null - if (!obj) + if(!obj) return - if (isicon(obj)) - if (!GLOB.bicon_cache["\ref[obj]"]) // Doesn't exist yet, make it. + if(isicon(obj)) + if(!GLOB.bicon_cache["\ref[obj]"]) // Doesn't exist yet, make it. GLOB.bicon_cache["\ref[obj]"] = icon2base64(obj) return "" @@ -258,9 +258,9 @@ GLOBAL_LIST_EMPTY(bicon_cache) // Either an atom or somebody fucked up and is gonna get a runtime, which I'm fine with. var/atom/A = obj var/key = "[istype(A.icon, /icon) ? "\ref[A.icon]" : A.icon]:[A.icon_state]" - if (!GLOB.bicon_cache[key]) // Doesn't exist, make it. + if(!GLOB.bicon_cache[key]) // Doesn't exist, make it. var/icon/I = icon(A.icon, A.icon_state, SOUTH, 1) - if (ishuman(obj)) // Shitty workaround for a BYOND issue. + if(ishuman(obj)) // Shitty workaround for a BYOND issue. var/icon/temp = I I = icon() I.Insert(temp, dir = SOUTH) diff --git a/tools/ci/check_grep2.py b/tools/ci/check_grep2.py index 8038ad3dba8..54f63998cdc 100644 --- a/tools/ci/check_grep2.py +++ b/tools/ci/check_grep2.py @@ -94,13 +94,30 @@ def check_for_nanotrasen_camel_case(lines): for idx, line in enumerate(lines): if NANOTRASEN_CAMEL_CASE.search(line): return Failure(idx + 1, "Nanotrasen should not be spelled in the camel case form.") - + TO_CHAT_WITH_NO_USER_ARG_RE = re.compile(r"to_chat\(\"") def check_to_chats_have_a_user_arguement(lines): for idx, line in enumerate(lines): if TO_CHAT_WITH_NO_USER_ARG_RE.search(line): return Failure(idx + 1, "Changed files contains a to_chat() procedure without a user argument.") +CONDITIONAL_LEADING_SPACE = re.compile(r"(if|for|while|switch)\s+(\(.*?\))") # checks for "if (thing)", replace with $1$2 +CONDITIONAL_BEGINNING_SPACE = re.compile(r"(if|for|while|switch)(\(.+) \)") # checks for "if( thing)", replace with $1$2) +CONDITIONAL_ENDING_SPACE = re.compile(r"(if|for|while|switch)\( (.+\))") # checks for "if(thing )", replace with $1($2 +CONDITIONAL_INFIX_NOT_SPACE = re.compile(r"(if)\(! (.+\))") # checks for "if(! thing)", replace with $1(!$2 +# To fix any of these, run them as regex in VSCode, with the appropriate replacement +# It may be a good idea to turn the replacement into a script someday +def check_conditional_spacing(lines): + for idx, line in enumerate(lines): + if CONDITIONAL_LEADING_SPACE.search(line): + return Failure(idx + 1, "Found a conditional statement matching the format \"if (thing)\", please use \"if(thing)\" instead.") + if CONDITIONAL_BEGINNING_SPACE.search(line): + return Failure(idx + 1, "Found a conditional statement matching the format \"if( thing)\", please use \"if(thing)\" instead.") + if CONDITIONAL_ENDING_SPACE.search(line): + return Failure(idx + 1, "Found a conditional statement matching the format \"if(thing )\", please use \"if(thing)\" instead.") + if CONDITIONAL_INFIX_NOT_SPACE.search(line): + return Failure(idx + 1, "Found a conditional statement matching the format \"if(! thing)\", please use \"if(!thing)\" instead.") + CODE_CHECKS = [ check_space_indentation, check_mixed_indentation, @@ -109,6 +126,7 @@ CODE_CHECKS = [ check_proc_args_with_var_prefix, check_for_nanotrasen_camel_case, check_to_chats_have_a_user_arguement, + check_conditional_spacing, ]