diff --git a/src/common/Network/CommonActorControl.h b/src/common/Network/CommonActorControl.h index 53a88d50..734862f7 100644 --- a/src/common/Network/CommonActorControl.h +++ b/src/common/Network/CommonActorControl.h @@ -116,7 +116,7 @@ namespace Sapphire::Network::ActorControl ZoneInDefaultPos = 0xC9, TeleportStart = 0xCB, - + TeleportInvitation = 0xCC, TeleportDone = 0xCD, TeleportDoneFadeOut = 0xCE, diff --git a/src/world/Action/Action.cpp b/src/world/Action/Action.cpp index 6983f079..5504c8fe 100644 --- a/src/world/Action/Action.cpp +++ b/src/world/Action/Action.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include "WorldServer.h" @@ -140,7 +139,14 @@ bool Action::Action::init() } else { - std::memset( &m_lutEntry, 0, sizeof( ActionEntry ) ); + m_lutEntry.curePotency = 0; + m_lutEntry.restoreMPPercentage = 0; + m_lutEntry.potency = 0; + m_lutEntry.comboPotency = 0; + m_lutEntry.flankPotency = 0; + m_lutEntry.rearPotency = 0; + m_lutEntry.frontPotency = 0; + m_lutEntry.nextCombo.clear(); } addDefaultActorFilters(); @@ -252,7 +258,8 @@ bool Action::Action::update() player->setLastActionTick( tickCount ); uint32_t delayMs = 100 - lastTickMs; castTime = ( m_castTimeMs + delayMs ); - m_castTimeRestMs = static_cast< uint64_t >( m_castTimeMs ) - std::difftime( static_cast< time_t >( tickCount ), static_cast< time_t >( m_startTime ) ); + m_castTimeRestMs = static_cast< uint64_t >( m_castTimeMs ) - + static_cast< uint64_t >( std::difftime( static_cast< time_t >( tickCount ), static_cast< time_t >( m_startTime ) ) ); } if( !hasCastTime() || std::difftime( static_cast< time_t >( tickCount ), static_cast< time_t >( m_startTime ) ) > castTime ) @@ -301,7 +308,7 @@ void Action::Action::start() data.Action = static_cast< uint16_t >( m_id ); data.ActionKey = m_id; data.ActionKind = m_actionKind; - data.CastTime = m_castTimeMs / 1000.f; + data.CastTime = static_cast< float >( m_castTimeMs ) / 1000.f; data.Target = static_cast< uint32_t >( m_targetId ); data.TargetPos[ 0 ] = Common::Util::floatToUInt16( m_pSource->getPos().x ); @@ -321,7 +328,7 @@ void Action::Action::start() auto actionStartPkt = makeActorControlSelf( m_pSource->getId(), ActorControlType::ActionStart, m_cooldownGroup, getId(), m_recastTimeMs / 10 ); - player->setRecastGroup( m_cooldownGroup, m_castTimeMs / 1000.f ); + player->setRecastGroup( m_cooldownGroup, static_cast< float >( m_castTimeMs ) / 1000.f ); server.queueForPlayer( player->getCharacterId(), actionStartPkt ); @@ -617,8 +624,8 @@ bool Action::Action::playerPreCheck( Entity::Player& player ) return false; // npc actions/non player actions - if( m_actionData->data().UseClassJob == -1 /* dunno what this is in old data && !m_actionData->data().isRoleAction*/ ) - return false; + //if( m_actionData->data().UseClassJob == -1 /* dunno what this is in old data && !m_actionData->data().isRoleAction*/ ) + // return false; if( player.getLevel() < m_actionData->data().UseClassJob ) return false; diff --git a/src/world/Action/Action.h b/src/world/Action/Action.h index d5d4999d..38799c1b 100644 --- a/src/world/Action/Action.h +++ b/src/world/Action/Action.h @@ -166,43 +166,43 @@ namespace Sapphire::World::Action bool hasValidLutEntry() const; - uint32_t m_id; - uint8_t m_actionKind; + uint32_t m_id{}; + uint8_t m_actionKind{}; - uint16_t m_sequence; + uint16_t m_sequence{}; Common::ActionPrimaryCostType m_primaryCostType; - uint16_t m_primaryCost; + uint16_t m_primaryCost{}; - uint64_t m_startTime; - uint64_t m_castTimeRestMs; - uint32_t m_castTimeMs; - uint32_t m_recastTimeMs; - uint8_t m_cooldownGroup; - int8_t m_range; - uint8_t m_effectRange; - uint8_t m_xAxisModifier; + uint64_t m_startTime{}; + uint64_t m_castTimeRestMs{}; + uint32_t m_castTimeMs{}; + uint32_t m_recastTimeMs{}; + uint8_t m_cooldownGroup{}; + int8_t m_range{}; + uint8_t m_effectRange{}; + uint8_t m_xAxisModifier{}; Common::ActionAspect m_aspect; Common::CastType m_castType; Common::ActionCategory m_category; - uint32_t m_additionalData; + uint32_t m_additionalData{}; Entity::CharaPtr m_pSource; Entity::CharaPtr m_pTarget; - uint64_t m_targetId; + uint64_t m_targetId{}; - bool m_canTargetSelf; - bool m_canTargetParty; - bool m_canTargetFriendly; - bool m_canTargetHostile; - bool m_canTargetDead; + bool m_canTargetSelf{}; + bool m_canTargetParty{}; + bool m_canTargetFriendly{}; + bool m_canTargetHostile{}; + bool m_canTargetDead{}; Common::ActionInterruptType m_interruptType; std::shared_ptr< Component::Excel::ExcelStruct< Component::Excel::Action > > m_actionData; - Common::FFXIVARR_POSITION3 m_pos; + Common::FFXIVARR_POSITION3 m_pos{}; EffectBuilderPtr m_effectBuilder; diff --git a/src/world/Manager/ShopMgr.cpp b/src/world/Manager/ShopMgr.cpp index 9c2610db..50a395b4 100644 --- a/src/world/Manager/ShopMgr.cpp +++ b/src/world/Manager/ShopMgr.cpp @@ -90,7 +90,7 @@ bool Sapphire::World::Manager::ShopMgr::sellGilShopItem( Sapphire::Entity::Playe auto inventoryItem = player.getItemAt( container, fromSlot ); // todo: adding stack remove - if (quantity > 1) + if( quantity > 1 ) return false; player.discardItem( ( Sapphire::Common::InventoryType )container, fromSlot ); diff --git a/src/world/Manager/TerritoryMgr.cpp b/src/world/Manager/TerritoryMgr.cpp index faa44507..dcdc0e05 100644 --- a/src/world/Manager/TerritoryMgr.cpp +++ b/src/world/Manager/TerritoryMgr.cpp @@ -711,15 +711,8 @@ bool Sapphire::World::Manager::TerritoryMgr::joinWorld( Sapphire::Entity::Player // see if a valid zone could be found for the character if( !pCurrZone ) { - Logger::error( "[{0}] Territory #{1} not found!", player.getCharacterId(), territoryTypeId ); - Logger::error( "[{0}] Setting default zone instead", player.getCharacterId() ); - - // default to new gridania - // TODO: should probably just abort and mark character as corrupt - pCurrZone = getZoneByTerritoryTypeId( 132 ); - - player.setPos( { 0.0f, 0.0f, 0.0f }, false ); - player.setRot( 0.0f ); + Logger::error( "[{0}] Territory #{1} not found, manual adjustment of territory required!", player.getCharacterId(), territoryTypeId ); + return false; } if( !movePlayer( pCurrZone, player ) ) diff --git a/src/world/Manager/WarpMgr.cpp b/src/world/Manager/WarpMgr.cpp new file mode 100644 index 00000000..451374ff --- /dev/null +++ b/src/world/Manager/WarpMgr.cpp @@ -0,0 +1,8 @@ +#include +#include + +#include "TaskMgr.h" +#include "WarpMgr.h" + +using namespace Sapphire::World::Manager; +using namespace Sapphire::World; diff --git a/src/world/Manager/WarpMgr.h b/src/world/Manager/WarpMgr.h new file mode 100644 index 00000000..1a353a36 --- /dev/null +++ b/src/world/Manager/WarpMgr.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include +#include +#include + +namespace Sapphire::World::Manager +{ + + class WarpMgr + { + public: + WarpMgr() = default; + + }; + +}