Skip to content

Commit

Permalink
changes Assimilate_Air() behavior when there are no atmos_adjacent_turfs
Browse files Browse the repository at this point in the history
  • Loading branch information
duncathan committed Oct 13, 2017
1 parent 882e561 commit 26e1a8c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@

//////Assimilate Air//////
/turf/open/proc/Assimilate_Air()
if(blocks_air)
var/turf_count = LAZYLEN(atmos_adjacent_turfs)
if(blocks_air || !turf_count) //if there weren't any open turfs, no need to update.
return

var/datum/gas_mixture/total = new//Holders to assimilate air from nearby turfs
var/list/total_gases = total.gases
var/turf_count = LAZYLEN(atmos_adjacent_turfs)

for(var/T in atmos_adjacent_turfs)
var/turf/open/S = T
Expand All @@ -296,9 +296,6 @@

air.copy_from(total)

if(!turf_count) //if there weren't any open turfs, no need to update.
return

var/list/air_gases = air.gases
for(var/id in air_gases)
air_gases[id][MOLES] /= turf_count //Averages contents of the turfs, ignoring walls and the like
Expand Down

0 comments on commit 26e1a8c

Please sign in to comment.