PHP Code:
void LoopThroughAllEntityChildrens(int entity)
{
int child = entity;
while ((child = GetEntPropEnt(child, Prop_Data, "m_hMoveChild")) != -1)
{
// do something with child here
int peer = child;
while ((peer = GetEntPropEnt(peer, Prop_Data, "m_hMovePeer")) != -1)
{
// do something with child here
LoopThroughAllEntityChildrens(peer);
}
}
}
This code loops through all childrens of entity.
If we have something like this:
HTML Code:
Func_Door
Trigger_Hurt (Func_Door is parent)
Env_Laser (Trigger_Hurt is parent)
Env_Spark (Trigger_Hurt is parent)
Trigger_Push (Env_Spark is parent)
Trigger_Multiple (Func_Door is parent)
We can retrieve all entities in this list and do something with them.
__________________