From dfa7ec073e2bbb3c83ea45f8a94279b8e7766c55 Mon Sep 17 00:00:00 2001 From: Dip Date: Thu, 27 Aug 2020 17:34:19 -0300 Subject: [PATCH] Smaller code footprint, fix internal blinking status --- code/modules/mob/living/carbon/human/human.dm | 42 +++++++++---------- code/modules/mob/mob.dm | 28 ++++++------- 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 89d4950e..56888031 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -65,28 +65,26 @@ /mob/living/carbon/human/Stat() ..() - - if(statpanel("Status") && tickrefresh2 == 0) - sList2 = list() - sList2 += "Intent: [a_intent]" - sList2 += "Move Mode: [m_intent]" - if (internal) - if (!internal.air_contents) - qdel(internal) - else - sList2 += "Internal Atmosphere Info: "+ "[internal.name]" - sList2 += "Tank Pressure: "+ "[internal.air_contents.return_pressure()]" - sList2 += "Distribution Pressure: "+ "[internal.distribute_pressure]" - if(mind) - var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) - if(changeling) - sList2 += "Chemical Storage: " + "[changeling.chem_charges]/[changeling.chem_storage]" - sList2 += "Absorbed DNA: "+ "[changeling.absorbedcount]" - tickrefresh2++ - stat(null, "[sList2.Join("\n\n")]") - - else if(statpanel("Status") && tickrefresh2 != 0) - if(tickrefresh2 >= tickrefreshThr2) + //Same thing from mob + if(statpanel("Status")) + if(tickrefresh2 == 0) + sList2 = list() + sList2 += "Intent: [a_intent]" + sList2 += "Move Mode: [m_intent]" + if (internal) + if (!internal.air_contents) + qdel(internal) + else + sList2 += "Internal Atmosphere Info: "+ "[internal.name]" + sList2 += "Tank Pressure: "+ "[internal.air_contents.return_pressure()]" + sList2 += "Distribution Pressure: "+ "[internal.distribute_pressure]" + if(mind) + var/datum/antagonist/changeling/changeling = mind.has_antag_datum(/datum/antagonist/changeling) + if(changeling) + sList2 += "Chemical Storage: " + "[changeling.chem_charges]/[changeling.chem_storage]" + sList2 += "Absorbed DNA: "+ "[changeling.absorbedcount]" + tickrefresh2++ + else if(tickrefresh2 >= tickrefreshThr2) tickrefresh2 = 0 else tickrefresh2++ diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index dc20034c..eea92ce5 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -537,21 +537,19 @@ /mob/Stat() ..() //This is where I try and add a temporary solution to the issue of the status tab. This solution is bad and I should feel bad, but it should mitigate some of the client lag. - if(statpanel("Status") && tickrefresh == 0) - sList = list() - if (client) - sList += "Ping: [round(client.lastping, 1)]ms (Average: [round(client.avgping, 1)]ms)" - sList += "Map: [SSmapping.config?.map_name || "Loading..."]" - sList += "Round ID: [GLOB.round_id || "NULL"]" - sList += "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]" - sList += "Round Time: [DisplayTimeText(world.time - SSticker.round_start_time, 1)]" - sList += "Station Time: [STATION_TIME_TIMESTAMP("hh:mm:ss")]" - sList += SSshuttle.emergency_shuttle_stat_text - tickrefresh++ - stat(null, "[sList.Join("\n\n")]") - - else if(statpanel("Status") && tickrefresh != 0) - if(tickrefresh >= tickrefreshThr) + if(statpanel("Status")) + if(tickrefresh == 0) + sList = list() + if (client) + sList += "Ping: [round(client.lastping, 1)]ms (Average: [round(client.avgping, 1)]ms)" + sList += "Map: [SSmapping.config?.map_name || "Loading..."]" + sList += "Round ID: [GLOB.round_id || "NULL"]" + sList += "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]" + sList += "Round Time: [DisplayTimeText(world.time - SSticker.round_start_time, 1)]" + sList += "Station Time: [STATION_TIME_TIMESTAMP("hh:mm:ss")]" + sList += SSshuttle.emergency_shuttle_stat_text + tickrefresh++ + else if(tickrefresh >= tickrefreshThr) tickrefresh = 0 else tickrefresh++