mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
issue warnings on TypeHandle conflicts
This commit is contained in:
parent
8960c61c91
commit
ed4b03893e
@ -233,14 +233,24 @@ void Dtool_Accum_MethDefs(PyMethodDef in[], MethodDefmap &themap)
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void RegisterRuntimeClass(Dtool_PyTypedObject * otype, int class_id)
|
void
|
||||||
{
|
RegisterRuntimeClass(Dtool_PyTypedObject * otype, int class_id) {
|
||||||
if(class_id > 0)
|
if(class_id > 0) {
|
||||||
{
|
RunTimeTypeDictionary &dict = GetRunTimeDictionary();
|
||||||
GetRunTimeDictionary()[class_id] = otype;
|
pair<RunTimeTypeDictionary::iterator, bool> result =
|
||||||
GetRunTimeTypeList().insert(class_id);
|
dict.insert(RunTimeTypeDictionary::value_type(class_id, otype));
|
||||||
otype->_Dtool_IsRunTimeCapable = true;
|
if (!result.second) {
|
||||||
|
// There was already an entry in the dictionary for class_id.
|
||||||
|
Dtool_PyTypedObject *other_type = (*result.first).second;
|
||||||
|
interrogatedb_cat.warning()
|
||||||
|
<< "Classes " << otype->_name << " and " << other_type->_name
|
||||||
|
<< " share the same TypeHandle value; check class definitions.\n";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
GetRunTimeTypeList().insert(class_id);
|
||||||
|
otype->_Dtool_IsRunTimeCapable = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user