diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-03-05 15:34:39 +0100 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2015-03-05 15:36:20 +0100 |
commit | 9749d9fee6db99da1ab861dc04ec63ef973db3e0 (patch) | |
tree | ddf9c165e187a5bccdf0226f01b7bb35a6518ee8 /src/nodedef.cpp | |
parent | 0d1eedcccc8b83fd5f5a9a75389fe8ac97d2c697 (diff) | |
download | minetest-9749d9fee6db99da1ab861dc04ec63ef973db3e0.tar.gz minetest-9749d9fee6db99da1ab861dc04ec63ef973db3e0.tar.bz2 minetest-9749d9fee6db99da1ab861dc04ec63ef973db3e0.zip |
Fix issue #2441: crash on respawn, since a conversion std::list to std::vector on Environment.cpp
* Also change some std::list to std::vector for ClientMap::renderMap
* Remove disabled code in ClientMap::renderMap, disabled since a long time
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r-- | src/nodedef.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp index ac49b4f3c..6cf456e4d 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -443,7 +443,7 @@ private: content_t m_next_id; // List of node strings and node resolver callbacks to perform - std::list<NodeResolveInfo *> m_pending_node_lookups; + std::vector<NodeResolveInfo *> m_pending_node_lookups; // True when all nodes have been registered bool m_node_registration_complete; @@ -479,7 +479,7 @@ void CNodeDefManager::clear() m_next_id = 0; m_node_registration_complete = false; - for (std::list<NodeResolveInfo *>::iterator + for (std::vector<NodeResolveInfo *>::iterator it = m_pending_node_lookups.begin(); it != m_pending_node_lookups.end(); ++it) @@ -1309,7 +1309,7 @@ void CNodeDefManager::pendNodeResolve(NodeResolveInfo *nri) void CNodeDefManager::cancelNodeResolve(NodeResolver *resolver) { - for (std::list<NodeResolveInfo *>::iterator + for (std::vector<NodeResolveInfo *>::iterator it = m_pending_node_lookups.begin(); it != m_pending_node_lookups.end(); ++it) { @@ -1326,7 +1326,7 @@ void CNodeDefManager::runNodeResolverCallbacks() { while (!m_pending_node_lookups.empty()) { NodeResolveInfo *nri = m_pending_node_lookups.front(); - m_pending_node_lookups.pop_front(); + m_pending_node_lookups.erase(m_pending_node_lookups.begin()); nri->resolver->resolveNodeNames(nri); nri->resolver->m_lookup_done = true; delete nri; @@ -1345,7 +1345,7 @@ bool CNodeDefManager::getIdFromResolveInfo(NodeResolveInfo *nri, content_t c; std::string name = nri->nodenames.front(); - nri->nodenames.pop_front(); + nri->nodenames.erase(nri->nodenames.begin()); bool success = getId(name, c); if (!success && node_alt != "") { @@ -1385,7 +1385,7 @@ bool CNodeDefManager::getIdsFromResolveInfo(NodeResolveInfo *nri, content_t c; std::string name = nri->nodenames.front(); - nri->nodenames.pop_front(); + nri->nodenames.erase(nri->nodenames.begin()); if (name.substr(0,6) != "group:") { if (getId(name, c)) { |