Skip to content

Commit 17fd42e

Browse files
committed
up
1 parent fef807d commit 17fd42e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

kbe/src/lib/entitydef/entity_component.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,8 +1275,9 @@ PyObject* EntityComponent::createCellData()
12751275
//-------------------------------------------------------------------------------------
12761276
void EntityComponent::createFromDict(PyObject* pyDict)
12771277
{
1278-
ENTITY_ID old_ownerID = ownerID_;
1279-
ownerID_ = 0;
1278+
// 设置为-1, 避免onScriptSetAttribute中尝试广播属性
1279+
ENTITY_ID oid = ownerID_;
1280+
ownerID_ = -1;
12801281

12811282
const ScriptDefModule::PROPERTYDESCRIPTION_MAP* pPropertyDescrs = pChildPropertyDescrs();
12821283

@@ -1312,7 +1313,7 @@ void EntityComponent::createFromDict(PyObject* pyDict)
13121313
}
13131314
}
13141315

1315-
ownerID_ = old_ownerID;
1316+
ownerID_ = oid;
13161317
}
13171318

13181319
//-------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)