Skip to content

Commit

Permalink
Fixed: Char flag 'statf_hovering' (gargoyle fly ability) not clearing…
Browse files Browse the repository at this point in the history
… when gargoyle chars polymorph into non-gargoyle char ID
  • Loading branch information
coruja747 committed Feb 7, 2017
1 parent b26b5dc commit 28b6446
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
5 changes: 4 additions & 1 deletion docs/REVISIONS-56-SERIES.TXT
Expand Up @@ -390,4 +390,7 @@ Fixed: Client encryption not being decrypted correctly on login process.
30-01-2017, Coruja
Fixed: HS/TOL items not showing correctly on client screen.
Fixed: ML/SA/HS/TOL doors not working correctly.
[sphere.ini]: Fixed wrong SpeedScaleFactor default value and changed NPCNoFameTitle to be enabled by default
[sphere.ini]: Fixed wrong SpeedScaleFactor default value and changed NPCNoFameTitle to be enabled by default

07-02-2017, Coruja
Fixed: Char flag 'statf_hovering' (gargoyle fly ability) not clearing when gargoyle chars polymorph into non-gargoyle char ID.
19 changes: 11 additions & 8 deletions src/graysvr/CChar.cpp
Expand Up @@ -1160,15 +1160,15 @@ void CChar::SetID( CREID_TYPE id )
{
ADDTOCALLSTACK("CChar::SetID");

CCharBase * pCharDef = CCharBase::FindCharBase(id);
if ( pCharDef == NULL )
CCharBase *pCharDef = CCharBase::FindCharBase(id);
if ( !pCharDef )
{
if ( id != -1 && id != CREID_INVALID )
DEBUG_ERR(("Create Invalid Char 0%x\n", id));
if ( (id != -1) && (id != CREID_INVALID) )
DEBUG_ERR(("Creating invalid chardef 0%x\n", id));

id = static_cast<CREID_TYPE>(g_Cfg.ResourceGetIndexType(RES_CHARDEF, "DEFAULTCHAR"));
if ( id < 0 )
id = CREID_OGRE;
if ( id <= CREID_INVALID )
id = CREID_MAN;

pCharDef = CCharBase::FindCharBase(id);
}
Expand All @@ -1180,10 +1180,13 @@ void CChar::SetID( CREID_TYPE id )
if ( m_prev_id == CREID_INVALID )
m_prev_id = GetID();

if ( !IsMountCapable() ) // new body may not be capable of riding mounts
if ( !IsMountCapable() ) // new body may not be capable of ride mounts
Horse_UnMount();

if ( !pCharDef->Can(CAN_C_EQUIP) ) // new body may not be capable of equipping items (except maybe on hands)
if ( !IsGargoyle() ) // new body may not be capable of use gargoyle fly ability
StatFlag_Clear(STATF_Hovering);

if ( !pCharDef->Can(CAN_C_EQUIP) ) // new body may not be capable of equip items (except maybe on hands)
{
UnEquipAllItems(NULL, pCharDef->Can(CAN_C_USEHANDS));
}
Expand Down

0 comments on commit 28b6446

Please sign in to comment.