diff --git a/zone/dialogue_window.cpp b/zone/dialogue_window.cpp index 1f9d0724d..e2cd9e2a1 100644 --- a/zone/dialogue_window.cpp +++ b/zone/dialogue_window.cpp @@ -69,12 +69,13 @@ void DialogueWindow::Render(Client *c, std::string markdown) std::string animation = Strings::GetBetween(output, "+", "+"); if (!animation.empty()) { LogDiaWind("Client [{}] Animation is not empty, contents are [{}]", c->GetCleanName(), animation); - Strings::FindReplace(output, fmt::format("+{}+", animation), ""); // we treat the animation field differently if it is a number + bool found_animation = false; if (Strings::IsNumber(animation)) { LogDiaWindDetail("Client [{}] Animation is a number, firing animation [{}]", c->GetCleanName(), animation); target->DoAnim(std::stoi(animation)); + found_animation = true; } else { for (auto &a: animations) { @@ -86,9 +87,14 @@ void DialogueWindow::Render(Client *c, std::string markdown) a.first ); target->DoAnim(a.second); + found_animation = true; } } } + + if (found_animation) { + Strings::FindReplace(output, fmt::format("+{}+", animation), ""); + } } if (animation.empty() && RuleB(Chat, DialogueWindowAnimatesNPCsIfNoneSet)) {