From d8acb9883d5547ab473391d2e8639f923a486cef Mon Sep 17 00:00:00 2001 From: Kinglykrab Date: Sun, 12 Feb 2023 16:47:43 -0500 Subject: [PATCH] [Quest API] Optionally parse EVENT_WARP # Notes - Optionally parse this event instead of always doing so. --- zone/cheat_manager.cpp | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/zone/cheat_manager.cpp b/zone/cheat_manager.cpp index f780bb5f1..a8dbc2e55 100644 --- a/zone/cheat_manager.cpp +++ b/zone/cheat_manager.cpp @@ -43,13 +43,17 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 zone->GetShortName() ); LogCheat(fmt::runtime(message)); - std::string export_string = fmt::format( - "{} {} {}", - position1.x, - position1.y, - position1.z - ); - parse->EventPlayer(EVENT_WARP, m_target, export_string, 0); + + if (parse->PlayerHasQuestSub(EVENT_WARP)) { + const auto& export_string = fmt::format( + "{} {} {}", + position1.x, + position1.y, + position1.z + ); + + parse->EventPlayer(EVENT_WARP, m_target, export_string, 0); + } } break; case MQWarpAbsolute: @@ -72,14 +76,19 @@ void CheatManager::CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 zone->GetShortName() ); LogCheat(fmt::runtime(message)); - std::string export_string = fmt::format( - "{} {} {}", - position1.x, - position1.y, - position1.z - ); - parse->EventPlayer(EVENT_WARP, m_target, export_string, 0); - m_time_since_last_warp_detection.Start(2500); + + if (parse->PlayerHasQuestSub(EVENT_WARP)) { + const auto& export_string = fmt::format( + "{} {} {}", + position1.x, + position1.y, + position1.z + ); + + parse->EventPlayer(EVENT_WARP, m_target, export_string, 0);; + } + + m_time_since_last_warp_detection.Start(2500) } break; case MQWarpShadowStep: