1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 22:17:45 +00:00

initial pass to fix housing issues

This commit is contained in:
NotAdam 2019-01-10 15:03:25 +11:00
parent 1cc38c0cca
commit c03dc6dc80
8 changed files with 19 additions and 33 deletions

View file

@ -576,9 +576,9 @@ CREATE TABLE `zonepositions` (
CREATE TABLE `landplaceditems` (
`ItemId` INT(20) UNSIGNED NOT NULL,
`PosX` INT(10) NOT NULL,
`PosY` INT(10) NOT NULL,
`PosZ` INT(10) NOT NULL,
`PosX` FLOAT NOT NULL,
`PosY` FLOAT NOT NULL,
`PosZ` FLOAT NOT NULL,
`Rotation` INT(10) NOT NULL,
PRIMARY KEY (`ItemId`)
)

View file

@ -856,7 +856,7 @@ namespace Sapphire::Common
{
uint32_t itemId;
uint16_t itemRotation;
Common::FFXIVARR_POSITION3_U16 pos;
Common::FFXIVARR_POSITION3 pos;
};
enum HouseSize : uint8_t

View file

@ -1695,7 +1695,7 @@ struct FFXIVIpcHousingObjectMove : FFXIVIpcBasePacket< HousingObjectMove >
uint16_t itemRotation;
uint8_t objectArray;
uint8_t landId;
Common::FFXIVARR_POSITION3_U16 pos;
Common::FFXIVARR_POSITION3 pos;
uint16_t unknown1;
uint16_t unknown2;
uint16_t unknown3;
@ -1726,7 +1726,7 @@ struct FFXIVIpcHousingInternalObjectSpawn : FFXIVIpcBasePacket< HousingInternalO
uint8_t unk2;
uint8_t pad2;
uint16_t rotation;
Common::FFXIVARR_POSITION3_U16 pos;
Common::FFXIVARR_POSITION3 pos;
};
struct FFXIVIpcHousingIndoorInitialize : FFXIVIpcBasePacket< HousingIndoorInitialize >

View file

@ -18,12 +18,12 @@ void Sapphire::Inventory::HousingItem::setRot( uint16_t rot )
m_rotation = rot;
}
Sapphire::Common::FFXIVARR_POSITION3_U16 Sapphire::Inventory::HousingItem::getPos() const
Sapphire::Common::FFXIVARR_POSITION3 Sapphire::Inventory::HousingItem::getPos() const
{
return m_position;
}
void Sapphire::Inventory::HousingItem::setPos( Sapphire::Common::FFXIVARR_POSITION3_U16 pos )
void Sapphire::Inventory::HousingItem::setPos( Sapphire::Common::FFXIVARR_POSITION3 pos )
{
m_position = pos;
}

View file

@ -14,11 +14,11 @@ namespace Sapphire::Inventory
void setRot( uint16_t rot );
uint16_t getRot() const;
void setPos( Common::FFXIVARR_POSITION3_U16 pos );
Common::FFXIVARR_POSITION3_U16 getPos() const;
void setPos( Common::FFXIVARR_POSITION3 pos );
Common::FFXIVARR_POSITION3 getPos() const;
private:
Common::FFXIVARR_POSITION3_U16 m_position;
Common::FFXIVARR_POSITION3 m_position;
uint16_t m_rotation;
};
}

View file

@ -139,9 +139,9 @@ bool Sapphire::World::Manager::HousingMgr::loadEstateInventories()
if( isPlacedItemsInventory( static_cast< Common::InventoryType >( containerId ) ) )
{
item->setPos( {
res->getUInt16( "PosX" ),
res->getUInt16( "PosY" ),
res->getUInt16( "PosZ" )
res->getFloat( "PosX" ),
res->getFloat( "PosY" ),
res->getFloat( "PosZ" )
} );
item->setRot( res->getUInt16( "Rotation" ) );
@ -1007,12 +1007,7 @@ void Sapphire::World::Manager::HousingMgr::reqPlaceHousingItem( Sapphire::Entity
return;
// set params
item->setPos( {
Util::floatToUInt16( pos.x ),
Util::floatToUInt16( pos.y ),
Util::floatToUInt16( pos.z )
} );
item->setPos( pos );
item->setRot( Util::floatToUInt16Rot( rotation ) );
}
else
@ -1281,11 +1276,7 @@ bool Sapphire::World::Manager::HousingMgr::moveInternalItem( Entity::Player& pla
if( !item )
return false;
item->setPos( {
Util::floatToUInt16( pos.x ),
Util::floatToUInt16( pos.y ),
Util::floatToUInt16( pos.z )
} );
item->setPos( pos );
item->setRot( Util::floatToUInt16Rot( rot ) );
@ -1324,12 +1315,7 @@ bool Sapphire::World::Manager::HousingMgr::moveExternalItem( Entity::Player& pla
if( !item )
return false;
item->setPos( {
Util::floatToUInt16( pos.x ),
Util::floatToUInt16( pos.y ),
Util::floatToUInt16( pos.z )
} );
item->setPos( pos );
item->setRot( Util::floatToUInt16Rot( rot ) );
auto invMgr = framework()->get< InventoryMgr >();

View file

@ -196,7 +196,7 @@ void Sapphire::World::Territory::Housing::HousingInteriorTerritory::spawnHousing
void Sapphire::World::Territory::Housing::HousingInteriorTerritory::updateHousingObjectPosition( Entity::Player& sourcePlayer,
uint16_t slot,
Common::FFXIVARR_POSITION3_U16 pos,
Common::FFXIVARR_POSITION3 pos,
uint16_t rot )
{
auto& obj = m_housingObjects[ slot ];

View file

@ -29,7 +29,7 @@ namespace Sapphire::World::Territory::Housing
void spawnHousingObject( uint8_t containerIdx, uint16_t slot, uint16_t containerType,
Inventory::HousingItemPtr item );
void updateHousingObjectPosition(
Entity::Player& sourcePlayer, uint16_t slot, Sapphire::Common::FFXIVARR_POSITION3_U16 pos, uint16_t rot );
Entity::Player& sourcePlayer, uint16_t slot, Sapphire::Common::FFXIVARR_POSITION3 pos, uint16_t rot );
void removeHousingObject( uint16_t slot );
private: