Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix research tier calculation #5751

Merged
merged 2 commits into from Nov 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions code/modules/research/techweb/_techweb.dm
Expand Up @@ -31,8 +31,8 @@
var/list/scanned_atoms = list()
//Discovery cost tiers
var/current_tier = 1
var/list/items_per_tier = list() //Assoc list, Key = "[tier level]", Value = Amount of items in tier
var/list/unlocked_in_tier = list() //Assoc list, Key = "[tier level]", Value = Amount of items unlocked in tier
var/list/items_per_tier = list() //Assoc list, Key = "[tier level]", Value = Amount of nodes in tier
var/list/unlocked_in_tier = list() //Assoc list, Key = "[tier level]", Value = Amount of nodes unlocked in tier

/datum/techweb/New()
SSresearch.techwebs += src
Expand All @@ -43,7 +43,7 @@
items_per_tier = list()
for(var/id in SSresearch.techweb_nodes)
var/datum/techweb_node/node = SSresearch.techweb_node_by_id(id)
if(islist(items_per_tier["[node.tech_tier]"]))
if(items_per_tier["[node.tech_tier]"])
items_per_tier["[node.tech_tier]"] += 1
else
items_per_tier["[node.tech_tier]"] = 1
Expand Down Expand Up @@ -93,7 +93,7 @@
for(var/id in processing)
var/datum/techweb_node/node = SSresearch.techweb_node_by_id(id)
update_node_status(node, FALSE)
if(islist(items_per_tier["[node.tech_tier]"]))
if(items_per_tier["[node.tech_tier]"])
items_per_tier["[node.tech_tier]"] += 1
else
items_per_tier["[node.tech_tier]"] = 1
Expand All @@ -104,9 +104,10 @@
V.updateUsrDialog()

/datum/techweb/proc/recalculate_tiers()
unlocked_in_tier = list()
for(var/id in researched_nodes)
var/datum/techweb_node/node = SSresearch.techweb_node_by_id(id)
if(islist(unlocked_in_tier["[node.tech_tier]"]))
if(unlocked_in_tier["[node.tech_tier]"])
unlocked_in_tier["[node.tech_tier]"] += 1
else
unlocked_in_tier["[node.tech_tier]"] = 1
Expand Down