Fix hot spring runtime related to duplicate elements (#90555)

If something is mapped to spawn in on a hot spring tile, the tile will
add the immerse element in `/turf/open/water/Entered` before
`Initialize` runs, and when it does there's no check if the element has
already been added, unlike other spots where the immerse element is
added. This fixes that by adding a check on the call in `Initialize`.
This commit is contained in:
Roxy
2025-04-13 00:59:23 -04:00
committed by nevimer
parent 3472fddc11
commit 945479a622

View File

@@ -118,8 +118,9 @@
// we don't want to end up with 4 different immerse elements, which would cause
// the immerse trait to be repeatedly removed and readded as someone moves within the pool,
// replacing the status effect over and over, which can be seen through the status effect alert icon.
AddElement(/datum/element/immerse, icon, icon_state, "immerse", immerse_overlay_color, alpha = immerse_overlay_alpha)
immerse_added = TRUE
if(!immerse_added)
AddElement(/datum/element/immerse, icon, icon_state, "immerse", immerse_overlay_color, alpha = immerse_overlay_alpha)
immerse_added = TRUE
icon_state = "pool_[rand(1, 4)]"
particle_effect = new(src, /particles/hotspring_steam, 4)
//render the steam over mobs and objects on the game plane