mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
NodeResolver: Fix cancelNode and cancelNodeList
This commit is contained in:
parent
16baed0467
commit
c07f15e910
2 changed files with 21 additions and 16 deletions
|
@ -699,7 +699,7 @@ void CNodeDefManager::updateTextures(IGameDef *gamedef)
|
|||
#ifndef SERVER
|
||||
infostream << "CNodeDefManager::updateTextures(): Updating "
|
||||
"textures in node definitions" << std::endl;
|
||||
|
||||
|
||||
ITextureSource *tsrc = gamedef->tsrc();
|
||||
IShaderSource *shdsrc = gamedef->getShaderSource();
|
||||
scene::ISceneManager* smgr = gamedef->getSceneManager();
|
||||
|
@ -856,7 +856,7 @@ void CNodeDefManager::updateTextures(IGameDef *gamedef)
|
|||
recalculateBoundingBox(f->mesh_ptr[0]);
|
||||
meshmanip->recalculateNormals(f->mesh_ptr[0], true, false);
|
||||
}
|
||||
} else if ((f->drawtype == NDT_NODEBOX) &&
|
||||
} else if ((f->drawtype == NDT_NODEBOX) &&
|
||||
((f->node_box.type == NODEBOX_REGULAR) ||
|
||||
(f->node_box.type == NODEBOX_FIXED)) &&
|
||||
(!f->node_box.fixed.empty())) {
|
||||
|
@ -888,7 +888,7 @@ void CNodeDefManager::updateTextures(IGameDef *gamedef)
|
|||
}
|
||||
rotateMeshBy6dFacedir(f->mesh_ptr[0], wm_to_6d[0]);
|
||||
recalculateBoundingBox(f->mesh_ptr[0]);
|
||||
meshmanip->recalculateNormals(f->mesh_ptr[0], true, false);
|
||||
meshmanip->recalculateNormals(f->mesh_ptr[0], true, false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -1148,7 +1148,7 @@ void ContentFeatures::serializeOld(std::ostream &os, u16 protocol_version)
|
|||
writeU8(os, drowning);
|
||||
writeU8(os, leveled);
|
||||
writeU8(os, liquid_range);
|
||||
} else
|
||||
} else
|
||||
throw SerializationError("ContentFeatures::serialize(): "
|
||||
"Unsupported version requested");
|
||||
}
|
||||
|
@ -1336,8 +1336,10 @@ bool NodeResolver::cancelNode(content_t *content)
|
|||
{
|
||||
bool found = false;
|
||||
|
||||
std::list<NodeResolveInfo *>::iterator it = m_pending_contents.begin();
|
||||
while (it != m_pending_contents.end()) {
|
||||
for (std::list<NodeResolveInfo *>::iterator
|
||||
it = m_pending_contents.begin();
|
||||
it != m_pending_contents.end();
|
||||
++it) {
|
||||
NodeResolveInfo *nfi = *it;
|
||||
if (nfi->output == content) {
|
||||
it = m_pending_contents.erase(it);
|
||||
|
@ -1354,9 +1356,10 @@ int NodeResolver::cancelNodeList(std::vector<content_t> *content_vec)
|
|||
{
|
||||
int num_canceled = 0;
|
||||
|
||||
std::list<std::pair<std::string, std::vector<content_t> *> >::iterator it;
|
||||
it = m_pending_content_vecs.begin();
|
||||
while (it != m_pending_content_vecs.end()) {
|
||||
for (ContentVectorResolveList::iterator
|
||||
it = m_pending_content_vecs.begin();
|
||||
it != m_pending_content_vecs.end();
|
||||
++it) {
|
||||
if (it->second == content_vec) {
|
||||
it = m_pending_content_vecs.erase(it);
|
||||
num_canceled++;
|
||||
|
@ -1373,7 +1376,7 @@ int NodeResolver::resolveNodes()
|
|||
|
||||
//// Resolve pending single node name -> content ID mappings
|
||||
while (!m_pending_contents.empty()) {
|
||||
NodeResolveInfo *nri = m_pending_contents.front();
|
||||
NodeResolveInfo *nri = m_pending_contents.front();
|
||||
m_pending_contents.pop_front();
|
||||
|
||||
bool success = true;
|
||||
|
@ -1403,7 +1406,7 @@ int NodeResolver::resolveNodes()
|
|||
|
||||
std::string &name = item.first;
|
||||
std::vector<content_t> *output = item.second;
|
||||
|
||||
|
||||
std::set<content_t> idset;
|
||||
std::set<content_t>::iterator it;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue