mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 22:57:45 +00:00
minor refactoring and zero out model cache arrays on init
This commit is contained in:
parent
4d35888b27
commit
aa70c9775f
2 changed files with 11 additions and 6 deletions
|
@ -19,7 +19,10 @@ Sapphire::House::House( uint32_t houseId, uint32_t landSetId, Common::LandIdent
|
|||
m_estateName( estateName ),
|
||||
m_estateComment( estateComment ),
|
||||
m_pFw( pFw )
|
||||
{}
|
||||
{
|
||||
m_interiorModelCache.fill( 0 );
|
||||
m_exteriorModelCache.fill( std::make_pair( 0, 0 ) );
|
||||
}
|
||||
|
||||
Sapphire::House::~House() = default;
|
||||
|
||||
|
@ -57,7 +60,7 @@ uint32_t Sapphire::House::getId() const
|
|||
return m_houseId;
|
||||
}
|
||||
|
||||
Sapphire::House::HouseModelsArray const& Sapphire::House::getHouseModels() const
|
||||
Sapphire::House::ExteriorModelsArray const& Sapphire::House::getHouseModels() const
|
||||
{
|
||||
return m_exteriorModelCache;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <Common.h>
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
#include <array>
|
||||
|
||||
namespace Sapphire
|
||||
{
|
||||
|
@ -17,7 +18,8 @@ namespace Sapphire
|
|||
virtual ~House();
|
||||
|
||||
using HousePart = std::pair< uint32_t, uint16_t >;
|
||||
using HouseModelsArray = std::array< HousePart, 8 >;
|
||||
using ExteriorModelsArray = std::array< HousePart, 8 >;
|
||||
using InteriorModelsArray = std::array< uint32_t, 10 >;
|
||||
|
||||
//gerneral
|
||||
uint32_t getLandSetId() const;
|
||||
|
@ -37,7 +39,7 @@ namespace Sapphire
|
|||
void setInteriorModel( Common::HouseInteriorSlot slot, uint32_t modelId );
|
||||
uint32_t getInteriorModel( Common::HouseInteriorSlot slot );
|
||||
|
||||
HouseModelsArray const& getHouseModels() const;
|
||||
ExteriorModelsArray const& getHouseModels() const;
|
||||
|
||||
void updateHouseDb();
|
||||
|
||||
|
@ -52,8 +54,8 @@ namespace Sapphire
|
|||
uint64_t m_buildTime;
|
||||
bool m_hasAetheryte;
|
||||
|
||||
HouseModelsArray m_exteriorModelCache;
|
||||
uint32_t m_interiorModelCache[10];
|
||||
ExteriorModelsArray m_exteriorModelCache;
|
||||
InteriorModelsArray m_interiorModelCache;
|
||||
|
||||
std::string m_estateComment;
|
||||
std::string m_estateName;
|
||||
|
|
Loading…
Add table
Reference in a new issue