Minor fix in std::packed_any
This commit is contained in:
parent
57785d2001
commit
ee4f155b92
|
@ -81,7 +81,7 @@ public:
|
||||||
bool empty() const { return !scalar && !content; }
|
bool empty() const { return !scalar && !content; }
|
||||||
template<typename T> T cast() const;
|
template<typename T> T cast() const;
|
||||||
const std::type_info& type() const {
|
const std::type_info& type() const {
|
||||||
if(scalar)
|
if(!scalar)
|
||||||
return content ? content->type() : typeid(void);
|
return content ? content->type() : typeid(void);
|
||||||
else
|
else
|
||||||
return typeid(std::size_t);
|
return typeid(std::size_t);
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
~packed_storage() { if(m_values) delete[] m_values; }
|
~packed_storage() { if(m_values) delete[] m_values; }
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void set(Key id, T value) {
|
void set(Key id, const T& value) {
|
||||||
for(SizeType i=0;i<m_size;++i) {
|
for(SizeType i=0;i<m_size;++i) {
|
||||||
if(m_values[i].id == id) {
|
if(m_values[i].id == id) {
|
||||||
m_values[i].value = value;
|
m_values[i].value = value;
|
||||||
|
|
|
@ -207,8 +207,10 @@ void Map::loadOtbm(const std::string& fileName)
|
||||||
g_logger.debug("OTBM read successfully.");
|
g_logger.debug("OTBM read successfully.");
|
||||||
fin->close();
|
fin->close();
|
||||||
|
|
||||||
|
/*
|
||||||
loadSpawns(getSpawnFile());
|
loadSpawns(getSpawnFile());
|
||||||
m_houses.load(getHouseFile());
|
m_houses.load(getHouseFile());
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void Map::saveOtbm(const std::string &fileName)
|
void Map::saveOtbm(const std::string &fileName)
|
||||||
|
|
Loading…
Reference in New Issue