Skip to content

Commit

Permalink
fix squeak component (#26709)
Browse files Browse the repository at this point in the history
fixes #10334 "Blood crawling slaughter demons make rubber duckies squeak"
fixes squeak component being confused about what is the crossed and what is the crossing atom
prevents some potential runtimes in play_squeak_crossed
  • Loading branch information
Kenionatus authored Sep 14, 2024
1 parent 515d3eb commit 148eae5
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions code/datums/components/squeak.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,34 @@
else
steps++

/datum/component/squeak/proc/play_squeak_crossed(atom/movable/AM)
if(isitem(AM))
var/obj/item/I = AM
/datum/component/squeak/proc/play_squeak_crossed(atom/source, atom/movable/crossing)
if(istype(crossing, /obj/effect))
return
if(ismob(crossing))
var/mob/M = crossing
if(M.flying)
return
if(isliving(crossing))
var/mob/living/L = M
if(L.floating)
return
else if(isitem(crossing))
var/obj/item/I = source
if(I.flags & ABSTRACT)
return
else if(isprojectile(AM))
var/obj/item/projectile/P = AM
if(isprojectile(crossing))
var/obj/item/projectile/P = crossing
if(P.original != parent)
return
if(ismob(AM))
var/mob/M = AM
if(ismob(source))
var/mob/M = source
if(M.flying)
return
if(isliving(AM))
if(isliving(source))
var/mob/living/L = M
if(L.floating)
return
var/atom/current_parent = parent
if(isturf(current_parent.loc))
play_squeak()
play_squeak()

/datum/component/squeak/proc/use_squeak()
if(last_use + use_delay < world.time)
Expand Down

0 comments on commit 148eae5

Please sign in to comment.