mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
second addNode() replaces first
This commit is contained in:
parent
9e60165ccf
commit
45c383771a
@ -43,12 +43,20 @@ AttribNodeRegistry() {
|
||||
// files that reference an attribute node of the same
|
||||
// type and the same name are loaded, they will quietly
|
||||
// be redirected to reference this NodePath.
|
||||
//
|
||||
// If there is already a node matching the indicated
|
||||
// name and type, it will be replaced.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AttribNodeRegistry::
|
||||
add_node(const NodePath &attrib_node) {
|
||||
nassertv(!attrib_node.is_empty());
|
||||
MutexHolder holder(_lock);
|
||||
_entries.insert(Entry(attrib_node));
|
||||
|
||||
pair<Entries::iterator, bool> result = _entries.insert(Entry(attrib_node));
|
||||
if (!result.second) {
|
||||
// Replace an existing node.
|
||||
(*result.first)._node = attrib_node;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user