Files
Bubberstation/code/__HELPERS/levels.dm
SkyratBot 73d6dc9f6e [MIRROR] Makes ore silo connecting work on multi-z [MDB IGNORE] (#14257)
* Makes ore silo connecting work on multi-z (#67640)

* makes ore silo connecting work on multi-z

* I merged the two checks for same z level when connecting an ore silo, and disconnecting it. This was because I didn't want to copy paste the code to use it twice, which was what now caused the problem of multi-z maps being unable to connect ore silos on the same level. At the time it was also intentional since it's easier to connect than to disconnect something, but I realize that this inconsistency isn't great or beneficial to anyone.

* Turns it into a helper instead

* Makes ore silo connecting work on multi-z

Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
2022-06-12 02:34:45 +01:00

20 lines
702 B
Plaintext

/**
* - is_valid_z_level
*
* Checks if source_loc and checking_loc is both on the station, or on the same z level.
* This is because the station's several levels aren't considered the same z, so multi-z stations need this special case.
*
* Args:
* source_loc - turf of the source we're comparing.
* checking_loc - turf we are comparing to source_loc.
*
* returns TRUE if connection is valid, FALSE otherwise.
*/
/proc/is_valid_z_level(turf/source_loc, turf/checking_loc)
// if we're both on "station", regardless of multi-z, we'll pass by.
if(is_station_level(source_loc.z) && is_station_level(checking_loc.z))
return TRUE
if(source_loc.z == checking_loc.z)
return TRUE
return FALSE