Merge pull request #10858 from GinjaNinja32/more-equal

fix equalize() not equalizing gases
This commit is contained in:
mwerezak
2015-08-24 15:54:44 -04:00

View File

@@ -99,15 +99,15 @@
/datum/gas_mixture/proc/equalize(datum/gas_mixture/sharer) /datum/gas_mixture/proc/equalize(datum/gas_mixture/sharer)
for(var/g in sharer.gas) var/our_heatcap = heat_capacity()
var/share_heatcap = sharer.heat_capacity()
for(var/g in gas|sharer.gas)
var/comb = gas[g] + sharer.gas[g] var/comb = gas[g] + sharer.gas[g]
comb /= volume + sharer.volume comb /= volume + sharer.volume
gas[g] = comb * volume gas[g] = comb * volume
sharer.gas[g] = comb * sharer.volume sharer.gas[g] = comb * sharer.volume
var/our_heatcap = heat_capacity()
var/share_heatcap = sharer.heat_capacity()
if(our_heatcap + share_heatcap) if(our_heatcap + share_heatcap)
temperature = ((temperature * our_heatcap) + (sharer.temperature * share_heatcap)) / (our_heatcap + share_heatcap) temperature = ((temperature * our_heatcap) + (sharer.temperature * share_heatcap)) / (our_heatcap + share_heatcap)
sharer.temperature = temperature sharer.temperature = temperature