@@ -896,8 +896,9 @@ void CKnightsManager::ReceiveKnightsProcess(CUser* pUser, const char* pBuf, uint
896896
897897void CKnightsManager::RecvCreateKnights (CUser* pUser, const char * pBuf)
898898{
899+ static constexpr uint32_t CLAN_CREATE_COST = 500'000 ;
899900 int index = 0 , sendIndex = 0 , namelen = 0 , idlen = 0 , knightsindex = 0 , nation = 0 ,
900- community = 0 , money = 0 ;
901+ community = 0 ;
901902 CKnights* pKnights = nullptr ;
902903 char sendBuffer[128 ] {}, knightsname[MAX_ID_SIZE + 1 ] {}, chiefname[MAX_ID_SIZE + 1 ] {};
903904
@@ -931,8 +932,7 @@ void CKnightsManager::RecvCreateKnights(CUser* pUser, const char* pBuf)
931932
932933 pUser->m_pUserData ->m_bKnights = knightsindex;
933934 pUser->m_pUserData ->m_bFame = KNIGHTS_DUTY_CHIEF;
934- money = pUser->m_pUserData ->m_iGold - 500000 ;
935- pUser->m_pUserData ->m_iGold = money;
935+ CurrencyChange (pUser->m_pUserData ->m_iGold , -CLAN_CREATE_COST);
936936
937937 for (int i = 0 ; i < MAX_CLAN; i++)
938938 {
@@ -968,7 +968,7 @@ void CKnightsManager::RecvCreateKnights(CUser* pUser, const char* pBuf)
968968 SetString (sendBuffer, knightsname, namelen, sendIndex);
969969 SetByte (sendBuffer, 5 , sendIndex); // knights grade
970970 SetByte (sendBuffer, 0 , sendIndex);
971- SetDWORD (sendBuffer, money , sendIndex);
971+ SetDWORD (sendBuffer, pUser-> m_pUserData -> m_iGold , sendIndex);
972972 m_pMain->Send_Region (sendBuffer, sendIndex, pUser->m_pUserData ->m_bZone , pUser->m_RegionX ,
973973 pUser->m_RegionZ , nullptr , false );
974974 // pUser->Send( sendBuffer, sendIndex );
0 commit comments