fixed splashing sounds once and for all - now splashes only on transitions involving...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 8 Oct 2003 20:21:37 +0000 (20:21 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 8 Oct 2003 20:21:37 +0000 (20:21 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3552 d7cf8633-e32d-0410-b094-e92efae38249

sv_phys.c

index f592b08..37b1ae5 100644 (file)
--- 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;
        }