File tree Expand file tree Collapse file tree 1 file changed +35
-3
lines changed Expand file tree Collapse file tree 1 file changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -575,19 +575,50 @@ bool EntityDef::loadAllDefDescriptions(const std::string& moduleName,
575
575
bool EntityDef::validDefPropertyName (ScriptDefModule* pScriptModule, const std::string& name)
576
576
{
577
577
int i = 0 ;
578
- while (true )
578
+
579
+ while (true )
579
580
{
580
581
std::string limited = ENTITY_LIMITED_PROPERTYS[i];
581
582
582
- if (limited == " " )
583
+ if (limited == " " )
583
584
break ;
584
585
585
- if (name == limited)
586
+ if (name == limited)
586
587
return false ;
587
588
588
589
++i;
589
590
};
590
591
592
+ PyObject* pyKBEModule =
593
+ PyImport_ImportModule (const_cast <char *>(" KBEngine" ));
594
+
595
+ PyObject* pyEntityModule =
596
+ PyObject_GetAttrString (pyKBEModule, const_cast <char *>(" Entity" ));
597
+
598
+ Py_DECREF (pyKBEModule);
599
+
600
+ if (pyEntityModule != NULL )
601
+ {
602
+ PyObject* pyEntityAttr =
603
+ PyObject_GetAttrString (pyEntityModule, const_cast <char *>(name.c_str ()));
604
+
605
+ if (pyEntityAttr != NULL )
606
+ {
607
+ Py_DECREF (pyEntityAttr);
608
+ Py_DECREF (pyEntityModule);
609
+ return false ;
610
+ }
611
+ else
612
+ {
613
+ PyErr_Clear ();
614
+ }
615
+ }
616
+ else
617
+ {
618
+ PyErr_Clear ();
619
+ }
620
+
621
+ Py_XDECREF (pyEntityModule);
591
622
return true ;
592
623
}
593
624
@@ -1388,6 +1419,7 @@ bool EntityDef::checkDefMethod(ScriptDefModule* pScriptModule,
1388
1419
ERROR_MSG (fmt::format (" EntityDef::checkDefMethod: class {} does not have method[{}], defined in {}.def!\n " ,
1389
1420
moduleName.c_str (), iter->first .c_str (), moduleName));
1390
1421
1422
+ PyErr_Clear ();
1391
1423
return false ;
1392
1424
}
1393
1425
}
You can’t perform that action at this time.
0 commit comments