diff --git a/src/game/CBase.cpp b/src/game/CBase.cpp index 237f1e393..5185428ba 100644 --- a/src/game/CBase.cpp +++ b/src/game/CBase.cpp @@ -56,7 +56,7 @@ void CBaseBaseDef::DelInstance() --_dwInstances; } -CFactionDef CBaseBaseDef::GetFaction() +CCFaction CBaseBaseDef::GetFaction() { return _pFaction; } @@ -147,7 +147,7 @@ bool CBaseBaseDef::r_WriteVal( lpctstr ptcKey, CSString & sVal, CTextConsole * p case OBC_FACTION: case OBC_SLAYER: - sVal.FormatULLVal(_pFaction.GetFactionID()); + sVal.FormatULLHex(_pFaction.GetFactionID()); break; case OBC_ARMOR: diff --git a/src/game/CBase.h b/src/game/CBase.h index a3ceb8223..65b8f8d39 100644 --- a/src/game/CBase.h +++ b/src/game/CBase.h @@ -55,11 +55,11 @@ struct CBaseBaseDef : public CResourceLink, public CEntityProps dword m_Can; // Base attribute flags. CAN_C_GHOST, etc RESDISPLAY_VERSION _iEraLimitProps; // Don't allow to have properties newer than the given era. - CFactionDef _pFaction; + CCFaction _pFaction; public: - CFactionDef GetFaction(); + CCFaction GetFaction(); /** * @brief Gets definition string. diff --git a/src/game/chars/CChar.cpp b/src/game/chars/CChar.cpp index 623b882a7..d55a2809d 100644 --- a/src/game/chars/CChar.cpp +++ b/src/game/chars/CChar.cpp @@ -322,6 +322,7 @@ CChar::CChar( CREID_TYPE baseID ) : // SubscribeComponent Prop Components TrySubscribeComponentProps(); TrySubscribeComponentProps(); + SubscribeComponent(new CCFaction(pCharDef->GetFaction())); ASSERT(IsDisconnected()); } diff --git a/src/game/items/CItem.cpp b/src/game/items/CItem.cpp index dd4c5e9e2..b24c62e03 100644 --- a/src/game/items/CItem.cpp +++ b/src/game/items/CItem.cpp @@ -166,7 +166,7 @@ CItem::CItem( ITEMID_TYPE id, CItemBase * pItemDef ) : } if (CCFaction::CanSubscribe(this)) { - SubscribeComponent(new CCFaction()); // Adding it only to equippable items + SubscribeComponent(new CCFaction(pItemDef->GetFaction())); // Adding it only to equippable items } TrySubscribeComponentProps();