1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 14:57:44 +00:00

not much point using a map

This commit is contained in:
NotAdam 2018-12-26 01:05:28 +11:00
parent 27e631d546
commit e73d9dea0d
2 changed files with 4 additions and 3 deletions

View file

@ -160,7 +160,8 @@ bool Sapphire::HousingZone::init()
obj.pos_y = Util::floatToUInt16( pos.y ); obj.pos_y = Util::floatToUInt16( pos.y );
obj.pos_z = Util::floatToUInt16( pos.z ); 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;
} }
} }

View file

@ -57,7 +57,7 @@ namespace Sapphire
private: private:
using LandPtrMap = std::unordered_map< uint8_t, Sapphire::LandPtr >; using LandPtrMap = std::unordered_map< uint8_t, Sapphire::LandPtr >;
using YardObjectArray = std::array< Common::YardObject, 800 >; 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 * @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_landSetId;
uint32_t m_territoryTypeId; uint32_t m_territoryTypeId;
YardObjectMap m_yardObjects; YardObjectSubdivisionArray m_yardObjects;
YardObjectArrayBoundsArray m_yardObjectArrayBounds; YardObjectArrayBoundsArray m_yardObjectArrayBounds;
}; };