Skip to content

Commit

Permalink
Fix GCC enum/int comparison warning
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Jun 19, 2013
1 parent 2cae330 commit 6428310
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/cdogs/weapon.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,15 @@ void PulseRifle(TActor * actor)
}
*/

void WeaponPlaySound(Weapon *w, Vector2i tilePosition)
{
if (w->soundLock <= 0 && (int)cGunSounds[w->gun] != -1)
{
SoundPlayAt(cGunSounds[w->gun], tilePosition.x, tilePosition.y);
w->soundLock = cGunSoundLocks[w->gun];
}
}

void WeaponFire(
Weapon *w, direction_e d, Vector2i muzzlePosition, Vector2i tilePosition, int flags)
{
Expand Down Expand Up @@ -439,11 +448,7 @@ void WeaponFire(
}

w->lock = cGunLocks[w->gun];
if (w->soundLock <= 0 && cGunSounds[w->gun] != -1)
{
SoundPlayAt(cGunSounds[w->gun], tilePosition.x, tilePosition.y);
w->soundLock = cGunSoundLocks[w->gun];
}
WeaponPlaySound(w, tilePosition);
}

int GunIsStatic(gun_e gun)
Expand Down

0 comments on commit 6428310

Please sign in to comment.