Skip to content

Commit

Permalink
I need to learn to read my todos
Browse files Browse the repository at this point in the history
  • Loading branch information
AffectedArc07 authored and Foxterosa committed May 6, 2020
1 parent f7630bf commit 38570e4
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 38 deletions.
8 changes: 4 additions & 4 deletions code/__DEFINES/role_preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
//Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR.
//The gamemode specific ones are just so the gamemodes can query whether a player is old enough
//(in game days played) to play that role
var/global/list/special_roles = list(
GLOBAL_LIST_INIT(special_roles, list(
ROLE_ABDUCTOR = /datum/game_mode/abduction, // Abductor
ROLE_BLOB = /datum/game_mode/blob, // Blob
ROLE_CHANGELING = /datum/game_mode/changeling, // Changeling
Expand All @@ -72,10 +72,10 @@ var/global/list/special_roles = list(
ROLE_VAMPIRE = /datum/game_mode/vampire, // Vampire
ROLE_RAIDER = /datum/game_mode/heist, // Vox raider
ROLE_ALIEN, // Xenomorph
ROLE_WIZARD = /datum/game_mode/wizard, // Wizard
ROLE_WIZARD = /datum/game_mode/wizard // Wizard
// UNUSED/BROKEN ANTAGS
// ROLE_HOG_GOD = /datum/game_mode/hand_of_god,
// ROLE_HOG_CULTIST = /datum/game_mode/hand_of_god,
// ROLE_MONKEY = /datum/game_mode/monkey, Sooner or later these are going to get ported
// ROLE_GANG = /datum/game_mode/gang,
)
// ROLE_GANG = /datum/game_mode/gang
))
6 changes: 3 additions & 3 deletions code/__HELPERS/names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ GLOBAL_VAR(command_name)
/proc/command_name()
return GLOB.using_map.dock_name

var/religion_name = null
GLOBAL_VAR(religion_name)
/proc/religion_name()
if(religion_name)
return religion_name
if(GLOB.religion_name)
return GLOB.religion_name

var/name = ""

Expand Down
8 changes: 4 additions & 4 deletions code/game/gamemodes/changeling/powers/hivemind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
return

// HIVE MIND UPLOAD/DOWNLOAD DNA
var/list/datum/dna/hivemind_bank = list()
GLOBAL_LIST_EMPTY(hivemind_bank)

/datum/action/changeling/hivemind_upload
name = "Hive Channel DNA"
Expand All @@ -36,7 +36,7 @@ var/list/datum/dna/hivemind_bank = list()
var/datum/changeling/changeling = user.mind.changeling
var/list/names = list()
for(var/datum/dna/DNA in (changeling.absorbed_dna+changeling.protected_dna))
if(!(DNA in hivemind_bank))
if(!(DNA in GLOB.hivemind_bank))
names += DNA.real_name

if(names.len <= 0)
Expand All @@ -51,7 +51,7 @@ var/list/datum/dna/hivemind_bank = list()
if(!chosen_dna)
return

hivemind_bank += chosen_dna
GLOB.hivemind_bank += chosen_dna
to_chat(user, "<span class='notice'>We channel the DNA of [chosen_name] to the air.</span>")
feedback_add_details("changeling_powers","HU")
return 1
Expand All @@ -75,7 +75,7 @@ var/list/datum/dna/hivemind_bank = list()
/datum/action/changeling/hivemind_download/sting_action(var/mob/user)
var/datum/changeling/changeling = user.mind.changeling
var/list/names = list()
for(var/datum/dna/DNA in hivemind_bank)
for(var/datum/dna/DNA in GLOB.hivemind_bank)
if(!(DNA in changeling.absorbed_dna))
names[DNA.real_name] = DNA

Expand Down
8 changes: 4 additions & 4 deletions code/game/gamemodes/devil/devil.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var/global/list/whiteness = list (
GLOBAL_LIST_INIT(whiteness, list(
/obj/item/clothing/under/color/white = 2,
/obj/item/clothing/under/rank/bartender = 1,
/obj/item/clothing/under/rank/chef = 1,
Expand All @@ -21,7 +21,7 @@ var/global/list/whiteness = list (
/obj/item/clothing/under/noble_clothes = 1,
/obj/item/clothing/under/sl_suit = 1,
/obj/item/clothing/under/burial = 1
)
))



Expand All @@ -32,9 +32,9 @@ var/global/list/whiteness = list (
var/mob/living/carbon/human/H = attacker
if(H.w_uniform && istype(H.w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/U = H.w_uniform
if(whiteness[U.type])
if(GLOB.whiteness[U.type])
src.visible_message("<span class='warning'>[src] seems to have been harmed by the purity of [attacker]'s clothes.</span>", "<span class='notice'>Unsullied white clothing is disrupting your form.</span>")
return whiteness[U.type] + 1
return GLOB.whiteness[U.type] + 1
if(BANE_TOOLBOX)
if(istype(weapon,/obj/item/storage/toolbox))
src.visible_message("<span class='warning'>The [weapon] seems unusually robust this time.</span>", "<span class='notice'>The [weapon] is your unmaking!</span>")
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
/datum/event/spawn_swarmer/start()
if(find_swarmer())
return 0
if(!the_gateway)
if(!GLOB.the_gateway)
return 0
new /obj/effect/mob_spawn/swarmer(get_turf(the_gateway))
new /obj/effect/mob_spawn/swarmer(get_turf(GLOB.the_gateway))


/datum/event/spawn_swarmer/proc/find_swarmer()
Expand Down
12 changes: 6 additions & 6 deletions code/game/objects/items/stacks/sheets/mineral.dm
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,13 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT)
point_value = 20

var/global/list/datum/stack_recipe/titanium_recipes = list (
GLOBAL_LIST_INIT(titanium_recipes, list(
new/datum/stack_recipe("titanium tile", /obj/item/stack/tile/mineral/titanium, 1, 4, 20),
new/datum/stack_recipe("surgical tray", /obj/structure/table/tray, 2, one_per_turf = 1, on_floor = 1),
)
))

/obj/item/stack/sheet/mineral/titanium/New(loc, amount=null)
recipes = titanium_recipes
recipes = GLOB.titanium_recipes
..()

/obj/item/stack/sheet/mineral/titanium/fifty
Expand All @@ -328,12 +328,12 @@ var/global/list/datum/stack_recipe/titanium_recipes = list (
materials = list(MAT_TITANIUM=2000, MAT_PLASMA=2000)
point_value = 45

var/global/list/datum/stack_recipe/plastitanium_recipes = list (
GLOBAL_LIST_INIT(plastitanium_recipes, list(
new/datum/stack_recipe("plas-titanium tile", /obj/item/stack/tile/mineral/plastitanium, 1, 4, 20),
)
))

/obj/item/stack/sheet/mineral/plastitanium/New(loc, amount=null)
recipes = plastitanium_recipes
recipes = GLOB.plastitanium_recipes
..()

/obj/item/stack/sheet/mineral/enruranium
Expand Down
10 changes: 5 additions & 5 deletions code/modules/awaymissions/gateway.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var/obj/machinery/gateway/centerstation/the_gateway = null
GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null)
/obj/machinery/gateway
name = "gateway"
desc = "A mysterious gateway built by unknown hands, it allows for faster than light travel to far-flung locations."
Expand Down Expand Up @@ -41,8 +41,8 @@ var/obj/machinery/gateway/centerstation/the_gateway = null

/obj/machinery/gateway/centerstation/New()
..()
if(!the_gateway)
the_gateway = src
if(!GLOB.the_gateway)
GLOB.the_gateway = src

/obj/machinery/gateway/centerstation/Initialize()
..()
Expand All @@ -54,8 +54,8 @@ var/obj/machinery/gateway/centerstation/the_gateway = null
return

/obj/machinery/gateway/centerstation/Destroy()
if(the_gateway == src)
the_gateway = null
if(GLOB.the_gateway == src)
GLOB.the_gateway = null
return ..()

/obj/machinery/gateway/centerstation/update_icon()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/client/preference/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
dat += "<b>You are banned from special roles.</b>"
be_special = list()
else
for(var/i in special_roles)
for(var/i in GLOB.special_roles)
if(jobban_isbanned(user, i))
dat += "<b>Be [capitalize(i)]:</b> <font color=red><b> \[BANNED]</b></font><br>"
else if(!player_old_enough_antag(user.client, i))
Expand Down Expand Up @@ -2023,7 +2023,7 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts

if("be_special")
var/r = href_list["role"]
if(r in special_roles)
if(r in GLOB.special_roles)
be_special ^= r

if("name")
Expand Down
2 changes: 1 addition & 1 deletion code/modules/client/preference/preferences_mysql.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

// Might as well scrub out any malformed be_special list entries while we're here
for(var/role in be_special)
if(!(role in special_roles))
if(!(role in GLOB.special_roles))
log_runtime(EXCEPTION("[C.key] had a malformed role entry: '[role]'. Removing!"), src)
be_special -= role

Expand Down
12 changes: 5 additions & 7 deletions tools/travis/check_grep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ if grep -P 'step_[xy]' _maps/**/*.dmm; then
echo "ERROR: step_x/step_y variables detected in maps, please remove them."
st=1
fi;
#### TODO: Uncomment after managing all globs ####
#if grep -P '^/*var/' code/**/*.dm; then
#echo "ERROR: Unmanaged global var use detected in code, please use the helpers."
#st=1
#fi;
####
if grep -P '^/*var/' code/**/*.dm; then
echo "ERROR: Unmanaged global var use detected in code, please use the helpers."
st=1
fi;
nl='
'
nl=$'\n'
Expand All @@ -31,4 +29,4 @@ while read f; do
fi;
done < <(find . -type f -name '*.dm')

exit $st
exit $st

0 comments on commit 38570e4

Please sign in to comment.