[REFACTOR] Helper proc for unbuckling a mob (#26918)

* Helper proc from unbuckling a mob

* Rename to unbuckle

* Minor fixes

* Move buckled up /mob/living

---------

Co-authored-by: Adrer <adrermail@gmail.com>
This commit is contained in:
Chap
2024-10-10 12:54:09 +00:00
committed by GitHub
co-authored by Adrer
parent 7ed4ef4f76
commit a060093b59
18 changed files with 41 additions and 38 deletions
+4 -4
View File
@@ -482,12 +482,12 @@
if(globalMalf > 16 && globalMalf < 35)
visible_message("<span class='warning'>[src] melts [exp_on], ian-izing the air around it!</span>")
throwSmoke(loc)
var/mob/tracked_ian = locate(/mob/living/simple_animal/pet/dog/corgi/Ian) in GLOB.mob_living_list
var/mob/living/tracked_ian = locate(/mob/living/simple_animal/pet/dog/corgi/Ian) in GLOB.mob_living_list
if(tracked_ian)
throwSmoke(tracked_ian.loc)
tracked_ian.loc = loc
if(tracked_ian.buckled)
tracked_ian.buckled.unbuckle_mob(tracked_ian, TRUE)
tracked_ian.unbuckle(force = TRUE)
investigate_log("Experimentor has stolen Ian!", "experimentor") //...if anyone ever fixes it...
else
new /mob/living/simple_animal/pet/dog/corgi(loc)
@@ -496,12 +496,12 @@
if(globalMalf > 36 && globalMalf < 59)
visible_message("<span class='warning'>[src] encounters a run-time error!</span>")
throwSmoke(loc)
var/mob/tracked_runtime = locate(/mob/living/simple_animal/pet/cat/Runtime) in GLOB.mob_living_list
var/mob/living/tracked_runtime = locate(/mob/living/simple_animal/pet/cat/Runtime) in GLOB.mob_living_list
if(tracked_runtime)
throwSmoke(tracked_runtime.loc)
tracked_runtime.loc = loc
if(tracked_runtime.buckled)
tracked_runtime.buckled.unbuckle_mob(tracked_runtime, TRUE)
tracked_runtime.unbuckle(force = TRUE)
investigate_log("Experimentor has stolen Runtime!", "experimentor")
else
new /mob/living/simple_animal/pet/cat(loc)