From 6f461ab1bcde1bd851b666f5230fef69336d1545 Mon Sep 17 00:00:00 2001 From: Mordred Date: Sun, 4 Feb 2018 00:43:36 +0100 Subject: [PATCH 1/2] Fixed state flags --- src/common/Common.h | 1 - src/common/Network/PacketDef/Zone/ServerZoneDef.h | 9 ++++----- src/servers/sapphire_zone/Action/EventAction.cpp | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/common/Common.h b/src/common/Common.h index 507f8727..17b20358 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -388,7 +388,6 @@ namespace Common { enum struct PlayerStateFlag : uint8_t { - SomeFlag, NoCombat, Combat, Casting, diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index 37578406..ead2d3cb 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -829,11 +829,10 @@ struct FFXIVIpcActorOwner : FFXIVIpcBasePacket */ struct FFXIVIpcPlayerStateFlags : FFXIVIpcBasePacket { - /* 0000 */ uint16_t padding; - /* 0002 */ uint8_t flags[7]; - /* 0009 */ uint8_t padding1[3]; - /* 000C */ uint32_t padding2; - + uint8_t flags[7]; + uint8_t padding1[3]; + uint32_t padding2; + uint16_t padding; }; /** diff --git a/src/servers/sapphire_zone/Action/EventAction.cpp b/src/servers/sapphire_zone/Action/EventAction.cpp index b5e935cf..24a08001 100644 --- a/src/servers/sapphire_zone/Action/EventAction.cpp +++ b/src/servers/sapphire_zone/Action/EventAction.cpp @@ -53,7 +53,7 @@ void Core::Action::EventAction::onStart() if( m_pSource->isPlayer() ) { m_pSource->sendToInRangeSet( control, true ); - m_pSource->getAsPlayer()->setStateFlag( PlayerStateFlag::SomeFlag ); + m_pSource->getAsPlayer()->setStateFlag( PlayerStateFlag::Occupied2 ); } else m_pSource->sendToInRangeSet( control ); @@ -82,7 +82,7 @@ void Core::Action::EventAction::onFinish() if( m_pSource->isPlayer() ) { - m_pSource->getAsPlayer()->unsetStateFlag( PlayerStateFlag::SomeFlag ); + m_pSource->getAsPlayer()->unsetStateFlag( PlayerStateFlag::Occupied2 ); m_pSource->sendToInRangeSet( control, true ); } else From 9dfca22e10d75cedc20a68ca3550efb9364be9ba Mon Sep 17 00:00:00 2001 From: Mordred Date: Sun, 4 Feb 2018 02:26:02 +0100 Subject: [PATCH 2/2] Adjusted wrong casttime for eventactions, needs fixing in ex.json --- src/common/Exd/ExdDataGenerated.cpp | 2 +- src/servers/sapphire_zone/Action/EventAction.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/Exd/ExdDataGenerated.cpp b/src/common/Exd/ExdDataGenerated.cpp index 56df045f..a35c11a4 100644 --- a/src/common/Exd/ExdDataGenerated.cpp +++ b/src/common/Exd/ExdDataGenerated.cpp @@ -1432,7 +1432,7 @@ auto row = exdData->m_EventActionDat.get_row( row_id ); name = exdData->getField< std::string >( row, 0 ); icon = exdData->getField< uint16_t >( row, 1 ); - castTime = exdData->getField< uint16_t >( row, 3 ); + castTime = exdData->getField< uint8_t >( row, 2 ); } Core::Data::EventIconPriority::EventIconPriority( uint32_t row_id, Core::Data::ExdDataGenerated* exdData ) diff --git a/src/servers/sapphire_zone/Action/EventAction.cpp b/src/servers/sapphire_zone/Action/EventAction.cpp index 24a08001..9fa93a45 100644 --- a/src/servers/sapphire_zone/Action/EventAction.cpp +++ b/src/servers/sapphire_zone/Action/EventAction.cpp @@ -28,7 +28,7 @@ Core::Action::EventAction::EventAction( Entity::ActorPtr pActor, uint32_t eventI m_handleActionType = HandleActionType::Event; m_eventId = eventId; m_id = action; - m_castTime = g_exdDataGen.getEventAction( action )->castTime * 100; // TODO: Add security checks. + m_castTime = g_exdDataGen.getEventAction( action )->castTime * 1000; // TODO: Add security checks. m_onActionFinishClb = finishRef; m_onActionInterruptClb = interruptRef; m_pSource = pActor;