From 428462409629a182595979d384811c595df7621b Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Sat, 30 May 2020 20:33:51 -0400 Subject: [PATCH] Remove expedition includes from client header Make quest compass a vec3 to remove include dependency Quest compass location doesn't require a zone id since it can only be set in the zone that it's drawn in. Drop the DynamicZoneLocation member and forward declare to remove the dependency on header. Move ExpeditionInvite struct to zone common header Including expedition.h in client.h just to use the ExpeditionInvite struct is an unnecessary header dependency that increases incremental build time. This allows expedition classes to be forward declared in client header. --- zone/client.cpp | 6 +++--- zone/client.h | 10 +++++++--- zone/common.h | 7 +++++++ zone/entity.cpp | 1 + zone/expedition.h | 13 ++++--------- zone/expedition_request.h | 2 +- zone/lua_client.cpp | 1 + zone/zoning.cpp | 1 + 8 files changed, 25 insertions(+), 16 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index 3bf285d78..e946559ed 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -6159,11 +6159,11 @@ void Client::MarkSingleCompassLoc(float in_x, float in_y, float in_z, uint8 coun { if (count == 0) { - m_quest_compass.zone_id = 0; + m_has_quest_compass = false; } else { - m_quest_compass.zone_id = zone ? zone->GetZoneID() : 0; + m_has_quest_compass = true; m_quest_compass.x = in_x; m_quest_compass.y = in_y; m_quest_compass.z = in_z; @@ -9856,7 +9856,7 @@ void Client::SendDzCompassUpdate() // todo: shared tasks, missions, and quests with an associated dz // compass set via MarkSingleCompassLocation() - if (zone && zone->GetZoneID() == m_quest_compass.zone_id && zone->GetInstanceID() == 0) + if (m_has_quest_compass) { DynamicZoneCompassEntry_Struct entry; entry.dz_zone_id = 0; diff --git a/zone/client.h b/zone/client.h index 17f25d70b..c12f5f26b 100644 --- a/zone/client.h +++ b/zone/client.h @@ -21,12 +21,17 @@ class Client; class EQApplicationPacket; class EQStream; +class DynamicZone; +class Expedition; +class ExpeditionLockoutTimer; +class ExpeditionRequest; class Group; class NPC; class Object; class Raid; class Seperator; class ServerPacket; +struct DynamicZoneLocation; enum WaterRegionType : int; namespace EQ @@ -52,8 +57,6 @@ namespace EQ #include "aggromanager.h" #include "common.h" -#include "expedition.h" -#include "dynamiczone.h" #include "merc.h" #include "mob.h" #include "qglobals.h" @@ -1702,7 +1705,8 @@ private: uint32 m_expedition_id = 0; ExpeditionInvite m_pending_expedition_invite { 0 }; std::vector m_expedition_lockouts; - DynamicZoneLocation m_quest_compass; + glm::vec3 m_quest_compass; + bool m_has_quest_compass = false; #ifdef BOTS diff --git a/zone/common.h b/zone/common.h index 19df1a576..c05c6a95b 100644 --- a/zone/common.h +++ b/zone/common.h @@ -786,5 +786,12 @@ struct DamageHitInfo { EQ::skills::SkillType skill; }; +struct ExpeditionInvite +{ + uint32_t expedition_id; + std::string inviter_name; + std::string swap_remove_name; +}; + #endif diff --git a/zone/entity.cpp b/zone/entity.cpp index e19ecdf73..68364ff82 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -32,6 +32,7 @@ #include "../common/features.h" #include "../common/guilds.h" +#include "dynamiczone.h" #include "guild_mgr.h" #include "petitions.h" #include "quest_parser_collection.h" diff --git a/zone/expedition.h b/zone/expedition.h index cb40227f0..403dff438 100644 --- a/zone/expedition.h +++ b/zone/expedition.h @@ -32,6 +32,7 @@ class Client; class EQApplicationPacket; +struct ExpeditionInvite; class ExpeditionRequest; class MySQLRequestResult; class ServerPacket; @@ -54,19 +55,13 @@ struct ExpeditionMember std::string name; ExpeditionMemberStatus status = ExpeditionMemberStatus::Online; - ExpeditionMember() {} - ExpeditionMember(uint32_t char_id_, const std::string& name_) : char_id(char_id_), name(name_) {} + ExpeditionMember() = default; + ExpeditionMember(uint32_t char_id_, const std::string& name_) + : char_id(char_id_), name(name_) {} ExpeditionMember(uint32_t char_id_, const std::string& name_, ExpeditionMemberStatus status_) : char_id(char_id_), name(name_), status(status_) {} }; -struct ExpeditionInvite -{ - uint32_t expedition_id; - std::string inviter_name; - std::string swap_remove_name; -}; - class Expedition { public: diff --git a/zone/expedition_request.h b/zone/expedition_request.h index 864aa855a..569dcc6ae 100644 --- a/zone/expedition_request.h +++ b/zone/expedition_request.h @@ -21,6 +21,7 @@ #ifndef EXPEDITION_REQUEST_H #define EXPEDITION_REQUEST_H +#include "expedition.h" #include "expedition_lockout_timer.h" #include #include @@ -32,7 +33,6 @@ class Group; class MySQLRequestResult; class Raid; class ServerPacket; -struct ExpeditionMember; class ExpeditionRequest { diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index 8ed8142ad..dfd9104ff 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -4,6 +4,7 @@ #include #include "client.h" +#include "dynamiczone.h" #include "expedition_lockout_timer.h" #include "expedition_request.h" #include "lua_client.h" diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 35dec1ca1..e294caa4e 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -21,6 +21,7 @@ #include "../common/rulesys.h" #include "../common/string_util.h" +#include "expedition.h" #include "queryserv.h" #include "quest_parser_collection.h" #include "string_ids.h"