Skip to content

Commit

Permalink
Adds turf checks for mercury & lithium random step logic. (#80586) (#125
Browse files Browse the repository at this point in the history
)

Adds turf checks for mercury & lithium random step logic. (#80586)

## About The Pull Request
- Fixes #74092

We not only want to make sure it's a turf but also a ground turf (i.e.
something you can stand on and not turfs like lava, water, space etc) so
you know you can use your legs to move on that ground.

## Changelog
:cl:
fix: mercury & lithium will no longer make you randomly move outside of
cryotubes or in ground less turfs (space, water, lava etc)
/:cl:

Co-authored-by: SyncIt21 <[email protected]>
  • Loading branch information
2 people authored and Iajret committed Dec 28, 2023
1 parent 540ebb9 commit 7c9d3e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/modules/reagents/chemistry/reagents/other_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@

/datum/reagent/mercury/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(!HAS_TRAIT(src, TRAIT_IMMOBILIZED) && !isspaceturf(affected_mob.loc))
if(!HAS_TRAIT(src, TRAIT_IMMOBILIZED) && isturf(affected_mob.loc) && !isgroundlessturf(affected_mob.loc))
step(affected_mob, pick(GLOB.cardinals))
if(SPT_PROB(3.5, seconds_per_tick))
affected_mob.emote(pick("twitch","drool","moan"))
Expand Down Expand Up @@ -1140,7 +1140,7 @@

/datum/reagent/lithium/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired)
. = ..()
if(!HAS_TRAIT(affected_mob, TRAIT_IMMOBILIZED) && !isspaceturf(affected_mob.loc) && isturf(affected_mob.loc))
if(!HAS_TRAIT(affected_mob, TRAIT_IMMOBILIZED) && isturf(affected_mob.loc) && !isgroundlessturf(affected_mob.loc))
step(affected_mob, pick(GLOB.cardinals))
if(SPT_PROB(2.5, seconds_per_tick))
affected_mob.emote(pick("twitch","drool","moan"))
Expand Down

0 comments on commit 7c9d3e7

Please sign in to comment.