tyr to fix NPE without actually debigging the thing
This commit is contained in:
parent
ba0e49bb63
commit
d58a7f2580
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user