Merge pull request #5014 from PolarisSS13/Ater_Weather_report

Weather reports won't crash when planet controller dies
This commit is contained in:
Anewbe
2018-03-05 19:46:25 -06:00
committed by GitHub

View File

@@ -69,16 +69,17 @@
im_list_ui[++im_list_ui.len] = list("address" = I["address"], "to_address" = I["to_address"], "im" = I["im"]) im_list_ui[++im_list_ui.len] = list("address" = I["address"], "to_address" = I["to_address"], "im" = I["im"])
//Weather reports. //Weather reports.
for(var/datum/planet/planet in planet_controller.planets) if(planet_controller)
if(planet.weather_holder && planet.weather_holder.current_weather) for(var/datum/planet/planet in planet_controller.planets)
var/list/W = list( if(planet.weather_holder && planet.weather_holder.current_weather)
"Planet" = planet.name, var/list/W = list(
"Time" = planet.current_time.show_time("hh:mm"), "Planet" = planet.name,
"Weather" = planet.weather_holder.current_weather.name, "Time" = planet.current_time.show_time("hh:mm"),
"Temperature" = planet.weather_holder.temperature - T0C, "Weather" = planet.weather_holder.current_weather.name,
"High" = planet.weather_holder.current_weather.temp_high - T0C, "Temperature" = planet.weather_holder.temperature - T0C,
"Low" = planet.weather_holder.current_weather.temp_low - T0C) "High" = planet.weather_holder.current_weather.temp_high - T0C,
weather[++weather.len] = W "Low" = planet.weather_holder.current_weather.temp_low - T0C)
weather[++weather.len] = W
injection = "<div>Test</div>" injection = "<div>Test</div>"
@@ -251,4 +252,4 @@
set_light(fon * flum) set_light(fon * flum)
nanomanager.update_uis(src) nanomanager.update_uis(src)
add_fingerprint(usr) add_fingerprint(usr)