update mod file to reflect changes done on config.json

This commit is contained in:
Rev 2021-05-30 15:07:05 +09:00
parent 2f28e5061c
commit a8c28d139d

View File

@ -9,13 +9,13 @@ class ChooseTheWeather {
chooseWeather(data) { chooseWeather(data) {
// Get the config file for the weather // Get the config file for the weather
const { weatherTypes, weather, loop, overrides} = require('./config.json'); const { weatherTypes, weather, random, overrides} = require('./config.json');
// Get the weather sets to choose from // Get the weather sets to choose from
const weatherSets = require('./weatherSet.json'); const weatherSets = require('./weatherSet.json');
// Put the choosen weather from the config in a variable // Put the choosen weather from the config in a variable
let choosenWeather; let choosenWeather;
if (loop) { if (random) {
const randomIndex = Math.floor(Math.random() * weatherTypes.length); const randomIndex = Math.floor(Math.random() * weatherTypes.length);
choosenWeather = weatherSets[weatherTypes[randomIndex]]; choosenWeather = weatherSets[weatherTypes[randomIndex]];
} else { } else {