From aa0ede4f3eefb270940c3d941c6ec87a01c980df Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 8 Oct 2003 20:21:37 +0000 Subject: [PATCH] fixed splashing sounds once and for all - now splashes only on transitions involving water/slime, rather than the old 'any liquid except lava' check, so this means no more sky splashing... git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3552 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_phys.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sv_phys.c b/sv_phys.c index f592b08e..37b1ae5f 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -1131,21 +1131,17 @@ void SV_CheckWaterTransition (edict_t *ent) return; } + // check if the entity crossed into or out of water + if ((ent->v->watertype == CONTENTS_WATER || ent->v->watertype == CONTENTS_SLIME) != (cont == CONTENTS_WATER || cont == CONTENTS_SLIME)) + SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1); + if (cont <= CONTENTS_WATER) { - if (ent->v->watertype == CONTENTS_EMPTY && cont != CONTENTS_LAVA) - // just crossed into water - SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1); - ent->v->watertype = cont; ent->v->waterlevel = 1; } else { - if (ent->v->watertype != CONTENTS_EMPTY && ent->v->watertype != CONTENTS_LAVA) - // just crossed into water - SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1); - ent->v->watertype = CONTENTS_EMPTY; ent->v->waterlevel = 0; } -- 2.39.2