mirror of
https://github.com/mehotkhan/BandersnatchInteractive.git
synced 2025-07-27 17:23:22 +00:00
assets/scripts.js: Tweak precondition debug log
This commit is contained in:
parent
3fbed6886b
commit
4260f0ccf4
1 changed files with 4 additions and 3 deletions
|
@ -43,7 +43,7 @@ function evalPrecondition(precondition, text) {
|
|||
if (precondition) {
|
||||
let cond = preconditionToJS(precondition);
|
||||
let match = eval(cond);
|
||||
console.log(text, ':', cond, '==', match);
|
||||
console.log('precondition', text, ':', cond, '==', match);
|
||||
return match;
|
||||
}
|
||||
|
||||
|
@ -99,8 +99,9 @@ function getMoments(segmentId, ms) {
|
|||
let moments = momentsBySegment[segmentId] || [];
|
||||
for (let i = 0; i < moments.length; i++) {
|
||||
let m = moments[i];
|
||||
if (ms >= m.startMs && ms < m.endMs && evalPrecondition(m.precondition)) {
|
||||
result[segmentId + '/' + i] = m;
|
||||
let momentId = segmentId + '/' + i;
|
||||
if (ms >= m.startMs && ms < m.endMs && evalPrecondition(m.precondition, 'moment ' + momentId)) {
|
||||
result[momentId] = m;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue