Skip to content

Commit

Permalink
blockado
Browse files Browse the repository at this point in the history
  • Loading branch information
Superlagg committed Jan 7, 2025
1 parent 3969afb commit 5ef7a5d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions code/datums/components/spawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,24 @@
// return
// activate()
if(something_in_range())
if(!am_special && blocked())
return
try_to_spawn()

/// checks if we're blocked by something
/datum/component/spawner/proc/blocked()
var/atom/A = parent
var/turf/here = get_turf(A)
for(var/obj/structure/respawner_blocker/RB in SSmonster_spawner.spawn_blockers)
if(here.z != RB.z)
continue
var/maxdist = RB.protection_radius
if(maxdist <= 0)
continue
if(get_dist(RB, here) <= maxdist)
RB.blocked_something()
return TRUE

/// turns itself on for another 20ish seconds
/datum/component/spawner/proc/activate()
active = TRUE
Expand Down

0 comments on commit 5ef7a5d

Please sign in to comment.