diff --git a/src/world/Territory/HousingZone.cpp b/src/world/Territory/HousingZone.cpp index bcfc6dc1..ee426ffc 100644 --- a/src/world/Territory/HousingZone.cpp +++ b/src/world/Territory/HousingZone.cpp @@ -160,7 +160,8 @@ bool Sapphire::HousingZone::init() obj.pos_y = Util::floatToUInt16( pos.y ); obj.pos_z = Util::floatToUInt16( pos.z ); - m_yardObjects[ yardMapIndex ][ item.first + arrayBounds.first ] = obj; + auto idx = item.first + arrayBounds.first; + m_yardObjects[ yardMapIndex ][ idx ] = obj; } } diff --git a/src/world/Territory/HousingZone.h b/src/world/Territory/HousingZone.h index e5d913f0..79b2836b 100644 --- a/src/world/Territory/HousingZone.h +++ b/src/world/Territory/HousingZone.h @@ -57,7 +57,7 @@ namespace Sapphire private: using LandPtrMap = std::unordered_map< uint8_t, Sapphire::LandPtr >; using YardObjectArray = std::array< Common::YardObject, 800 >; - using YardObjectMap = std::map< uint8_t, YardObjectArray >; + using YardObjectSubdivisionArray = std::array< YardObjectArray, 2 >; /*! * @brief Maps the start and end index of the yard object array for a specific plot @@ -78,7 +78,7 @@ namespace Sapphire uint32_t m_landSetId; uint32_t m_territoryTypeId; - YardObjectMap m_yardObjects; + YardObjectSubdivisionArray m_yardObjects; YardObjectArrayBoundsArray m_yardObjectArrayBounds; };