Skip to content

Commit

Permalink
Fix CGame CG_WaterLevel() comparisons
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zturtleman committed Jul 4, 2015
1 parent 08ac364 commit 386a00f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/cgame/cg_event.c
Expand Up @@ -494,7 +494,7 @@ void CG_PainEvent( centity_t *cent, int health ) {
snd = "*pain100_1.wav";
}
// play a gurp sound instead of a normal pain sound
if (CG_WaterLevel(cent) >= 1) {
if (CG_WaterLevel(cent) == 3) {
if (rand()&1) {
trap_S_StartSound(NULL, cent->currentState.number, CHAN_VOICE, CG_CustomSound(cent->currentState.number, "sound/player/gurp1.wav"));
} else {
Expand Down Expand Up @@ -1169,7 +1169,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
case EV_DEATH3:
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"));
} else {
trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, va("*death%i.wav", event - EV_DEATH1 + 1)));
Expand Down

0 comments on commit 386a00f

Please sign in to comment.