From 75dacba58685a02eb673cf9e09fd7aea6c7e1f52 Mon Sep 17 00:00:00 2001
From: Bloop <13398309+vinylspiders@users.noreply.github.com>
Date: Tue, 13 Feb 2024 01:32:02 -0500
Subject: [PATCH] Adds unit test for tail wag emote, fixes tail wag emote
(#81437)
## About The Pull Request
Funnier for who, Lemon?!

https://github.com/tgstation/tgstation/pull/81400 broke the tail wag
emote. This will make it work again.
I did test it. _cough_.
Before

After

My fault for not writing a better unit test I guess.
## Why It's Good For The Game
Fixes a bug.
## Changelog
:cl:
fix: *wag emote is now functional again
/:cl:
---
code/modules/mob/living/carbon/human/emote.dm | 4 ++--
code/modules/unit_tests/tail_wag.dm | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm
index 381e7e24a45..a7be681a22e 100644
--- a/code/modules/mob/living/carbon/human/emote.dm
+++ b/code/modules/mob/living/carbon/human/emote.dm
@@ -136,9 +136,9 @@
//I am so sorry my son
//We bypass helpers here cause we already have the tail
if(oranges_accessory.wag_flags & WAG_WAGGING) //We verified the tail exists in can_run_emote()
- oranges_accessory.stop_wag(src)
+ oranges_accessory.stop_wag(user)
else
- oranges_accessory.start_wag(src)
+ oranges_accessory.start_wag(user)
/datum/emote/living/carbon/human/wag/select_message_type(mob/user, intentional)
. = ..()
diff --git a/code/modules/unit_tests/tail_wag.dm b/code/modules/unit_tests/tail_wag.dm
index 3868bb2c0e0..cd82dfdfd50 100644
--- a/code/modules/unit_tests/tail_wag.dm
+++ b/code/modules/unit_tests/tail_wag.dm
@@ -20,6 +20,18 @@
if(dummy_tail.wag_flags & WAG_WAGGING)
TEST_FAIL("Tail did not stop wagging when it should have!")
+ // TESTING WAG EMOTE
+
+ // start wagging
+ dummy.emote("wag")
+ if(!(dummy_tail.wag_flags & WAG_WAGGING))
+ TEST_FAIL("Tail did not start wagging after using the *wag emote!")
+
+ // stop wagging
+ dummy.emote("wag")
+ if(dummy_tail.wag_flags & WAG_WAGGING)
+ TEST_FAIL("Tail did not stop wagging after using the *wag emote!")
+
// TESTING WAG_ABLE FLAG
// flip the wag flag to unwaggable