Skip to content

Commit

Permalink
Followerslots fix
Browse files Browse the repository at this point in the history
while using EF_FollowerList
Sphereserver#1251
  • Loading branch information
GladieUO committed Jun 18, 2024
1 parent 8e44484 commit fa87433
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/game/chars/CCharUse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,10 +1209,18 @@ bool CChar::FollowersUpdate( CChar * pChar, short iFollowerSlots, bool fCheckOnl
++it;
}

if (!fExists && ((short)(m_followers.size()) < iMaxFollower || IsPriv(PRIV_GM)))
if (!fExists && ((short)(m_followers.size()) + iFollowerSlots <= iMaxFollower || IsPriv(PRIV_GM)))
{
if (!fCheckOnly)
m_followers.emplace_back(pChar->GetUID());
{
for (short i = 0; i < iFollowerSlots; ++i)
{
m_followers.emplace_back(pChar->GetUID());
}
short iCurFollower = (short)(GetDefNum("CURFOLLOWER", true));
iCurFollower += iFollowerSlots;
SetDefNum("CURFOLLOWER", maximum(iCurFollower, 0));
}
}
else
return false;
Expand Down

0 comments on commit fa87433

Please sign in to comment.