Skip to content

Commit

Permalink
fix runtime error and odd output when in
Browse files Browse the repository at this point in the history
a location that does not have weather
  • Loading branch information
GenericDM committed Nov 23, 2023
1 parent 49eb4cc commit e0f33e3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions code/datums/components/weatherannouncer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@

/datum/component/weather_announcer/proc/time_till_storm()
var/datum/weather_controller/local_weather_controller = SSmapping.get_map_zone_weather_controller(parent)

for(var/datum/weather/check_weather as anything in local_weather_controller.current_weathers)
if(!local_weather_controller.next_weather)
return null
for(var/type_index in local_weather_controller.current_weathers)
var/datum/weather/check_weather = local_weather_controller.current_weathers[type_index]
if(!check_weather.barometer_predictable || check_weather.stage == WIND_DOWN_STAGE || check_weather.stage == END_STAGE)
continue
warning_level = WEATHER_ALERT_IMMINENT_OR_ACTIVE
Expand Down Expand Up @@ -140,7 +142,8 @@
warning_level = WEATHER_ALERT_IMMINENT_OR_ACTIVE

var/datum/weather_controller/local_weather_controller = SSmapping.get_map_zone_weather_controller(parent)
for(var/datum/weather/check_weather as anything in local_weather_controller.current_weathers)
for(var/type_index in local_weather_controller.current_weathers)
var/datum/weather/check_weather = local_weather_controller.current_weathers[type_index]
if(!check_weather.barometer_predictable || check_weather.stage == WIND_DOWN_STAGE || check_weather.stage == END_STAGE)
continue
is_weather_dangerous = !check_weather.aesthetic
Expand Down

0 comments on commit e0f33e3

Please sign in to comment.