mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 18:13:34 +01:00
fix squeak component (#26709)
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
This commit is contained in:
@@ -71,26 +71,34 @@
|
||||
else
|
||||
steps++
|
||||
|
||||
/datum/component/squeak/proc/play_squeak_crossed(atom/movable/AM)
|
||||
if(isitem(AM))
|
||||
var/obj/item/I = AM
|
||||
if(I.flags & ABSTRACT)
|
||||
return
|
||||
else if(isprojectile(AM))
|
||||
var/obj/item/projectile/P = AM
|
||||
if(P.original != parent)
|
||||
return
|
||||
if(ismob(AM))
|
||||
var/mob/M = 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(AM))
|
||||
if(isliving(crossing))
|
||||
var/mob/living/L = M
|
||||
if(L.floating)
|
||||
return
|
||||
var/atom/current_parent = parent
|
||||
if(isturf(current_parent.loc))
|
||||
play_squeak()
|
||||
else if(isitem(crossing))
|
||||
var/obj/item/I = source
|
||||
if(I.flags & ABSTRACT)
|
||||
return
|
||||
if(isprojectile(crossing))
|
||||
var/obj/item/projectile/P = crossing
|
||||
if(P.original != parent)
|
||||
return
|
||||
if(ismob(source))
|
||||
var/mob/M = source
|
||||
if(M.flying)
|
||||
return
|
||||
if(isliving(source))
|
||||
var/mob/living/L = M
|
||||
if(L.floating)
|
||||
return
|
||||
play_squeak()
|
||||
|
||||
/datum/component/squeak/proc/use_squeak()
|
||||
if(last_use + use_delay < world.time)
|
||||
|
||||
Reference in New Issue
Block a user