Skip to content

Commit

Permalink
[MIRROR] Specifies one format of variable declaration for the codebas…
Browse files Browse the repository at this point in the history
…e. (#2895)

* Specifies one format of variable declaration for the codebase.

* dumb mirroring
  • Loading branch information
CitadelStationBot authored and Poojawa committed Sep 23, 2017
1 parent 2a860d1 commit eb36f34
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/action_button.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ai_laws.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/antag_spawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/miniantags/slaughter/slaughterevent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/RCD.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mining/abandoned_crates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/reagents/chemistry/machinery/chem_dispenser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions code/modules/reagents/chemistry/machinery/chem_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))) // ^
Expand Down

0 comments on commit eb36f34

Please sign in to comment.