Fix CGame CG_WaterLevel() comparisons

My last commit made it so that CGame "waterlevel 1" is feet in water,
but before it was erroneously about waist deep in water. The places
where it is checked it is suppose to be view position underwater.

Change comparisons to use correct value for view position underwater.
This commit is contained in:
Zack Middleton 2015-07-04 05:40:28 -05:00
parent 08ac364cd6
commit 386a00fc2b

View file

@ -494,7 +494,7 @@ void CG_PainEvent( centity_t *cent, int health ) {
snd = "*pain100_1.wav"; snd = "*pain100_1.wav";
} }
// play a gurp sound instead of a normal pain sound // play a gurp sound instead of a normal pain sound
if (CG_WaterLevel(cent) >= 1) { if (CG_WaterLevel(cent) == 3) {
if (rand()&1) { if (rand()&1) {
trap_S_StartSound(NULL, cent->currentState.number, CHAN_VOICE, CG_CustomSound(cent->currentState.number, "sound/player/gurp1.wav")); trap_S_StartSound(NULL, cent->currentState.number, CHAN_VOICE, CG_CustomSound(cent->currentState.number, "sound/player/gurp1.wav"));
} else { } else {
@ -1169,7 +1169,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_DEATH3: case EV_DEATH3:
DEBUGNAME("EV_DEATHx"); DEBUGNAME("EV_DEATHx");
if (CG_WaterLevel(cent) >= 1) { if (CG_WaterLevel(cent) == 3) {
trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, "*drown.wav")); trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, "*drown.wav"));
} else { } else {
trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, va("*death%i.wav", event - EV_DEATH1 + 1))); trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, va("*death%i.wav", event - EV_DEATH1 + 1)));