Skip to content

Commit 9d8066a

Browse files
committed
up
1 parent d0a6952 commit 9d8066a

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

kbe/src/lib/entitydef/entity_macro.h

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,26 @@ public: \
496496
ScriptDefModule::PROPERTYDESCRIPTION_UIDMAP& propertyDescrs = \
497497
pScriptModule_->getCellPropertyDescriptions_uidmap(); \
498498
\
499-
size_t count = 0; \
499+
size_t count = propertyDescrs.size(); \
500500
\
501-
while(mstream->length() > 0 && count < propertyDescrs.size()) \
501+
{ \
502+
ScriptDefModule::PROPERTYDESCRIPTION_UIDMAP::iterator iter = propertyDescrs.begin(); \
503+
for(; iter != propertyDescrs.end(); ++iter) \
504+
{ \
505+
/* 由于存在一种情况, 组件def中没有内容, 但有cell脚本,此时baseapp上无法判断他是否有cell属性,所以写celldata时没有数据写入 */ \
506+
if (iter->second->getDataType()->type() == DATA_TYPE_ENTITY_COMPONENT) \
507+
{ \
508+
EntityComponentType* pEntityComponentType = (EntityComponentType*)iter->second->getDataType(); \
509+
if (pEntityComponentType->pScriptDefModule()->getPropertyDescrs().size() == 0) \
510+
{ \
511+
--count; \
512+
continue; \
513+
} \
514+
} \
515+
} \
516+
} \
517+
\
518+
while(mstream->length() > 0 && count-- > 0) \
502519
{ \
503520
(*mstream) >> uid /* 父属性 */ >> uid; \
504521
ScriptDefModule::PROPERTYDESCRIPTION_UIDMAP::iterator iter = propertyDescrs.find(uid); \
@@ -530,8 +547,6 @@ public: \
530547
PyDict_SetItemString(cellData, iter->second->getName(), pyobj); \
531548
Py_DECREF(pyobj); \
532549
} \
533-
\
534-
++count; \
535550
} \
536551
\
537552
return cellData; \

0 commit comments

Comments
 (0)