Skip to content

Commit

Permalink
bugfix: Now blob can't expand into transitional borders of the Z-level (
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladisvell authored Oct 17, 2023
1 parent 8ef3f18 commit 82a8354
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions code/__HELPERS/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

5 changes: 5 additions & 0 deletions code/game/gamemodes/blob/powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down
4 changes: 4 additions & 0 deletions code/game/gamemodes/blob/theblob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 82a8354

Please sign in to comment.