X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=sv_phys.c;h=37b1ae5ffaafbb877b2fe352b07855f3aed1cfc3;hb=1f44287dbfadd29e4e6eec914e68455a53ec82e6;hp=f592b08e40f53010a205140b5f0df78b95aaded5;hpb=1375477193afe06d03e0605ffc796db6cb509800;p=xonotic%2Fdarkplaces.git 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; }