diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 3e2742de110..46e509cb8f0 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -125,6 +125,9 @@ var/path_type = /obj/item/baseball_bat var/path_type = "/obj/item/baseball_bat" ``` +### Use var/name format when declaring variables +While DM allows other ways of declaring variables, this one should be used for consistency. + ### Tabs, not spaces You must use tabs to indent your code, NOT SPACES. diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm index 85ecd036de6..d4d2c2d8a53 100644 --- a/code/_onclick/hud/action_button.dm +++ b/code/_onclick/hud/action_button.dm @@ -78,7 +78,7 @@ /obj/screen/movable/action_button/hide_toggle/proc/InitialiseIcon(datum/hud/owner_hud) - var settings = owner_hud.get_action_buttons_icons() + var/settings = owner_hud.get_action_buttons_icons() icon = settings["bg_icon"] icon_state = settings["bg_state"] hide_icon = settings["toggle_icon"] diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index 24daad00f9e..2222a959bcc 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -310,7 +310,7 @@ replaceable_groups[LAW_INHERENT] = inherent.len if(supplied.len && (LAW_SUPPLIED in groups)) replaceable_groups[LAW_SUPPLIED] = supplied.len - var picked_group = pickweight(replaceable_groups) + var/picked_group = pickweight(replaceable_groups) switch(picked_group) if(LAW_ZEROTH) . = zeroth diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index 9b585ea6532..64b405bbd59 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -261,7 +261,7 @@ /obj/item/antag_spawner/slaughter_demon/spawn_antag(client/C, turf/T, type = "") - var /obj/effect/dummy/slaughter/holder = new /obj/effect/dummy/slaughter(T) + var/obj/effect/dummy/slaughter/holder = new /obj/effect/dummy/slaughter(T) var/mob/living/simple_animal/slaughter/S = new demon_type(holder) S.holder = holder S.key = C.key diff --git a/code/game/gamemodes/miniantags/slaughter/slaughterevent.dm b/code/game/gamemodes/miniantags/slaughter/slaughterevent.dm index bcb2218fe69..888a10669e7 100644 --- a/code/game/gamemodes/miniantags/slaughter/slaughterevent.dm +++ b/code/game/gamemodes/miniantags/slaughter/slaughterevent.dm @@ -33,7 +33,7 @@ message_admins("No valid spawn locations found, aborting...") return MAP_ERROR - var /obj/effect/dummy/slaughter/holder = new /obj/effect/dummy/slaughter((pick(spawn_locs))) + var/obj/effect/dummy/slaughter/holder = new /obj/effect/dummy/slaughter((pick(spawn_locs))) var/mob/living/simple_animal/slaughter/S = new /mob/living/simple_animal/slaughter/(holder) S.holder = holder player_mind.transfer_to(S) diff --git a/code/game/objects/items/RCD.dm b/code/game/objects/items/RCD.dm index 26cf258c8e8..6e094a5bbb9 100644 --- a/code/game/objects/items/RCD.dm +++ b/code/game/objects/items/RCD.dm @@ -144,7 +144,7 @@ obj/item/construction set category = "Object" set src in usr // What does this do? - var window_type_name + var/window_type_name if (window_type == /obj/structure/window/fulltile) window_type = /obj/structure/window/reinforced/fulltile @@ -240,11 +240,11 @@ obj/item/construction set category = "Object" set src in usr - var airlockcat = input(usr, "Select whether the airlock is solid or glass.") in list("Solid", "Glass") + var/airlockcat = input(usr, "Select whether the airlock is solid or glass.") in list("Solid", "Glass") switch(airlockcat) if("Solid") if(advanced_airlock_setting == 1) - var airlockpaint = input(usr, "Select the paintjob of the airlock.") in list("Default", "Engineering", "Atmospherics", "Security", "Command", "Medical", "Research", "Mining", "Maintenance", "External", "High Security") + var/airlockpaint = input(usr, "Select the paintjob of the airlock.") in list("Default", "Engineering", "Atmospherics", "Security", "Command", "Medical", "Research", "Mining", "Maintenance", "External", "High Security") switch(airlockpaint) if("Default") airlock_type = /obj/machinery/door/airlock @@ -275,7 +275,7 @@ obj/item/construction if("Glass") if(advanced_airlock_setting == 1) - var airlockpaint = input(usr, "Select the paintjob of the airlock.") in list("Default", "Engineering", "Atmospherics", "Security", "Command", "Medical", "Research", "Mining") + var/airlockpaint = input(usr, "Select the paintjob of the airlock.") in list("Default", "Engineering", "Atmospherics", "Security", "Command", "Medical", "Research", "Mining") switch(airlockpaint) if("Default") airlock_type = /obj/machinery/door/airlock/glass diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 48af29616e5..b56caa4e9af 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -431,7 +431,7 @@ else rebootconfirm = TRUE if(rebootconfirm) - var result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options + var/result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options if(result) SSblackbox.add_details("admin_verb","Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! switch(result) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index 76455ada491..2e0d1f38054 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -349,7 +349,7 @@ data["cellTemperature"] = round(air1.temperature, 1) data["isBeakerLoaded"] = beaker ? TRUE : FALSE - var beakerContents = list() + var/beakerContents = list() if(beaker && beaker.reagents && beaker.reagents.reagent_list.len) for(var/datum/reagent/R in beaker.reagents.reagent_list) beakerContents += list(list("name" = R.name, "volume" = R.volume)) diff --git a/code/modules/mining/abandoned_crates.dm b/code/modules/mining/abandoned_crates.dm index 10512aa5a22..4db42b69333 100644 --- a/code/modules/mining/abandoned_crates.dm +++ b/code/modules/mining/abandoned_crates.dm @@ -83,7 +83,7 @@ new /obj/item/clothing/suit/hooded/ian_costume(src) if(67 to 68) for(var/i in 1 to rand(4, 7)) - var /newitem = pick(subtypesof(/obj/item/stock_parts) - /obj/item/stock_parts/subspace) + var/newitem = pick(subtypesof(/obj/item/stock_parts) - /obj/item/stock_parts/subspace) new newitem(src) if(69 to 70) for(var/i in 1 to 5) diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 538ae996ea7..ec4a1f58f89 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -112,8 +112,8 @@ data["maxEnergy"] = cell.maxcharge * powerefficiency data["isBeakerLoaded"] = beaker ? 1 : 0 - var beakerContents[0] - var beakerCurrentVolume = 0 + var/beakerContents[0] + var/beakerCurrentVolume = 0 if(beaker && beaker.reagents && beaker.reagents.reagent_list.len) for(var/datum/reagent/R in beaker.reagents.reagent_list) beakerContents.Add(list(list("name" = R.name, "volume" = R.volume))) // list in a list because Byond merges the first list... @@ -129,7 +129,7 @@ data["beakerMaxVolume"] = null data["beakerTransferAmounts"] = null - var chemicals[0] + var/chemicals[0] var/is_hallucinating = FALSE if(user.hallucinating()) is_hallucinating = TRUE diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 802e4c70ca6..c6a01bc45f5 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -133,13 +133,13 @@ data["pillBotMaxContent"] = bottle.storage_slots - var beakerContents[0] + var/beakerContents[0] if(beaker) for(var/datum/reagent/R in beaker.reagents.reagent_list) beakerContents.Add(list(list("name" = R.name, "id" = R.id, "volume" = R.volume))) // list in a list because Byond merges the first list... data["beakerContents"] = beakerContents - var bufferContents[0] + var/bufferContents[0] if(reagents.total_volume) for(var/datum/reagent/N in reagents.reagent_list) bufferContents.Add(list(list("name" = N.name, "id" = N.id, "volume" = N.volume))) // ^