mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 11:13:16 +00:00
Fixes a runtime involving ZAS zones lose their air datum. (I have no fucking idea why that happens)
Fixes #3059
This commit is contained in:
@@ -81,11 +81,17 @@ proc/ZMerge(zone/A,zone/B)
|
|||||||
if(!istype(A) || !istype(B))
|
if(!istype(A) || !istype(B))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
var/new_contents = A.contents + B.contents
|
||||||
|
|
||||||
|
//Set all the zone vars.
|
||||||
|
for(var/turf/simulated/T in B.contents)
|
||||||
|
T.zone = A
|
||||||
|
|
||||||
|
if(istype(A.air) && istype(B.air))
|
||||||
//Merges two zones so that they are one.
|
//Merges two zones so that they are one.
|
||||||
var/a_size = A.air.group_multiplier
|
var/a_size = A.air.group_multiplier
|
||||||
var/b_size = B.air.group_multiplier
|
var/b_size = B.air.group_multiplier
|
||||||
var/c_size = a_size + b_size
|
var/c_size = a_size + b_size
|
||||||
var/new_contents = A.contents + B.contents
|
|
||||||
|
|
||||||
//Set air multipliers to one so air represents gas per tile.
|
//Set air multipliers to one so air represents gas per tile.
|
||||||
A.air.group_multiplier = 1
|
A.air.group_multiplier = 1
|
||||||
@@ -99,9 +105,18 @@ proc/ZMerge(zone/A,zone/B)
|
|||||||
A.air.merge(B.air)
|
A.air.merge(B.air)
|
||||||
A.air.group_multiplier = c_size
|
A.air.group_multiplier = c_size
|
||||||
|
|
||||||
//Set all the zone vars.
|
//I hate when the air datum somehow disappears.
|
||||||
for(var/turf/simulated/T in B.contents)
|
// Try to make it sorta work anyways. Fakit
|
||||||
T.zone = A
|
else if(istype(B.air))
|
||||||
|
A.air = B.air
|
||||||
|
A.air.group_multiplier = A.contents.len
|
||||||
|
|
||||||
|
else if(istype(A.air))
|
||||||
|
A.air.group_multiplier = A.contents.len
|
||||||
|
|
||||||
|
//Doublefakit.
|
||||||
|
else
|
||||||
|
A.air = new
|
||||||
|
|
||||||
//Check for connections to merge into the new zone.
|
//Check for connections to merge into the new zone.
|
||||||
for(var/connection/C in B.connections)
|
for(var/connection/C in B.connections)
|
||||||
|
|||||||
Reference in New Issue
Block a user