tyr to fix NPE without actually debigging the thing

This commit is contained in:
Evan Pratten 2020-04-18 20:38:59 -04:00
parent ba0e49bb63
commit d58a7f2580
No known key found for this signature in database
GPG Key ID: 93AC7B3D071356D3

View File

@ -38,7 +38,7 @@ let soundAssets = {
function playRandomFootstep() { function playRandomFootstep() {
// There has to be a one-liner somewhere in the game... // There has to be a one-liner somewhere in the game...
[soundAssets.footstep1, soundAssets.footstep2, soundAssets.footstep3, soundAssets.footstep4, soundAssets.footstep5, soundAssets.footstep6][Math.floor(Math.random() * Object.keys(soundAssets).length - 1)].play(); [soundAssets.footstep1, soundAssets.footstep2, soundAssets.footstep3, soundAssets.footstep4, soundAssets.footstep5, soundAssets.footstep6][Math.min(Math.floor(Math.random() * Object.keys(soundAssets).length - 1), Object.keys(soundAssets).length - 1)].play();
} }
/** /**