diff --git a/code/__HELPERS/atoms.dm b/code/__HELPERS/atoms.dm index d86c8623b1b..bbd859e0021 100644 --- a/code/__HELPERS/atoms.dm +++ b/code/__HELPERS/atoms.dm @@ -71,3 +71,12 @@ if(length(check.contents)) atoms |= check.collect_all_atoms_of_type(path, blacklist) return atoms +/** + * Proc that returns if selected loc, or atom is within boundaries of playable area. (non-transitional space) + */ +/proc/is_location_within_transition_boundaries(atom/loc) + return (loc.x > TRANSITION_BORDER_WEST) \ + && (loc.x < TRANSITION_BORDER_EAST) \ + && (loc.y > TRANSITION_BORDER_SOUTH) \ + && (loc.y < TRANSITION_BORDER_NORTH) + diff --git a/code/game/gamemodes/blob/powers.dm b/code/game/gamemodes/blob/powers.dm index c6d069e927a..82c4d85aeaf 100644 --- a/code/game/gamemodes/blob/powers.dm +++ b/code/game/gamemodes/blob/powers.dm @@ -328,6 +328,11 @@ if(!can_attack()) return + + if(!is_location_within_transition_boundaries(T)) + to_chat(src, "You can't expand here...") + return + var/obj/structure/blob/B = locate() in T if(B) to_chat(src, "There is a blob here!") diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 5867a920a26..5c1762bfe99 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -93,6 +93,8 @@ var/dirn = pick(dirs) dirs.Remove(dirn) var/turf/T = get_step(src, dirn) + if(!is_location_within_transition_boundaries(T)) + continue var/obj/structure/blob/B = (locate(/obj/structure/blob) in T) if(!B) expand(T,1,a_color)//No blob here so try and expand @@ -127,6 +129,8 @@ else T = null if(!T) return 0 + if(!is_location_within_transition_boundaries(T)) + return var/obj/structure/blob/normal/B = new /obj/structure/blob/normal(src.loc, min(obj_integrity, 30)) B.color = a_color B.density = 1