Skip to content

Commit

Permalink
Couple of Fixes and Feature Updates
Browse files Browse the repository at this point in the history
- Fixed: FACTION property not saved and load correctly under [CHARDEF] definition. (Issue: #1059 and #1083)
  • Loading branch information
xwerswoodx committed Oct 5, 2023
1 parent ebd9be4 commit a9becbb
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3368,4 +3368,5 @@ Additionally, the problem of zig-zag issue following in the South direction has
I: The player who is joining to the party.
SRC: The player who is inviting.
Return 1: Cancels the action.
- Added: LOCAL.SOUND and LOCAL.ANIM under @Start (Skill) trigger to override sound and animations before start crafting or gathering.
- Added: LOCAL.SOUND and LOCAL.ANIM under @Start (Skill) and @SkillStart triggers to override sound and animations before start crafting or gathering.
- Fixed: FACTION property not saved and load correctly under [CHARDEF] definition. (Issue: #1059 and #1083)
4 changes: 2 additions & 2 deletions src/game/CBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ bool CBaseBaseDef::r_WriteVal( lpctstr ptcKey, CSString & sVal, CTextConsole * p

case OBC_FACTION:
case OBC_SLAYER:
sVal.FormatHex((dword)GetFaction().GetFactionID());
sVal.FormatULLVal(_pFaction.GetFactionID());
break;

case OBC_ARMOR:
Expand Down Expand Up @@ -329,7 +329,7 @@ bool CBaseBaseDef::r_LoadVal( CScript & s )
break;
case OBC_FACTION:
case OBC_SLAYER:
GetFaction().SetFactionID( (NPC_FACTION)s.GetArgVal() );
_pFaction.SetFactionID( static_cast<NPC_FACTION>(s.GetArgULLVal()) );
return true;
//Set as number only
case OBC_EXPANSION:
Expand Down
3 changes: 0 additions & 3 deletions src/game/chars/CChar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,6 @@ CChar::CChar( CREID_TYPE baseID ) :
TrySubscribeComponentProps<CCPropsChar>();
TrySubscribeComponentProps<CCPropsItemChar>();

// SubscribeComponent regular Components
SubscribeComponent(new CCFaction());

ASSERT(IsDisconnected());
}

Expand Down
1 change: 0 additions & 1 deletion src/game/chars/CCharBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ void CCharBase::CopyBasic( const CCharBase * pCharDef )
_uiRange = pCharDef->_uiRange;

m_BaseResources = pCharDef->m_BaseResources;
_pFaction = pCharDef->_pFaction;

CBaseBaseDef::CopyBasic( pCharDef ); // This will overwrite the CResourceLink!!
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/components/CCFaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void CCFaction::r_Write(CScript & s)
{
ADDTOCALLSTACK("CCFaction::r_Write");
if (GetFactionID() != FACTION_NONE){
s.WriteKeyHex("FACTION", (llong)GetFactionID()); // Same value stored with different names for CChars and CItems.
s.WriteKeyHex("FACTION", GetFactionID()); // Same value stored with different names for CChars and CItems.
}
}

Expand Down
1 change: 1 addition & 0 deletions src/sphereCrypt.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ENC_LOGIN 4 // Rotation cipher used for the Login Server crypt by every client,
[SPHERECRYPT]
//Classic Clients
7009900 03A7731CD 0A9CE5E7F ENC_TFISH // 7.0.99
7009800 03AA8ABDD 0A9AB227F ENC_TFISH // 7.0.98
7009700 03AE221ED 0A9F47E7F ENC_TFISH // 7.0.97
7009600 03ADBA3FD 0A9E1527F ENC_TFISH // 7.0.96
Expand Down

0 comments on commit a9becbb

Please sign in to comment.