From 3525bcfcbbafeb5ff249586a462b4b78cff737ac Mon Sep 17 00:00:00 2001 From: duncathan Date: Wed, 30 Mar 2016 16:07:35 -0600 Subject: [PATCH] fixes huge roundstart bugs --- code/controllers/subsystem/air.dm | 8 ++++++-- code/game/turfs/space/space.dm | 14 ++++++++------ code/game/turfs/turf.dm | 3 --- .../atmospherics/gasmixtures/gas_mixture.dm | 11 +++++++---- code/modules/lighting/lighting_system.dm | 5 ++--- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index 5e012f85e0a..04fcce75dcf 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -181,13 +181,17 @@ var/datum/subsystem/air/SSair var/list/turfs_to_init = block(locate(1, 1, z_start), locate(world.maxx, world.maxy, z_finish)) - for(var/turf/t in turfs_to_init) + for(var/thing in turfs_to_init) + var/turf/t = thing t.CalculateAdjacentTurfs() active_turfs -= t if(t.blocks_air) continue + if(istype(t, /turf/open/space)) + continue //don't need to initialize these; just slows down roundstart without any real benefit + var/turf/open/T = t T.excited = 0 @@ -200,7 +204,7 @@ var/datum/subsystem/air/SSair var/is_active = T.air.compare(enemy_air) if(is_active) - testing("Active turf found. Return value of compare(): [is_active]") + //testing("Active turf found. Return value of compare(): [is_active]") T.excited = 1 active_turfs |= T break diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 0b257b69cd7..c9d30731192 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -21,12 +21,14 @@ return QDEL_HINT_LETMELIVE /turf/open/space/proc/update_starlight() - if(config) - if(config.starlight) - for(var/turf/T in RANGE_TURFS(1,src)) //RANGE_TURFS is in code\__HELPERS\game.dm - SetLuminosity(4,1) - return - SetLuminosity(0) + if(config.starlight) + for(var/t in RANGE_TURFS(1,src)) //RANGE_TURFS is in code\__HELPERS\game.dm + if(istype(t, /turf/open/space)) + //let's NOT update this that much pls + continue + SetLuminosity(4,1) + return + SetLuminosity(0) /turf/open/space/attack_paw(mob/user) return src.attack_hand(user) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 6b6d3299dcc..105ea9bd124 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -132,9 +132,6 @@ SSair.remove_from_active(src) var/turf/W = new path(src) - if(istype(W, /turf)) - W:Assimilate_Air() - W.RemoveLattice() W.AfterChange() return W diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index c746865487e..e0fc63d2828 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -402,9 +402,9 @@ var/list/gaslist_cache = null var/global/regex/R_gas_id var/global/regex/R_gas_value if(!R_gas_id) - R_gas_id = regex(".+?(?=\\=)") //matches all characters before equal sign + R_gas_id = regex("(.+?)(?=\\=)") //matches all characters before equal sign if(!R_gas_value) - R_gas_value = regex("(?<=\\=).*") //matches all characters after equal sign + R_gas_value = regex("(?<=\\=)(.*)") //matches all characters after equal sign var/list/values = splittext(gas_string, ";") var/list/gases = list() @@ -412,7 +412,9 @@ var/list/gaslist_cache = null while(values.len) var/value = values[1] values.Cut(1,2) - gases[R_gas_id.Find(value)] = R_gas_value.Find(value) + R_gas_id.Find(value) + R_gas_value.Find(value) + gases[R_gas_id.group[1]] = text2num(R_gas_value.group[1]) //deal with the specific case of temperature if("TEMP" in gases) @@ -420,8 +422,9 @@ var/list/gaslist_cache = null gases -= "TEMP" var/list/cached_gases = src.gases - assert_gases(arglist(gases)) cached_gases &= gases + for(var/id in gases-cached_gases) + add_gas(id) //add_gases() causes a runtime due to the nature of arglist() for(var/id in gases) cached_gases[id][MOLES] = gases[id] diff --git a/code/modules/lighting/lighting_system.dm b/code/modules/lighting/lighting_system.dm index 5cc451fd443..cce8b0a8aef 100644 --- a/code/modules/lighting/lighting_system.dm +++ b/code/modules/lighting/lighting_system.dm @@ -312,9 +312,8 @@ redraw_lighting(1) /turf/open/space/init_lighting() - . = ..() - if(config.starlight) - update_starlight() + ..() + update_starlight() /turf/proc/redraw_lighting(instantly = 0) if(lighting_object)