Skip to content

Commit

Permalink
Fix worms doubling when banished
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Jun 24, 2023
1 parent 807387b commit 559da8a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions code/modules/cm_aliens/structures/special/pylon_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,14 @@

// Handle spawning larva if core is connected to a hive
if(linked_hive)
for(var/mob/living/carbon/xenomorph/larva/L in range(2, src))
if((!L.ckey || L.stat == DEAD) && L.burrowable && (L.hivenumber == linked_hive.hivenumber) && !QDELETED(L))
visible_message(SPAN_XENODANGER("[L] quickly burrows into \the [src]."))
linked_hive.stored_larva++
linked_hive.hive_ui.update_burrowed_larva()
qdel(L)
for(var/mob/living/carbon/xenomorph/larva/worm in range(2, src))
if((!worm.ckey || worm.stat == DEAD) && worm.burrowable && (worm.hivenumber == linked_hive.hivenumber) && !QDELETED(worm))
visible_message(SPAN_XENODANGER("[worm] quickly burrows into \the [src]."))
if(!worm.banished)
// Goob job bringing her back home, but no doubling please
linked_hive.stored_larva++
linked_hive.hive_ui.update_burrowed_larva()
qdel(worm)

var/spawning_larva = can_spawn_larva() && (last_larva_time + spawn_cooldown) < world.time
if(spawning_larva)
Expand Down

0 comments on commit 559da8a

Please sign in to comment.