Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 4e408d2

Browse files
authored
Fixes inconsistencies with liquid spread splashing (#22500)
* tweak * tweaks
1 parent 72aac57 commit 4e408d2

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

code/__DEFINES/{yogs_defines}/liquids.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
#define LIQUID_STATE_FOR_HEAT_EXCHANGERS LIQUID_STATE_WAIST
4747

48-
#define LIQUID_ANKLES_LEVEL_HEIGHT 8
48+
#define LIQUID_ANKLES_LEVEL_HEIGHT 9 //this is the start of being negatively affected by liquid depth (technically probably closer to low calf height)
4949
#define LIQUID_WAIST_LEVEL_HEIGHT 19
5050
#define LIQUID_SHOULDERS_LEVEL_HEIGHT 29
5151
#define LIQUID_FULLTILE_LEVEL_HEIGHT 39

yogstation/code/modules/liquids/liquid_groups.dm

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -952,11 +952,12 @@ GLOBAL_VAR_INIT(liquid_debug_colors, FALSE)
952952
new_turf.liquids.alpha = group_alpha
953953
check_edges(new_turf)
954954

955-
var/obj/splashy = new /obj/effect/temp_visual/liquid_splash(new_turf)
956-
if(!QDELETED(new_turf.liquids?.liquid_group))
957-
splashy.color = new_turf.liquids.liquid_group.group_color
955+
if(expected_turf_height >= LIQUID_ANKLES_LEVEL_HEIGHT) //liquid is deep enough, do a splash
956+
var/obj/splashy = new /obj/effect/temp_visual/liquid_splash(new_turf)
957+
if(!QDELETED(new_turf.liquids?.liquid_group))
958+
splashy.color = new_turf.liquids.liquid_group.group_color
958959

959-
water_rush(new_turf, source_turf)
960+
water_rush(new_turf, source_turf)
960961

961962
else if(!QDELETED(source_turf?.liquids?.liquid_group) && !QDELETED(new_turf?.liquids?.liquid_group) && new_turf.liquids.liquid_group != source_turf.liquids.liquid_group && source_turf.turf_height == new_turf.turf_height && new_turf.liquids.liquid_group.can_merge)
962963
merge_group(new_turf.liquids.liquid_group)
@@ -984,18 +985,20 @@ GLOBAL_VAR_INIT(liquid_debug_colors, FALSE)
984985
var/direction = get_dir(source_turf, new_turf)
985986
for(var/atom/movable/target_atom in new_turf)
986987
reagents.reaction(target_atom, TOUCH, (reagents_per_turf * 0.5))
987-
if(!target_atom.anchored && !target_atom.pulledby && (target_atom.move_resist < INFINITY))
988-
if(expected_turf_height < LIQUID_ANKLES_LEVEL_HEIGHT)
989-
return
990-
if(isliving(target_atom))
991-
var/mob/living/target_living = target_atom
992-
if(!target_living.mob_has_heavy_gravity()) //push everything EXCEPT living things that have heavy gravity
993-
step(target_living, direction)
994-
if(prob(60))
995-
if(target_living.slip(6 SECONDS, null, FALSE, 6 SECONDS, TRUE))
996-
to_chat(target_living, span_danger("You are knocked down by the currents!"))
997-
else
998-
step(target_atom, direction)
988+
if(target_atom.anchored || target_atom.pulledby || (target_atom.move_resist >= INFINITY)) //thing is too heavy or secured to move
989+
continue
990+
991+
if(isliving(target_atom))
992+
var/mob/living/target_living = target_atom
993+
if(target_living.mob_has_heavy_gravity()) //if the mob is heavy, don't push them
994+
continue
995+
step(target_living, direction)
996+
if(prob(60))
997+
if(target_living.slip(6 SECONDS, null, FALSE, 6 SECONDS, TRUE))
998+
to_chat(target_living, span_danger("You are knocked down by the currents!"))
999+
1000+
else //push all objects
1001+
step(target_atom, direction)
9991002

10001003
/datum/liquid_group/proc/fetch_temperature_queue()
10011004
if(!cached_temperature_shift)
-1.35 KB
Binary file not shown.

0 commit comments

Comments
 (0)