Smaller code footprint, fix internal blinking status

This commit is contained in:
Dip
2020-08-27 17:34:19 -03:00
parent e66785af28
commit dfa7ec073e
2 changed files with 33 additions and 37 deletions

View File

@@ -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++

View File

@@ -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++