From a61490fdd4ae634966d33bdc8734cd4b1f188d62 Mon Sep 17 00:00:00 2001 From: Testmerge Worker Date: Mon, 9 Dec 2024 18:20:00 +0000 Subject: [PATCH] Experimental perfomance fix for messages (#6239) [testmerge][da9559e] --- code/modules/mob/mob.dm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index d1020156e82..08f16f5344b 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -142,7 +142,7 @@ // blind_message (optional) is what blind people will hear e.g. "You hear something!" /mob/visible_message(message, self_message, blind_message, list/ignored_mobs, chat_message_type) if(!isturf(loc)) // mobs inside objects (such as lockers) shouldn't have their actions visible to those outside the object - for(var/mob/mob as anything in (get_mobs_in_view(3, src, include_radio = FALSE) - ignored_mobs)) + for(var/mob/mob as anything in viewers(3, src) - ignored_mobs) if(mob.see_invisible < invisibility) continue //can't view the invisible var/msg = message @@ -155,7 +155,7 @@ mob.show_message(msg, EMOTE_VISIBLE, blind_message, EMOTE_AUDIBLE, chat_message_type) return - for(var/mob/mob as anything in (get_mobs_in_view(7, src, include_radio = FALSE) - ignored_mobs)) + for(var/mob/mob as anything in viewers(7, src) - ignored_mobs) if(mob.see_invisible < invisibility) continue //can't view the invisible var/msg = message @@ -169,7 +169,7 @@ // message is output to anyone who can see, e.g. "The [src] does something!" // blind_message (optional) is what blind people will hear e.g. "You hear something!" /atom/proc/visible_message(message, self_message, blind_message, list/ignored_mobs) - for(var/mob/mob as anything in (get_mobs_in_view(7, src, include_radio = FALSE) - ignored_mobs)) + for(var/mob/mob as anything in viewers(7, src) - ignored_mobs) mob.show_message(message, EMOTE_VISIBLE, blind_message, EMOTE_AUDIBLE) @@ -184,7 +184,7 @@ if(hearing_distance) range = hearing_distance var/msg = message - for(var/mob/M in get_mobs_in_view(range, src)) + for(var/mob/M as anything in viewers(range, src)) M.show_message(msg, EMOTE_AUDIBLE, deaf_message, EMOTE_VISIBLE) // based on say code @@ -211,7 +211,7 @@ var/range = 7 if(hearing_distance) range = hearing_distance - for(var/mob/M in get_mobs_in_view(range, src)) + for(var/mob/M as anything in viewers(range, src)) M.show_message(message, EMOTE_AUDIBLE, deaf_message, EMOTE_VISIBLE) @@ -638,7 +638,7 @@ return FALSE /mob/proc/can_use_machinery(obj/machinery/mach) - return IsAdvancedToolUser() + return IsAdvancedToolUser() /mob/proc/swap_hand() return @@ -673,7 +673,7 @@ var/mob/living/picked = tgui_input_list(usr, "Please select an NPC to respawn as", "Respawn as NPC", allowed_creatures) if(!picked) return - + if(picked == "Mouse") become_mouse() return @@ -684,7 +684,7 @@ if(QDELETED(picked_mob) || picked_mob.key || picked_mob.stat == DEAD) to_chat(usr, span_warning("[capitalize(picked_mob)] is no longer available to respawn!")) return - + if(istype(picked_mob, /mob/living/simple_animal/borer)) var/mob/living/simple_animal/borer/borer = picked_mob borer.transfer_personality(usr.client) @@ -693,7 +693,7 @@ to_chat(usr, span_notify(message)) GLOB.respawnable_list -= usr picked_mob.key = key - + /mob/proc/become_mouse() var/timedifference = world.time - client.time_joined_as_mouse