Tweaking footsteps sound sensitivity a little.

This commit is contained in:
Marco Cawthorne 2019-09-01 08:00:01 +02:00
parent 15181308f8
commit 106604661b

View file

@ -28,11 +28,7 @@ void Footsteps_Update(void) {
float fVol; float fVol;
string sMaterial = ""; string sMaterial = "";
string sTexture = ""; string sTexture = "";
if (self.flags & FL_CROUCHING) {
return;
}
if (!g_hlbsp_materials) { if (!g_hlbsp_materials) {
return; return;
} }
@ -46,17 +42,16 @@ void Footsteps_Update(void) {
traceline(self.origin + self.view_ofs, self.origin + '0 0 -48', FALSE, self); traceline(self.origin + self.view_ofs, self.origin + '0 0 -48', FALSE, self);
sTexture = getsurfacetexture(trace_ent, getsurfacenearpoint(trace_ent, trace_endpos)); sTexture = getsurfacetexture(trace_ent, getsurfacenearpoint(trace_ent, trace_endpos));
if (fSpeed < 140) { if (fSpeed < 150) {
self.fStepTime = time + 0.35; return;
fVol = 0.15f;
} else if (fSpeed < 270) { } else if (fSpeed < 270) {
self.fStepTime = time + 0.35;
fVol = 0.35f; fVol = 0.35f;
} else { } else {
self.fStepTime = time + 0.35;
fVol = 0.75; fVol = 0.75;
} }
self.fStepTime = time + 0.35;
switch((float)hash_get(hashMaterials, sTexture)) { switch((float)hash_get(hashMaterials, sTexture)) {
case 'M': case 'M':
sMaterial = "metal"; sMaterial = "metal";
@ -91,7 +86,7 @@ void Footsteps_Update(void) {
default: default:
sMaterial = "step"; sMaterial = "step";
break; break;
} }
if (self.iStep) { if (self.iStep) {
if (random() < 0.5f) { if (random() < 0.5f) {