mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 22:37:45 +00:00
save a newly created house to the db correctly
This commit is contained in:
parent
b124ae06b1
commit
abb3771b86
2 changed files with 11 additions and 1 deletions
|
@ -563,6 +563,8 @@ void Sapphire::World::Manager::HousingMgr::buildPresetEstate( Entity::Player& pl
|
||||||
if( !initHouseModels( player, pLand, presetItem ) )
|
if( !initHouseModels( player, pLand, presetItem ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
createHouse( house );
|
||||||
|
|
||||||
pLand->setState( HouseState::privateHouse );
|
pLand->setState( HouseState::privateHouse );
|
||||||
pLand->setLandType( LandType::Private );
|
pLand->setLandType( LandType::Private );
|
||||||
hZone->sendLandUpdate( plotNum );
|
hZone->sendLandUpdate( plotNum );
|
||||||
|
|
|
@ -142,9 +142,17 @@ namespace Sapphire::World::Manager
|
||||||
*/
|
*/
|
||||||
bool initHouseModels( Entity::Player& player, LandPtr land, uint32_t presetCatalogId );
|
bool initHouseModels( Entity::Player& player, LandPtr land, uint32_t presetCatalogId );
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Creates a house and saves the minimum amount required to persist a house through restarts.
|
||||||
|
*
|
||||||
|
* Any other changes will be covered by the usual saving logic and can be safely ignored here.
|
||||||
|
*
|
||||||
|
* @param house The house to create in the house table
|
||||||
|
*/
|
||||||
void createHouse( HousePtr house ) const;
|
void createHouse( HousePtr house ) const;
|
||||||
|
|
||||||
private:
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Gets the next available house id
|
* @brief Gets the next available house id
|
||||||
* @return The next available house id
|
* @return The next available house id
|
||||||
|
|
Loading…
Add table
Reference in a new issue