Let scripts access Java classes

Fix script attempting to schedule with non-long (double) time value
This commit is contained in:
P0nk
2021-04-17 22:25:07 +02:00
parent fcd879f97c
commit 58e69654a2
2 changed files with 13 additions and 5 deletions

View File

@@ -60,7 +60,9 @@ function takeoff() {
em.setProperty("docked","false");
if(Math.random() < 0.42) em.schedule("approach", (invasionStartTime + (Math.random() * invasionDelayTime)));
if (Math.random() < 0.42) {
em.schedule("approach", (invasionStartTime + Math.trunc((Math.random() * invasionDelayTime))));
}
em.schedule("arrived", rideTime);
}