diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index 09cbb68083..ccc2121929 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -103,7 +103,9 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) if(data_by_z["[z]"] && last_update["[z]"] && world.time <= last_update["[z]"] + SENSORS_UPDATE_PERIOD) return data_by_z["[z]"] - var/list/results = list() + var/list/results_damaged = list() + var/list/results_undamaged = list() + var/obj/item/clothing/under/U var/obj/item/card/id/I var/turf/pos @@ -114,6 +116,7 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) var/toxdam var/burndam var/brutedam + var/totaldam var/area var/pos_x var/pos_y @@ -157,11 +160,13 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) toxdam = round(H.getToxLoss(),1) burndam = round(H.getFireLoss(),1) brutedam = round(H.getBruteLoss(),1) + totaldam = oxydam + toxdam + burndam + brutedam else oxydam = null toxdam = null burndam = null brutedam = null + totaldam = 0 if (nanite_sensors || U.sensor_mode >= SENSOR_COORDS) if (!pos) @@ -174,16 +179,26 @@ GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) pos_x = null pos_y = null - results[++results.len] = list("name" = name, "assignment" = assignment, "ijob" = ijob, "life_status" = life_status, "oxydam" = oxydam, "toxdam" = toxdam, "burndam" = burndam, "brutedam" = brutedam, "area" = area, "pos_x" = pos_x, "pos_y" = pos_y, "can_track" = H.can_track(null)) + var/total_list = list("name" = name, "assignment" = assignment, "ijob" = ijob, "life_status" = life_status, "oxydam" = oxydam, "toxdam" = toxdam, "burndam" = burndam, "brutedam" = brutedam, "totaldam" = totaldam, "area" = area, "pos_x" = pos_x, "pos_y" = pos_y, "can_track" = H.can_track(null)) - data_by_z["[z]"] = sortTim(results,/proc/sensor_compare) + if(totaldam) + results_damaged[++results_damaged.len] = total_list + else + results_undamaged[++results_undamaged.len] = total_list + + var/list/returning = sortTim(results_damaged,/proc/damage_compare) + sortTim(results_undamaged,/proc/ijob_compare) + + data_by_z["[z]"] = returning last_update["[z]"] = world.time - return results + return returning -/proc/sensor_compare(list/a,list/b) +/proc/ijob_compare(list/a,list/b) return a["ijob"] - b["ijob"] +/proc/damage_compare(list/a,list/b) + return b["totaldam"] - a["totaldam"] + /datum/crewmonitor/ui_act(action,params) var/mob/living/silicon/ai/AI = usr if(!istype(AI)) diff --git a/tgstation.dme b/tgstation.dme index 4d74c8a95f..dea02c485f 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2502,12 +2502,6 @@ #include "code\modules\research\server.dm" #include "code\modules\research\stock_parts.dm" #include "code\modules\research\designs\AI_module_designs.dm" -#include "code\modules\research\designs\autolathe_desings\autolathe_designs_construction.dm" -#include "code\modules\research\designs\autolathe_desings\autolathe_designs_electronics.dm" -#include "code\modules\research\designs\autolathe_desings\autolathe_designs_medical_and_dinnerware.dm" -#include "code\modules\research\designs\autolathe_desings\autolathe_designs_sec_and_hacked.dm" -#include "code\modules\research\designs\autolathe_desings\autolathe_designs_tcomms_and_misc.dm" -#include "code\modules\research\designs\autolathe_desings\autolathe_designs_tools.dm" #include "code\modules\research\designs\biogenerator_designs.dm" #include "code\modules\research\designs\bluespace_designs.dm" #include "code\modules\research\designs\comp_board_designs.dm" @@ -2527,6 +2521,12 @@ #include "code\modules\research\designs\stock_parts_designs.dm" #include "code\modules\research\designs\telecomms_designs.dm" #include "code\modules\research\designs\weapon_designs.dm" +#include "code\modules\research\designs\autolathe_desings\autolathe_designs_construction.dm" +#include "code\modules\research\designs\autolathe_desings\autolathe_designs_electronics.dm" +#include "code\modules\research\designs\autolathe_desings\autolathe_designs_medical_and_dinnerware.dm" +#include "code\modules\research\designs\autolathe_desings\autolathe_designs_sec_and_hacked.dm" +#include "code\modules\research\designs\autolathe_desings\autolathe_designs_tcomms_and_misc.dm" +#include "code\modules\research\designs\autolathe_desings\autolathe_designs_tools.dm" #include "code\modules\research\machinery\_production.dm" #include "code\modules\research\machinery\circuit_imprinter.dm" #include "code\modules\research\machinery\departmental_circuit_imprinter.dm"