Skip to content

Commit 11c70ae

Browse files
Add backwards compatibility with servers that use Snow as the weather
1 parent e6ced86 commit 11c70ae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/poke_env/environment/weather.py

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ def from_showdown_message(message: str):
3737
try:
3838
return Weather[message.upper()]
3939
except KeyError:
40+
if message.upper() == "SNOW":
41+
# Backwards compatibility with out-of-date PS servers that still use "snow" as the weather
42+
return Weather.SNOWSCAPE
43+
4044
logging.getLogger("poke-env").warning(
4145
"Unexpected weather '%s' received. Weather.UNKNOWN will be used "
4246
"instead. If this is unexpected, please open an issue at "

0 commit comments

Comments
 (0)