diff --git a/P3D/World/ActionScript/V2/ScriptCommands/DoEnvironment.vb b/P3D/World/ActionScript/V2/ScriptCommands/DoEnvironment.vb index f968c9097..4b5a45673 100644 --- a/P3D/World/ActionScript/V2/ScriptCommands/DoEnvironment.vb +++ b/P3D/World/ActionScript/V2/ScriptCommands/DoEnvironment.vb @@ -15,6 +15,12 @@ Screen.Level.WeatherType = int(argument) Case "setregionweather" World.RegionWeather = CType(int(argument), World.Weathers) + Case "setseason" + If int(argument) = -1 Then + World.setSeason = Nothing + Else + World.setSeason = CType(int(argument), World.Seasons) + End If Case "setcanfly" Screen.Level.CanFly = CBool(argument) Case "setcandig" diff --git a/P3D/World/ActionScript/V2/ScriptLibrary.vb b/P3D/World/ActionScript/V2/ScriptLibrary.vb index 9b93bb432..bb14308d8 100644 --- a/P3D/World/ActionScript/V2/ScriptLibrary.vb +++ b/P3D/World/ActionScript/V2/ScriptLibrary.vb @@ -393,6 +393,7 @@ Namespace ScriptVersion2 ' Commands: r(New ScriptCommand("environment", "setweather", {New ScriptArgument("weatherType", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Changes the weather type of the current map.")) r(New ScriptCommand("environment", "setregionweather", {New ScriptArgument("weatherID", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Changes the weather of the current region.")) + r(New ScriptCommand("environment", "setseason", {New ScriptArgument("seasonID", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Changes the season. Use -1 as the argument to change back to the default season.")) r(New ScriptCommand("environment", "setcanfly", {New ScriptArgument("canfly", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets the ""CanFly"" parameter of the current map.")) r(New ScriptCommand("environment", "setcandig", {New ScriptArgument("candig", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets the ""CanDig"" parameter of the current map.")) r(New ScriptCommand("environment", "setcanteleport", {New ScriptArgument("canteleport", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Sets the ""CanTeleport"" parameter of the current map.")) diff --git a/P3D/World/World.vb b/P3D/World/World.vb index a53cc8e06..015590e3b 100644 --- a/P3D/World/World.vb +++ b/P3D/World/World.vb @@ -4,6 +4,7 @@ Public Class World Private Shared _regionWeather As Weathers = Weathers.Clear Private Shared _regionWeatherSet As Boolean = False + Public Shared setSeason As Seasons = Nothing Public Shared IsMainMenu As Boolean = False Public Shared IsAurora As Boolean = False @@ -56,19 +57,23 @@ Public Class World Return Seasons.Summer End If - If NeedServerObject() = True Then - Return ServerSeason + If setSeason <> Nothing Then + Return setSeason + Else + If NeedServerObject() = True Then + Return ServerSeason + End If + Select Case WeekOfYear Mod 4 + Case 1 + Return Seasons.Winter + Case 2 + Return Seasons.Spring + Case 3 + Return Seasons.Summer + Case 0 + Return Seasons.Fall + End Select End If - Select Case WeekOfYear Mod 4 - Case 1 - Return Seasons.Winter - Case 2 - Return Seasons.Spring - Case 3 - Return Seasons.Summer - Case 0 - Return Seasons.Fall - End Select Return Seasons.Summer End Get End Property