Skip to content

Commit

Permalink
[MIRROR] Cache heretic delusion icon so it doesn't call getFlatIcon
Browse files Browse the repository at this point in the history
… li ke 600 times a life tick or something (#366)

* Cache heretic delusion icon so it doesn't call `getFlatIcon` li ke 600 times a life tick or something (#80842)

Heretic's weeping painting causes everyone who sees it to hallucinate
everyone else as heretics. So it caused this hallucination every 5 life
ticks.

Which means every 5 life ticks it would call GFI for every mob in view.
And like everyone on the station would get this effect.

So everyone on the station is now hallucinating every mob in view is a
heretic and it's calling GFI every time.

So yeah we should probably cache this.

* Cache heretic delusion icon so it doesn't call `getFlatIcon` li ke 600 times a life tick or something

---------

Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: NovaBot <[email protected]>
  • Loading branch information
3 people authored and FFMirrorBot committed Jan 8, 2024
1 parent 39b20ab commit e5f19b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/modules/hallucination/delusions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,13 @@
duration = 11 SECONDS

/datum/hallucination/delusion/preset/heretic/make_delusion_image(mob/over_who)
delusion_icon_file = getFlatIcon(get_dynamic_human_appearance(/datum/outfit/heretic_hallucination, r_hand = NO_REPLACE))
var/static/icon/heretic_icon
if(isnull(heretic_icon))
heretic_icon = getFlatIcon(get_dynamic_human_appearance(/datum/outfit/heretic, r_hand = NO_REPLACE))
delusion_icon_file = heretic_icon
return ..()

/datum/hallucination/delusion/preset/heretic/gate
delusion_name = "Mind Gate"
duration = 60 SECONDS
affects_us = TRUE

0 comments on commit e5f19b5

Please sign in to comment.