Skip to content

Commit

Permalink
Couple of Fixes and Feature Updates
Browse files Browse the repository at this point in the history
Second fix for Faction issue #1059 and #1083
  • Loading branch information
xwerswoodx committed Oct 6, 2023
1 parent a9becbb commit 2e7a3b4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/game/CBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void CBaseBaseDef::DelInstance()
--_dwInstances;
}

CFactionDef CBaseBaseDef::GetFaction()
CCFaction CBaseBaseDef::GetFaction()
{
return _pFaction;
}
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/game/CBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/game/chars/CChar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ CChar::CChar( CREID_TYPE baseID ) :
// SubscribeComponent Prop Components
TrySubscribeComponentProps<CCPropsChar>();
TrySubscribeComponentProps<CCPropsItemChar>();
SubscribeComponent(new CCFaction(pCharDef->GetFaction()));

ASSERT(IsDisconnected());
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/items/CItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<CCPropsItem>();
Expand Down

0 comments on commit 2e7a3b4

Please sign in to comment.