From 2a08f963864d6e0832d84fa767ab770b114940b7 Mon Sep 17 00:00:00 2001 From: MangosArentLiterature <58055358+MangosArentLiterature@users.noreply.github.com> Date: Tue, 13 Apr 2021 17:43:23 -0500 Subject: [PATCH] Add >[statement] support - Adds a regex to detect >[statement] - Also puts titles on a new line like AA --- src/packets.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/packets.cpp b/src/packets.cpp index b4d5988..a2da0f8 100644 --- a/src/packets.cpp +++ b/src/packets.cpp @@ -631,7 +631,7 @@ AOPacket AOClient::validateIcPacket(AOPacket packet) //Testimony playback if (area->test_rec == AreaData::TestimonyRecording::RECORDING || area->test_rec == AreaData::TestimonyRecording::ADD) { if (area->statement == 0) { - args[4] = "~~-- " + args[4] + " --"; + args[4] = "~~\\n-- " + args[4] + " --"; args[14] = "3"; server->broadcast(AOPacket("RT",{"testimony1"}), current_area); } @@ -649,7 +649,12 @@ AOPacket AOClient::validateIcPacket(AOPacket packet) area->statement = area->statement - 1; args = playTestimony(); } - + QRegularExpression jump("(?>)(?[0,1,2,3,4,5,6,7,8,9]+)"); + QRegularExpressionMatch match = jump.match(args[4]); + if (match.hasMatch()) { + area->statement = match.captured("int").toInt(); + args= playTestimony(); + } } return AOPacket("MS", args);