elevator.on "passing_floor" gives floorNum = -1
threldor opened this issue · comments
threldor commented
I have found that the passing_floor event sometimes has floorNum = -1
Often (every 200s or so) on the challenge 18 when the elevator comes from a high floor to ground floor it seems that the passing_floor is triggered twice
using the code snippet similar to below the log shows
LOG
prevfloor:1 floorNum:0 dir:down
prevfloor:0 floorNum:-1 dir:down
elevator.on("passing_floor", function(floorNum, direction) {
console.log('prevfloor:' + prevFloor + ' floorNum:' + floorNum + ' dir:' + direction);
prevFloor = floorNum;
});
Magnus Wolffelt commented
Pretty sure this is related to, or same bug as #61