From 2d26c7e2bd9750be3b2bcbe9dac13eca65b5a87d Mon Sep 17 00:00:00 2001 From: carnie Date: Sat, 10 Jan 2015 03:28:56 +0000 Subject: [PATCH] Resolves #6927 - Many Stat() procs did not have if(statpanel("panelname")) checks. --- code/game/gamemodes/blob/overmind.dm | 5 +---- code/modules/mob/dead/observer/observer.dm | 3 +-- code/modules/mob/living/carbon/alien/alien.dm | 9 +++------ code/modules/mob/living/carbon/alien/larva/larva.dm | 3 ++- code/modules/mob/living/carbon/human/human.dm | 4 ++-- code/modules/mob/living/carbon/monkey/monkey.dm | 9 ++++----- code/modules/mob/living/carbon/slime/slime.dm | 11 +++++------ code/modules/mob/living/silicon/ai/ai.dm | 3 +-- code/modules/mob/living/silicon/pai/pai.dm | 3 +-- code/modules/mob/living/silicon/robot/robot.dm | 3 +-- code/modules/mob/living/simple_animal/parrot.dm | 5 +++-- .../modules/mob/living/simple_animal/simple_animal.dm | 4 ++-- 12 files changed, 26 insertions(+), 36 deletions(-) diff --git a/code/game/gamemodes/blob/overmind.dm b/code/game/gamemodes/blob/overmind.dm index 0823430f4c0..7c28dc254e7 100644 --- a/code/game/gamemodes/blob/overmind.dm +++ b/code/game/gamemodes/blob/overmind.dm @@ -83,14 +83,11 @@ return /mob/camera/blob/Stat() - - statpanel("Status") ..() - if (client.statpanel == "Status") + if(statpanel("Status")) if(blob_core) stat(null, "Core Health: [blob_core.health]") stat(null, "Power Stored: [blob_points]/[max_blob_points]") - return /mob/camera/blob/Move(var/NewLoc, var/Dir = 0) var/obj/effect/blob/B = locate() in range("3x3", NewLoc) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index eea5a10bb80..c8e2e45e854 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -115,8 +115,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/Stat() ..() - statpanel("Status") - if (client.statpanel == "Status") + if(statpanel("Status")) stat(null, "Station Time: [worldtime2text()]") if(ticker) if(ticker.mode) diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index f9dbb63b948..6ad87f9871a 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -150,14 +150,11 @@ return 1 // Aliens can eat, and they can be fed food/drink /mob/living/carbon/alien/Stat() - - statpanel("Status") - stat(null, "Intent: [a_intent]") - stat(null, "Move Mode: [m_intent]") - ..() - if (client.statpanel == "Status") + if(statpanel("Status")) + stat(null, "Intent: [a_intent]") + stat(null, "Move Mode: [m_intent]") stat(null, "Plasma Stored: [getPlasma()]/[max_plasma]") /mob/living/carbon/alien/Stun(amount) diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 515edc002a3..bee9cacd6e3 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -26,7 +26,8 @@ //This needs to be fixed /mob/living/carbon/alien/larva/Stat() ..() - stat(null, "Progress: [amount_grown]/[max_grown]") + if(statpanel("Status")) + stat(null, "Progress: [amount_grown]/[max_grown]") /mob/living/carbon/alien/larva/adjustToxLoss(amount) if(stat != DEAD) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index e0496ef45fc..2fe66ff94bd 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -52,8 +52,8 @@ /mob/living/carbon/human/Stat() ..() - statpanel("Status") - if (client.statpanel == "Status") + + if(statpanel("Status")) stat(null, "Intent: [a_intent]") stat(null, "Move Mode: [m_intent]") if(ticker && ticker.mode && ticker.mode.name == "AI malfunction") diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index cdef1652274..00cd806ec0f 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -174,11 +174,10 @@ /mob/living/carbon/monkey/Stat() ..() - statpanel("Status") - stat(null, "Intent: [a_intent]") - stat(null, "Move Mode: [m_intent]") - if(client && mind) - if (client.statpanel == "Status") + if(statpanel("Status")) + stat(null, "Intent: [a_intent]") + stat(null, "Move Mode: [m_intent]") + if(client && mind) if(mind.changeling) stat("Chemical Storage", "[mind.changeling.chem_charges]/[mind.changeling.chem_storage]") stat("Absorbed DNA", mind.changeling.absorbedcount) diff --git a/code/modules/mob/living/carbon/slime/slime.dm b/code/modules/mob/living/carbon/slime/slime.dm index 6228646562a..4e7020c3f3b 100644 --- a/code/modules/mob/living/carbon/slime/slime.dm +++ b/code/modules/mob/living/carbon/slime/slime.dm @@ -130,13 +130,12 @@ /mob/living/carbon/slime/Stat() ..() - statpanel("Status") - if(is_adult) - stat(null, "Health: [round((health / 200) * 100)]%") - else - stat(null, "Health: [round((health / 150) * 100)]%") + if(statpanel("Status")) + if(is_adult) + stat(null, "Health: [round((health / 200) * 100)]%") + else + stat(null, "Health: [round((health / 150) * 100)]%") - if (client.statpanel == "Status") stat(null, "Nutrition: [nutrition]/[get_max_nutrition()]") if(amount_grown >= 10) if(is_adult) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index c939fd1809a..5455ab67e57 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -215,8 +215,7 @@ var/list/ai_list = list() /mob/living/silicon/ai/Stat() ..() - statpanel("Status") - if (client.statpanel == "Status") + if(statpanel("Status")) if(ticker.mode.name == "AI malfunction") var/datum/game_mode/malfunction/malf = ticker.mode for (var/datum/mind/malfai in malf.malf_ai) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 75ebc5f7491..f96b7223b00 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -78,8 +78,7 @@ /mob/living/silicon/pai/Stat() ..() - statpanel("Status") - if (src.client.statpanel == "Status") + if(statpanel("Status")) if(src.silence_time) var/timeleft = round((silence_time - world.timeofday)/10 ,1) stat(null, "Communications system reboot in -[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]") diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index c18183ec808..de11fbb0601 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -294,8 +294,7 @@ /mob/living/silicon/robot/Stat() ..() - statpanel("Status") - if (client.statpanel == "Status") + if(statpanel("Status")) if(ticker.mode.name == "AI malfunction") var/datum/game_mode/malfunction/malf = ticker.mode for (var/datum/mind/malfai in malf.malf_ai) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index cdd78ccaa3b..b886317a3eb 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -122,8 +122,9 @@ /mob/living/simple_animal/parrot/Stat() ..() - stat("Held Item", held_item) - stat("Mode",a_intent) + if(statpanel("Status")) + stat("Held Item", held_item) + stat("Mode",a_intent) /mob/living/simple_animal/parrot/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq) if(speaker != src && prob(20)) //Dont imitate ourselves diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 14b9f3a920e..851768516d1 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -378,8 +378,8 @@ /mob/living/simple_animal/Stat() ..() - statpanel("Status") - stat(null, "Health: [round((health / maxHealth) * 100)]%") + if(statpanel("Status")) + stat(null, "Health: [round((health / maxHealth) * 100)]%") /mob/living/simple_animal/proc/Die() health = 0 // so /mob/living/simple_animal/Life() doesn't magically revive them