From c65658e47b74cfb8a14a6754c5f4156b070d7d0a Mon Sep 17 00:00:00 2001 From: Mordred Date: Sun, 26 Nov 2017 01:12:26 +0100 Subject: [PATCH] renamed type in actors to ObjKind as thats what it is called internally, also less ambugious to modelType which i also added an enum for --- src/servers/Server_Common/Common.h | 10 +++++++--- src/servers/Server_Zone/Actor/Actor.cpp | 4 ++-- src/servers/Server_Zone/Actor/Actor.h | 18 ++++++++++-------- src/servers/Server_Zone/Actor/BattleNpc.cpp | 8 ++++---- src/servers/Server_Zone/Actor/Player.cpp | 2 +- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/servers/Server_Common/Common.h b/src/servers/Server_Common/Common.h index fae2a31b..9b1c1126 100644 --- a/src/servers/Server_Common/Common.h +++ b/src/servers/Server_Common/Common.h @@ -802,10 +802,14 @@ namespace Common { MountSkill = 0xD, }; - struct ServerEntry + /*! ModelType as found in eventsystemdefine.exd */ + enum ModelType : uint8_t { - uint32_t serverId; - uint32_t flags; + Human = 1, + DemiHuman = 2, + Monster = 3, + SharedGroup = 4, + Parts = 5 }; typedef std::vector< PlayerStateFlag > PlayerStateFlagList; diff --git a/src/servers/Server_Zone/Actor/Actor.cpp b/src/servers/Server_Zone/Actor/Actor.cpp index dcf572d0..8869cfda 100644 --- a/src/servers/Server_Zone/Actor/Actor.cpp +++ b/src/servers/Server_Zone/Actor/Actor.cpp @@ -59,13 +59,13 @@ std::string Core::Entity::Actor::getName() const /*! \return true if the actor is of type player */ bool Core::Entity::Actor::isPlayer() const { - return m_type == ActorType::Player; + return m_objKind == ObjKind::Player; } /*! \return true if the actor is of type mob */ bool Core::Entity::Actor::isMob() const { - return m_type == ActorType::BattleNpc; + return m_objKind == ObjKind::BattleNpc; } /*! \return list of actors currently in range */ diff --git a/src/servers/Server_Zone/Actor/Actor.h b/src/servers/Server_Zone/Actor/Actor.h index 5a784f28..9378d67c 100644 --- a/src/servers/Server_Zone/Actor/Actor.h +++ b/src/servers/Server_Zone/Actor/Actor.h @@ -20,21 +20,23 @@ namespace Entity { class Actor : public boost::enable_shared_from_this< Actor > { public: - enum ActorType : uint8_t + enum ObjKind : uint8_t { None = 0x00, Player = 0x01, BattleNpc = 0x02, EventNpc = 0x03, - unk1 = 0x04, - AetheryteNpc = 0x05, - ResourceNode = 0x06, + Treasure = 0x04, + Aetheryte = 0x05, + GatheringPoint = 0x06, EventObj = 0x07, Mount = 0x08, - Minion = 0x09, + Companion = 0x09, Retainer = 0x0A, - unk2 = 0x0B, - Furniture = 0x0C, + Area = 0x0B, + Housing = 0x0C, + Cutscene = 0x0D, + CardStand = 0x0E, }; enum Stance : uint8_t @@ -125,7 +127,7 @@ protected: /*! Id of the actor */ uint32_t m_id; /*! Type of the actor */ - ActorType m_type; + ObjKind m_objKind; /*! Ptr to the ZoneObj the actor belongs to */ ZonePtr m_pCurrentZone; /*! Last tick time for the actor ( in ms ) */ diff --git a/src/servers/Server_Zone/Actor/BattleNpc.cpp b/src/servers/Server_Zone/Actor/BattleNpc.cpp index d990369d..b7f18cc9 100644 --- a/src/servers/Server_Zone/Actor/BattleNpc.cpp +++ b/src/servers/Server_Zone/Actor/BattleNpc.cpp @@ -29,7 +29,7 @@ uint32_t Core::Entity::BattleNpc::m_nextID = 1149241694; Core::Entity::BattleNpc::BattleNpc() { m_id = 0; - m_type = ActorType::BattleNpc; + m_objKind = ObjKind::BattleNpc; m_status = ActorStatus::Idle; } @@ -49,7 +49,7 @@ Core::Entity::BattleNpc::BattleNpc( uint32_t modelId, uint32_t nameid, const Com m_pos = spawnPos; m_posOrigin = spawnPos; - m_type = ActorType::BattleNpc; + m_objKind = ObjKind::BattleNpc; m_mode = MODE_IDLE; m_targetId = INVALID_GAME_OBJECT_ID; @@ -83,7 +83,7 @@ Core::Entity::BattleNpc::BattleNpc( uint32_t modelId, uint32_t nameid, const Com m_invincibilityType = InvincibilityType::InvincibilityNone; - //m_type = static_cast< Common::ActorType >( type ); + //m_type = static_cast< Common::ObjKind >( type ); } @@ -147,7 +147,7 @@ void Core::Entity::BattleNpc::spawn( Core::Entity::PlayerPtr pTarget ) spawnPacket.data().rotation = Math::Util::floatToUInt16Rot( getRotation() ); - spawnPacket.data().type = static_cast< uint8_t >( m_type ); + spawnPacket.data().type = static_cast< uint8_t >( m_objKind ); spawnPacket.data().state = static_cast< uint8_t >( m_status ); diff --git a/src/servers/Server_Zone/Actor/Player.cpp b/src/servers/Server_Zone/Actor/Player.cpp index 6474ef01..ba6f075d 100644 --- a/src/servers/Server_Zone/Actor/Player.cpp +++ b/src/servers/Server_Zone/Actor/Player.cpp @@ -76,7 +76,7 @@ Core::Entity::Player::Player() : m_mount( 0 ) { m_id = 0; - m_type = ActorType::Player; + m_objKind = ObjKind::Player; m_currentStance = Stance::Passive; m_onlineStatus = 0; m_queuedZoneing = nullptr;