mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Added parent support in *RE_AddRefEntityToScene*
This commit is contained in:
parent
4e14535f08
commit
03e8a64283
1 changed files with 27 additions and 1 deletions
|
@ -268,7 +268,33 @@ void RE_AddRefEntityToScene( const refEntity_t *ent, int parentEntityNumber) {
|
|||
}
|
||||
|
||||
backEndData[tr.smpFrame]->entities[r_numentities].e = *ent;
|
||||
backEndData[tr.smpFrame]->entities[r_numentities].lightingCalculated = qfalse;
|
||||
backEndData[tr.smpFrame]->entities[r_numentities].bLightGridCalculated = qfalse;
|
||||
backEndData[tr.smpFrame]->entities[r_numentities].sphereCalculated = qfalse;
|
||||
|
||||
if (parentEntityNumber != ENTITYNUM_NONE)
|
||||
{
|
||||
int i;
|
||||
|
||||
//
|
||||
// Find the parent entity to attach to
|
||||
//
|
||||
for (i = r_firstSceneEntity; i < r_numentities; i++)
|
||||
{
|
||||
if (backEndData[tr.smpFrame]->entities[i].e.entityNumber == parentEntityNumber)
|
||||
{
|
||||
backEndData[tr.smpFrame]->entities[r_numentities].e.parentEntity = i - r_firstSceneEntity;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == r_numentities) {
|
||||
backEndData[tr.smpFrame]->entities[i].e.parentEntity = ENTITYNUM_NONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
backEndData[tr.smpFrame]->entities[r_numentities].e.parentEntity = ENTITYNUM_NONE;
|
||||
}
|
||||
|
||||
r_numentities++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue