Chance of snow by month
This commit is contained in:
@@ -246,6 +246,7 @@ let globalConfig = {
|
|||||||
fishingCastMaxStrength: 100,
|
fishingCastMaxStrength: 100,
|
||||||
fishingCastMinStrength: 30,
|
fishingCastMinStrength: 30,
|
||||||
jobRouteLocationSphereRadius: 3,
|
jobRouteLocationSphereRadius: 3,
|
||||||
|
monthlyChanceOfSnow: [90, 50, 10, 0, 0, 0, 0, 0, 0, 0, 50, 90],
|
||||||
};
|
};
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -133,8 +133,13 @@ function thirtyMinuteTimerFunction() {
|
|||||||
if (getClients().length > 0) {
|
if (getClients().length > 0) {
|
||||||
checkPayDays();
|
checkPayDays();
|
||||||
}
|
}
|
||||||
saveServerDataToDatabase();
|
|
||||||
|
if (isGameFeatureSupported("snow")) {
|
||||||
|
checkSnowChance();
|
||||||
|
}
|
||||||
|
|
||||||
checkInactiveVehicleRespawns();
|
checkInactiveVehicleRespawns();
|
||||||
|
saveServerDataToDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -262,7 +267,7 @@ function checkServerGameTime() {
|
|||||||
game.time.minute = getServerConfig().minute;
|
game.time.minute = getServerConfig().minute;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTimeRule();
|
updateServerRules();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -335,4 +340,15 @@ function checkInactiveVehicleRespawns() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function checkSnowChance() {
|
||||||
|
let date = new Date();
|
||||||
|
|
||||||
|
let shouldBeSnowing = getRandomBoolWithProbability(getGlobalConfig().monthlyChanceOfSnow[date.getMonths()]);
|
||||||
|
getServerConfig().groundSnow = shouldBeSnowing;
|
||||||
|
getServerConfig().fallingSnow = shouldBeSnowing;
|
||||||
|
updatePlayerSnowState(null);
|
||||||
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user