Visible message fix (#1271)

Undoes baymerge's changes to visible messages and fixes our previous implementation that i wrote.
Ours is much better all around.

With the changes baymerge made, they added an additional view call, and some 700 show_message calls to objects, for every single message, its absurdly wasteful.

As far as i'm aware there is no current use case for showing visible messages to objects. If there ever is a need we can implement an efficient solution with a global list of listeners
This commit is contained in:
NanakoAC
2016-12-22 16:57:30 +00:00
committed by skull132
parent e221a91049
commit e82d5034d9
2 changed files with 19 additions and 15 deletions

View File

@@ -101,18 +101,22 @@
for (var/turf in view(world.view, get_turf(src)))
messageturfs += turf
for(var/mob/M in player_list)
for(var/A in player_list)
var/mob/M = A
if (!M.client || istype(M, /mob/new_player))
continue
if(get_turf(M) in messageturfs)
messagemobs += M
for(var/mob/M in messagemobs)
for(var/A in messagemobs)
var/mob/M = A
if(self_message && M==src)
M.show_message(self_message, 1, blind_message, 2)
else if(M.see_invisible < invisibility) // Cannot view the invisible, but you can hear it.
if(blind_message)
M.show_message(blind_message, 2)
else
M.show_message(message, 1, blind_message, 2)
// Designed for mobs contained inside things, where a normal visible message wont actually be visible
// Useful for visible actions by pAIs, and held mobs