mirror of
https://github.com/minetest/minetest.git
synced 2024-11-30 19:43:45 +01:00
NodeResolver: Fix cancelNode and cancelNodeList
This commit is contained in:
parent
16baed0467
commit
c07f15e910
@ -1336,8 +1336,10 @@ bool NodeResolver::cancelNode(content_t *content)
|
|||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
std::list<NodeResolveInfo *>::iterator it = m_pending_contents.begin();
|
for (std::list<NodeResolveInfo *>::iterator
|
||||||
while (it != m_pending_contents.end()) {
|
it = m_pending_contents.begin();
|
||||||
|
it != m_pending_contents.end();
|
||||||
|
++it) {
|
||||||
NodeResolveInfo *nfi = *it;
|
NodeResolveInfo *nfi = *it;
|
||||||
if (nfi->output == content) {
|
if (nfi->output == content) {
|
||||||
it = m_pending_contents.erase(it);
|
it = m_pending_contents.erase(it);
|
||||||
@ -1354,9 +1356,10 @@ int NodeResolver::cancelNodeList(std::vector<content_t> *content_vec)
|
|||||||
{
|
{
|
||||||
int num_canceled = 0;
|
int num_canceled = 0;
|
||||||
|
|
||||||
std::list<std::pair<std::string, std::vector<content_t> *> >::iterator it;
|
for (ContentVectorResolveList::iterator
|
||||||
it = m_pending_content_vecs.begin();
|
it = m_pending_content_vecs.begin();
|
||||||
while (it != m_pending_content_vecs.end()) {
|
it != m_pending_content_vecs.end();
|
||||||
|
++it) {
|
||||||
if (it->second == content_vec) {
|
if (it->second == content_vec) {
|
||||||
it = m_pending_content_vecs.erase(it);
|
it = m_pending_content_vecs.erase(it);
|
||||||
num_canceled++;
|
num_canceled++;
|
||||||
|
@ -40,6 +40,8 @@ class IShaderSource;
|
|||||||
class IGameDef;
|
class IGameDef;
|
||||||
|
|
||||||
typedef std::list<std::pair<content_t, int> > GroupItems;
|
typedef std::list<std::pair<content_t, int> > GroupItems;
|
||||||
|
typedef std::list<std::pair<std::string, std::vector<content_t> *> >
|
||||||
|
ContentVectorResolveList;
|
||||||
|
|
||||||
enum ContentParamType
|
enum ContentParamType
|
||||||
{
|
{
|
||||||
@ -399,7 +401,7 @@ private:
|
|||||||
INodeDefManager *m_ndef;
|
INodeDefManager *m_ndef;
|
||||||
bool m_is_node_registration_complete;
|
bool m_is_node_registration_complete;
|
||||||
std::list<NodeResolveInfo *> m_pending_contents;
|
std::list<NodeResolveInfo *> m_pending_contents;
|
||||||
std::list<std::pair<std::string, std::vector<content_t> *> > m_pending_content_vecs;
|
ContentVectorResolveList m_pending_content_vecs;
|
||||||
};
|
};
|
||||||
|
|
||||||
class INodeDefManager
|
class INodeDefManager
|
||||||
|
Loading…
Reference in New Issue
Block a user