// Ignore if no stored objects (to not set changed flag)
if(block->m_static_objects.m_stored.empty())
return;
+
verbosestream<<"ServerEnvironment::activateObjects(): "
<<"activating objects of block "<<PP(block->getPos())
<<" ("<<block->m_static_objects.m_stored.size()
<<" objects)"<<std::endl;
bool large_amount = (block->m_static_objects.m_stored.size() > g_settings->getU16("max_objects_per_block"));
- if(large_amount){
+ if (large_amount) {
errorstream<<"suspiciously large amount of objects detected: "
<<block->m_static_objects.m_stored.size()<<" in "
<<PP(block->getPos())
// Activate stored objects
std::vector<StaticObject> new_stored;
- for(std::list<StaticObject>::iterator
+ for (std::vector<StaticObject>::iterator
i = block->m_static_objects.m_stored.begin();
i != block->m_static_objects.m_stored.end(); ++i) {
StaticObject &s_obj = *i;
virtual ~CItemDefManager()
{
#ifndef SERVER
- const std::list<ClientCached*> &values = m_clientcached.getValues();
- for(std::list<ClientCached*>::const_iterator
+ const std::vector<ClientCached*> &values = m_clientcached.getValues();
+ for(std::vector<ClientCached*>::const_iterator
i = values.begin(); i != values.end(); ++i)
{
ClientCached *cc = *i;
// count
u16 count = m_stored.size() + m_active.size();
writeU16(os, count);
- for(std::list<StaticObject>::iterator
+ for(std::vector<StaticObject>::iterator
i = m_stored.begin();
- i != m_stored.end(); ++i)
- {
+ i != m_stored.end(); ++i) {
StaticObject &s_obj = *i;
s_obj.serialize(os);
}
u8 version = readU8(is);
// count
u16 count = readU16(is);
- for(u16 i=0; i<count; i++)
- {
+ for(u16 i = 0; i < count; i++) {
StaticObject s_obj;
s_obj.deSerialize(is, version);
m_stored.push_back(s_obj);
#include "irrlichttypes_bloated.h"
#include <string>
#include <sstream>
-#include <list>
+#include <vector>
#include <map>
#include "debug.h"
from m_stored and inserted to m_active.
The caller directly manipulates these containers.
*/
- std::list<StaticObject> m_stored;
+ std::vector<StaticObject> m_stored;
std::map<u16, StaticObject> m_active;
private:
std::queue<Value> m_queue;
};
-#if 1
template<typename Key, typename Value>
class MutexedMap
{
return true;
}
- std::list<Value> getValues()
+ std::vector<Value> getValues()
{
- std::list<Value> result;
+ std::vector<Value> result;
for(typename std::map<Key, Value>::iterator
i = m_values.begin();
i != m_values.end(); ++i){
std::map<Key, Value> m_values;
JMutex m_mutex;
};
-#endif
/*
Generates ids for comparable values.