You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During checking my code, I noticed that the constructor initialisation path for many of the CEntityEquippedEntity entities is somewhat broken. The method AddComponent will add components to the composable entity correctly, however, the update components specialisation in the class (which uses an anchor and an offset often defined in a struct inside the class) would have no effect on these components. To this end, I propose applying the following pattern to the affected classes:
classCEntityEquippedEntity {
public:virtualvoidInit(TConfigurationNode& t_tree) {
/* initialization code to init the entity, find its anchor, offset etc */AddComponent(pc_entity, s_anchor, c_offset);
}
/* new public version of AddComponent */
(virtual) voidAddComponent(CEntity* pc_entity, SAnchor& s_anchor, CVector3& c_offset) {
m_vecInstances.push_back(newSInstance(*pc_entity, s_anchor, c_offset));
AddComponent(pc_entity);
}
private:/* override the inherited AddComponent and make it private so only we can call this function (I think this should work) */virtualvoidAddComponent(CEntity* pc_entity) {
CComposableEntity::AddComponent(pc_entity);
}
};
I would say that this issue isn't urgent, but I think it should be fixed at some point in the future.
The text was updated successfully, but these errors were encountered:
During checking my code, I noticed that the constructor initialisation path for many of the CEntityEquippedEntity entities is somewhat broken. The method AddComponent will add components to the composable entity correctly, however, the update components specialisation in the class (which uses an anchor and an offset often defined in a struct inside the class) would have no effect on these components. To this end, I propose applying the following pattern to the affected classes:
I would say that this issue isn't urgent, but I think it should be fixed at some point in the future.
The text was updated successfully, but these errors were encountered: