Pārlūkot izejas kodu

suggested revisions

Azaezel 9 gadi atpakaļ
vecāks
revīzija
c60be9a17e
2 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 2 2
      Engine/source/T3D/player.cpp
  2. 1 0
      Engine/source/T3D/player.h

+ 2 - 2
Engine/source/T3D/player.cpp

@@ -6873,7 +6873,7 @@ void Player::playFootstepSound( bool triggeredLeft, Material* contactMaterial, S
       // Play default sound.
 
       S32 sound = -1;
-      if( contactMaterial && contactMaterial->mFootstepSoundId != -1 )
+      if (contactMaterial && (contactMaterial->mImpactSoundId>-1 && contactMaterial->mImpactSoundId<PlayerData::MaxSoundOffsets))
          sound = contactMaterial->mFootstepSoundId;
       else if( contactObject && contactObject->getTypeMask() & VehicleObjectType )
          sound = 2;
@@ -6904,7 +6904,7 @@ void Player:: playImpactSound()
          else
          {
             S32 sound = -1;
-            if( material && (material->mImpactSoundId>=0) )
+            if (material && (material->mImpactSoundId>-1 && material->mImpactSoundId<PlayerData::MaxSoundOffsets))
                sound = material->mImpactSoundId;
             else if( rInfo.object->getTypeMask() & VehicleObjectType )
                sound = 2; // Play metal;

+ 1 - 0
Engine/source/T3D/player.h

@@ -190,6 +190,7 @@ struct PlayerData: public ShapeBaseData {
       FootHard,
       FootMetal,
       FootSnow,
+      MaxSoundOffsets,
       FootShallowSplash,
       FootWading,
       FootUnderWater,