From 4a8452014788ed428b3bef781a9fdec99c2364e9 Mon Sep 17 00:00:00 2001 From: DGamerL <108773801+DGamerL@users.noreply.github.com> Date: Fri, 12 Jul 2024 18:54:13 +0200 Subject: [PATCH] Replaces a weird loop with the `spin()` proc (#26182) * Wacky things * Whoopsie --- code/modules/mob/living/simple_animal/friendly/dog.dm | 4 +--- .../mob/living/simple_animal/friendly/farm_animals.dm | 2 +- code/modules/mob/living/simple_animal/friendly/pet.dm | 7 +------ 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index 0dd5f3827f8..6c18de8aafa 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -250,9 +250,7 @@ item_to_add.forceMove(drop_location()) if(prob(25)) step_rand(item_to_add) - for(var/i in list(1,2,4,8,4,8,4,dir)) - setDir(i) - sleep(1) + spin(7 DECISECONDS, 1) return valid diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 38f8ae6789f..451bf2ee0f7 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -53,7 +53,7 @@ eat_plants() if(!pulledby) - for(var/direction in shuffle(list(1, 2, 4, 8, 5, 6, 9, 10))) + for(var/direction in shuffle(GLOB.alldirs)) var/step = get_step(src, direction) if(step) if(locate(/obj/structure/spacevine) in step || locate(/obj/structure/glowshroom) in step) diff --git a/code/modules/mob/living/simple_animal/friendly/pet.dm b/code/modules/mob/living/simple_animal/friendly/pet.dm index 4ab6c836090..3454ff04680 100644 --- a/code/modules/mob/living/simple_animal/friendly/pet.dm +++ b/code/modules/mob/living/simple_animal/friendly/pet.dm @@ -14,9 +14,4 @@ if(stat != CONSCIOUS || !paper.rolled) return user.visible_message("[user] baps [name] on the nose with the rolled up [O].") - spawn(0) - for(var/i in list(1, 2, 4, 8, 4, 2, 1, 2)) - setDir(i) - sleep(1) - - + INVOKE_ASYNC(src, PROC_REF(spin), 7 DECISECONDS, 1)