mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 22:57:45 +00:00
fix rotation in objectspawn ipc and send it too
This commit is contained in:
parent
7659521233
commit
bb35edd56b
5 changed files with 11 additions and 8 deletions
|
@ -1327,15 +1327,15 @@ struct FFXIVIpcObjectSpawn : FFXIVIpcBasePacket<ObjectSpawn>
|
||||||
uint32_t hierachyId;
|
uint32_t hierachyId;
|
||||||
float scale;
|
float scale;
|
||||||
int16_t unknown20a;
|
int16_t unknown20a;
|
||||||
uint16_t unknown20b;
|
uint16_t rotation;
|
||||||
int16_t unknown24a;
|
int16_t unknown24a;
|
||||||
int16_t unknown24b;
|
int16_t unknown24b;
|
||||||
uint16_t unknown28a;
|
uint16_t unknown28a;
|
||||||
int16_t unknown28c;
|
int16_t unknown28c;
|
||||||
uint32_t unknown2C;
|
uint32_t unknown2C;
|
||||||
Common::FFXIVARR_POSITION3 position;
|
Common::FFXIVARR_POSITION3 position;
|
||||||
int16_t rotation;
|
int16_t unknown3C;
|
||||||
int16_t unknown;
|
int16_t unknown3E;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FFXIVIpcObjectDespawn : FFXIVIpcBasePacket<ObjectDespawn>
|
struct FFXIVIpcObjectDespawn : FFXIVIpcBasePacket<ObjectDespawn>
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <common/Network/CommonNetwork.h>
|
#include <common/Network/CommonNetwork.h>
|
||||||
#include <common/Network/PacketDef/Zone/ServerZoneDef.h>
|
#include <common/Network/PacketDef/Zone/ServerZoneDef.h>
|
||||||
#include <common/Network/PacketContainer.h>
|
#include <common/Network/PacketContainer.h>
|
||||||
|
#include <common/Util/UtilMath.h>
|
||||||
|
|
||||||
using namespace Core::Common;
|
using namespace Core::Common;
|
||||||
using namespace Core::Network::Packets;
|
using namespace Core::Network::Packets;
|
||||||
|
@ -19,7 +20,7 @@ extern Core::Logger g_log;
|
||||||
|
|
||||||
Core::Entity::EventObject::EventObject( uint32_t actorId, uint32_t objectId, uint32_t mapLinkId,
|
Core::Entity::EventObject::EventObject( uint32_t actorId, uint32_t objectId, uint32_t mapLinkId,
|
||||||
uint8_t initialState, Common::FFXIVARR_POSITION3 pos,
|
uint8_t initialState, Common::FFXIVARR_POSITION3 pos,
|
||||||
const std::string& givenName ) :
|
float rotation, const std::string& givenName ) :
|
||||||
Core::Entity::Actor( ObjKind::EventObj ),
|
Core::Entity::Actor( ObjKind::EventObj ),
|
||||||
m_mapLinkId( mapLinkId ),
|
m_mapLinkId( mapLinkId ),
|
||||||
m_state( initialState ),
|
m_state( initialState ),
|
||||||
|
@ -30,6 +31,7 @@ Core::Entity::EventObject::EventObject( uint32_t actorId, uint32_t objectId, uin
|
||||||
m_pos.x = pos.x;
|
m_pos.x = pos.x;
|
||||||
m_pos.y = pos.y;
|
m_pos.y = pos.y;
|
||||||
m_pos.z = pos.z;
|
m_pos.z = pos.z;
|
||||||
|
m_rot = rotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Core::Entity::EventObject::getMapLinkId() const
|
uint32_t Core::Entity::EventObject::getMapLinkId() const
|
||||||
|
@ -112,6 +114,7 @@ void Core::Entity::EventObject::spawn( Core::Entity::PlayerPtr pTarget )
|
||||||
eobjStatePacket.data().position = getPos();
|
eobjStatePacket.data().position = getPos();
|
||||||
eobjStatePacket.data().scale = getScale();
|
eobjStatePacket.data().scale = getScale();
|
||||||
eobjStatePacket.data().actorId = getId();
|
eobjStatePacket.data().actorId = getId();
|
||||||
|
eobjStatePacket.data().rotation = Math::Util::floatToUInt16Rot( getRot() );
|
||||||
pTarget->queuePacket( eobjStatePacket );
|
pTarget->queuePacket( eobjStatePacket );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace Entity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EventObject( uint32_t actorId, uint32_t objectId, uint32_t mapLinkId, uint8_t initialState, Common::FFXIVARR_POSITION3 pos,
|
EventObject( uint32_t actorId, uint32_t objectId, uint32_t mapLinkId, uint8_t initialState, Common::FFXIVARR_POSITION3 pos,
|
||||||
const std::string& givenName = "none" );
|
float rotation, const std::string& givenName = "none" );
|
||||||
|
|
||||||
using OnTalkEventHandler = std::function< void( Entity::Player&, Entity::EventObjectPtr, InstanceContentPtr, uint64_t ) >;
|
using OnTalkEventHandler = std::function< void( Entity::Player&, Entity::EventObjectPtr, InstanceContentPtr, uint64_t ) >;
|
||||||
|
|
||||||
|
|
|
@ -693,9 +693,9 @@ uint32_t Core::Zone::getNextEObjId()
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Entity::EventObjectPtr Core::Zone::registerEObj( const std::string &name, uint32_t objectId, uint32_t mapLink,
|
Core::Entity::EventObjectPtr Core::Zone::registerEObj( const std::string &name, uint32_t objectId, uint32_t mapLink,
|
||||||
uint8_t state, FFXIVARR_POSITION3 pos, float scale )
|
uint8_t state, FFXIVARR_POSITION3 pos, float scale, float rotation )
|
||||||
{
|
{
|
||||||
auto eObj = Entity::make_EventObject( getNextEObjId(), objectId, mapLink, state, pos, name );
|
auto eObj = Entity::make_EventObject( getNextEObjId(), objectId, mapLink, state, pos, rotation, name );
|
||||||
eObj->setScale( scale );
|
eObj->setScale( scale );
|
||||||
registerEObj( eObj );
|
registerEObj( eObj );
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ public:
|
||||||
void updateSessions( bool changedWeather );
|
void updateSessions( bool changedWeather );
|
||||||
|
|
||||||
Entity::EventObjectPtr registerEObj( const std::string& name, uint32_t objectId, uint32_t mapLink,
|
Entity::EventObjectPtr registerEObj( const std::string& name, uint32_t objectId, uint32_t mapLink,
|
||||||
uint8_t state, Common::FFXIVARR_POSITION3 pos, float scale );
|
uint8_t state, Common::FFXIVARR_POSITION3 pos, float scale, float rotation );
|
||||||
|
|
||||||
void registerEObj( Entity::EventObjectPtr object );
|
void registerEObj( Entity::EventObjectPtr object );
|
||||||
Entity::EventObjectPtr getEObj( uint32_t objId );
|
Entity::EventObjectPtr getEObj( uint32_t objId );
|
||||||
|
|
Loading…
Add table
Reference in a new issue