From e7eba6b4c57ee3a292a774748a9b4e29753abcb4 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 13 Jan 2025 22:20:06 +0100 Subject: [PATCH] Fix #23597: Adjust any staff set to EatFood animation (#23613) --- src/openrct2/park/Legacy.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/openrct2/park/Legacy.cpp b/src/openrct2/park/Legacy.cpp index b955595587..6e6bab6c01 100644 --- a/src/openrct2/park/Legacy.cpp +++ b/src/openrct2/park/Legacy.cpp @@ -2335,6 +2335,21 @@ static bool ConvertPeepAnimationType(TPeepType* peep, AnimObjectConversionTable& auto& conversion = table[legacyPAG]; peep->AnimationObjectIndex = conversion.first; peep->AnimationGroup = static_cast(conversion.second); + + if (!peep->template Is()) + return true; + + // NB: 'EatFood' used to be supported, but turned out to be unused in C++ code. + // Assigned sprites were found to be identical to those of 'Wave2', hence the mapping. + // However, it appears to have been used by JavaScript plugins, still, hence the + // need to convert any existing sprites. + if (peep->AnimationType == PeepAnimationType::EatFood) + peep->AnimationType = PeepAnimationType::Wave2; + + // NB: this is likely unnecessary, but a precautionary measure considering the above. + if (peep->NextAnimationType == PeepAnimationType::EatFood) + peep->NextAnimationType = PeepAnimationType::Wave2; + return true; }