Stop zombie drowning conversion when it leaves the water

This commit is contained in:
Kacpherek
2026-10-26 18:49:12 +01:00
parent d6a7f7f32c
commit f2424043f3
+6 -1
View File
@@ -486,7 +486,12 @@ pub fn custom_server_ai_step(m: &mut Mob, cx: &mut Cx) {
return zombified_piglin_step(m, cx);
}
if matches!(m.species(), Species::Zombie | Species::Husk) && m.alive() {
if m.extra.counter2 > 0 {
if m.extra.counter2 > 0 && !m.fluids.eye_in_water {
// ConversionTracker.tick: leaving the water ends a started
// conversion too.
m.extra.counter = -1;
m.extra.counter2 = 0;
} else if m.extra.counter2 > 0 {
m.extra.counter2 -= 1;
if m.extra.counter2 == 0 {
let (kind, sound) = if m.species() == Species::Husk {