Skip to content

Commit

Permalink
fixes some slime things (#1633)
Browse files Browse the repository at this point in the history
* should be a fix

* Update corral_data.dm

* burning fix

* Update ducts.dm

* Update ducts.dm
  • Loading branch information
dwasint authored Apr 12, 2024
1 parent 430001d commit 185b127
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
5 changes: 4 additions & 1 deletion monkestation/code/modules/liquids/liquid_groups.dm
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,10 @@ GLOBAL_VAR_INIT(liquid_debug_colors, FALSE)

if(group_burn_rate >= reagents_per_turf)
var/list/removed_turf = list()
for(var/num = 1, num < round(group_burn_rate / reagents_per_turf))
var/number = round(group_burn_rate / reagents_per_turf)
for(var/num in 1 to number)
if(!length(burning_members))
break
var/turf/picked_turf = burning_members[1]
extinguish(picked_turf)
remove_from_group(picked_turf)
Expand Down
22 changes: 22 additions & 0 deletions monkestation/code/modules/slimecore/corral/corral_data.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@

RegisterSignal(arrived, COMSIG_ATOM_SUCKED, PROC_REF(remove_cause_sucked))
RegisterSignal(arrived, COMSIG_LIVING_DEATH, PROC_REF(remove_cause_sucked))
RegisterSignals(arrived, list(COMSIG_PREQDELETED, COMSIG_QDELETING), PROC_REF(try_remove))
managed_slimes |= arrived
for(var/datum/corral_upgrade/upgrade as anything in corral_upgrades)
upgrade.on_slime_entered(arrived, src)
update_slimes()

/datum/corral_data/proc/check_exited(turf/source, atom/movable/gone, direction)
if(!istype(gone, /mob/living/basic/slime))
Expand All @@ -65,14 +67,34 @@

UnregisterSignal(gone, COMSIG_ATOM_SUCKED)
UnregisterSignal(gone, COMSIG_LIVING_DEATH)
UnregisterSignal(gone, list(COMSIG_PREQDELETED, COMSIG_QDELETING))
managed_slimes -= gone
for(var/datum/corral_upgrade/upgrade as anything in corral_upgrades)
upgrade.on_slime_exited(gone)
update_slimes()

/datum/corral_data/proc/remove_cause_sucked(atom/movable/gone)

UnregisterSignal(gone, COMSIG_ATOM_SUCKED)
UnregisterSignal(gone, COMSIG_LIVING_DEATH)
UnregisterSignal(gone, list(COMSIG_PREQDELETED, COMSIG_QDELETING))
managed_slimes -= gone
for(var/datum/corral_upgrade/upgrade as anything in corral_upgrades)
upgrade.on_slime_exited(gone)
update_slimes()

/datum/corral_data/proc/try_remove(mob/living/basic/slime/source)
managed_slimes -= source
update_slimes()

/datum/corral_data/proc/update_slimes()
for(var/mob/living/basic/slime/slime as anything in managed_slimes)
if(QDELETED(slime) || !(get_turf(slime) in corral_turfs))
managed_slimes -= slime
if(QDELETED(slime))
continue
UnregisterSignal(slime, COMSIG_ATOM_SUCKED)
UnregisterSignal(slime, COMSIG_LIVING_DEATH)
UnregisterSignal(slime, list(COMSIG_PREQDELETED, COMSIG_QDELETING))
for(var/datum/corral_upgrade/upgrade as anything in corral_upgrades)
upgrade.on_slime_exited(slime)
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

else
data["slimes"] = list()
linked_data.update_slimes()
for(var/mob/living/basic/slime/slime as anything in linked_data.managed_slimes)
var/list/slime_data = list()
slime_data += list(
Expand Down

0 comments on commit 185b127

Please sign in to comment.