mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-01 08:27:46 +00:00
fix housing object init structure, game no longer crashes/doesn't load
This commit is contained in:
parent
22e73a0da8
commit
6e6ffc7cf3
8 changed files with 14 additions and 15 deletions
|
@ -579,7 +579,7 @@ CREATE TABLE `landplaceditems` (
|
|||
`PosX` FLOAT NOT NULL,
|
||||
`PosY` FLOAT NOT NULL,
|
||||
`PosZ` FLOAT NOT NULL,
|
||||
`Rotation` INT(10) NOT NULL,
|
||||
`Rotation` FLOAT NOT NULL,
|
||||
PRIMARY KEY (`ItemId`)
|
||||
)
|
||||
COLLATE='latin1_swedish_ci' ENGINE=InnoDB;
|
||||
|
|
|
@ -855,10 +855,9 @@ namespace Sapphire::Common
|
|||
struct HousingObject
|
||||
{
|
||||
uint32_t itemId;
|
||||
uint16_t itemRotation;
|
||||
uint32_t padding; // was itemrotation + unknown/pad, looks unused now
|
||||
float rotation;
|
||||
Common::FFXIVARR_POSITION3 pos;
|
||||
uint32_t unknown;
|
||||
uint16_t padding;
|
||||
};
|
||||
|
||||
enum HouseSize : uint8_t
|
||||
|
|
|
@ -45,7 +45,7 @@ std::vector< std::string > cppKeyWords
|
|||
};
|
||||
|
||||
//std::string datLocation( "/home/mordred/sqpack" );
|
||||
std::string datLocation( "C:\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn\\game\\sqpack" );
|
||||
std::string datLocation( "/mnt/c/Program Files (x86)/Steam/steamapps/common/FINAL FANTASY XIV Online/game/sqpack" );
|
||||
std::map< uint8_t, std::string > g_typeMap;
|
||||
|
||||
|
||||
|
|
|
@ -8,12 +8,12 @@ Sapphire::Inventory::HousingItem::HousingItem( uint64_t uId, uint32_t catalogId,
|
|||
m_reservedFlag = 1092616192; // wat?
|
||||
}
|
||||
|
||||
uint16_t Sapphire::Inventory::HousingItem::getRot() const
|
||||
float Sapphire::Inventory::HousingItem::getRot() const
|
||||
{
|
||||
return m_rotation;
|
||||
}
|
||||
|
||||
void Sapphire::Inventory::HousingItem::setRot( uint16_t rot )
|
||||
void Sapphire::Inventory::HousingItem::setRot( float rot )
|
||||
{
|
||||
m_rotation = rot;
|
||||
}
|
||||
|
|
|
@ -11,15 +11,15 @@ namespace Sapphire::Inventory
|
|||
HousingItem( uint64_t uId, uint32_t catalogId, FrameworkPtr pFw );
|
||||
virtual ~HousingItem() = default;
|
||||
|
||||
void setRot( uint16_t rot );
|
||||
uint16_t getRot() const;
|
||||
void setRot( float rot );
|
||||
float getRot() const;
|
||||
|
||||
void setPos( Common::FFXIVARR_POSITION3 pos );
|
||||
Common::FFXIVARR_POSITION3 getPos() const;
|
||||
|
||||
private:
|
||||
Common::FFXIVARR_POSITION3 m_position;
|
||||
uint16_t m_rotation;
|
||||
float m_rotation;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1187,7 +1187,7 @@ Sapphire::Common::HousingObject Sapphire::World::Manager::HousingMgr::getYardObj
|
|||
Sapphire::Common::HousingObject obj {};
|
||||
|
||||
obj.pos = item->getPos();
|
||||
obj.itemRotation = item->getRot();
|
||||
obj.rotation = item->getRot();
|
||||
obj.itemId = item->getAdditionalData();
|
||||
|
||||
return obj;
|
||||
|
|
|
@ -202,7 +202,7 @@ void Sapphire::World::Territory::Housing::HousingInteriorTerritory::updateHousin
|
|||
auto& obj = m_housingObjects[ slot ];
|
||||
|
||||
obj.pos = pos;
|
||||
obj.itemRotation = rot;
|
||||
obj.rotation = rot;
|
||||
|
||||
// todo: how does this update on other clients?
|
||||
|
||||
|
@ -213,7 +213,7 @@ void Sapphire::World::Territory::Housing::HousingInteriorTerritory::updateHousin
|
|||
|
||||
auto moveObjPkt = makeZonePacket< Server::FFXIVIpcHousingObjectMove >( player.second->getId() );
|
||||
|
||||
moveObjPkt->data().itemRotation = obj.itemRotation;
|
||||
moveObjPkt->data().itemRotation = obj.rotation;
|
||||
moveObjPkt->data().pos = obj.pos;
|
||||
|
||||
// todo: how does this work when an item is in a slot >50 or u8 max? my guess is landid is the container index, but not sure...
|
||||
|
|
|
@ -353,7 +353,7 @@ void Sapphire::HousingZone::spawnYardObject( uint8_t landId, uint16_t slotId, In
|
|||
Common::HousingObject obj {};
|
||||
|
||||
obj.itemId = item.getAdditionalData();
|
||||
obj.itemRotation = item.getRot();
|
||||
obj.rotation = item.getRot();
|
||||
|
||||
obj.pos = item.getPos();
|
||||
|
||||
|
@ -383,7 +383,7 @@ void Sapphire::HousingZone::updateYardObjectPos( Entity::Player& sourcePlayer, u
|
|||
|
||||
auto& obj = m_yardObjects[ yardMapIndex ][ offset ];
|
||||
|
||||
obj.itemRotation = item.getRot();
|
||||
obj.rotation = item.getRot();
|
||||
obj.pos = item.getPos();
|
||||
|
||||
for( const auto& player : m_playerMap )
|
||||
|
|
Loading…
Add table
Reference in a new issue