Skip to content

Commit

Permalink
Fixes roundend abnormality report (#1580)
Browse files Browse the repository at this point in the history
* Fixes roundend abnormality report

* Another thing
  • Loading branch information
EgorDinamit authored Oct 29, 2023
1 parent 0760cd8 commit 8438086
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions code/__HELPERS/roundend.dm
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,14 @@
/datum/controller/subsystem/ticker/proc/abnormality_report()
var/list/parts = list()
var/datum/abnormality/highest_abno = null
var/highest_work_count = 0
var/full_abno_count = 0
var/list/abno_count = list(0, 0, 0, 0, 0)
for(var/datum/abnormality/A in SSlobotomy_corp.all_abnormality_datums)
if(!highest_abno || A.work_logs.len > highest_abno.work_logs.len)
var/work_count = 0
for(var/worker in A.work_stats)
work_count += A.work_stats[worker]["works"]
if(work_count > highest_work_count)
highest_abno = A
abno_count[A.threat_level] += 1
full_abno_count += 1
Expand All @@ -429,14 +433,15 @@
continue
parts += "[FOURSPACES][FOURSPACES]<span style='color: [THREAT_TO_COLOR[i]]'>[abno_count[i]] [THREAT_TO_NAME[i]]s.</span>"
if(istype(highest_abno))
parts += "<br>[FOURSPACES][highest_abno.name] has been worked on the most, for a total of [highest_abno.work_logs.len] sessions.<br>"
parts += "<br>[FOURSPACES][highest_abno.name] has been worked on the most, for a total of [highest_work_count] sessions.<br>"
if(LAZYLEN(highest_abno.work_stats))
var/highest_worker = null
var/highest_work_num = -1
for(var/worker_name in highest_abno.work_stats)
var/curr_work_num = highest_abno.work_stats["works"]
var/curr_work_num = highest_abno.work_stats[worker_name]["works"]
if(curr_work_num > highest_work_num)
highest_worker = worker_name
highest_work_num = curr_work_num
if(highest_worker)
var/total_attr_points = 0
for(var/attr in highest_abno.work_stats[highest_worker]["gain"])
Expand Down

0 comments on commit 8438086

Please sign in to comment.