An essential info site for anyone learning the game. Great community and often very insightful posts.
 
HomeUseful information for Helbreath beginnersPlay, discover, and broadcast your Helbreath moments for free.SearchRulesRegisterLog in
Share
 

 [FIX] Negative Stat Points

Go down 
AuthorMessage
sleeq

sleeq


[FIX] Negative Stat Points Empty
PostSubject: [FIX] Negative Stat Points   [FIX] Negative Stat Points EmptyThu 21 Nov 2019, 8:22 am

Repost from old helbreath.online forum

This bug appears when putting more than 200 points on each stat at one go. With this fix, you are able to put more than 10k points.

HGServer SRC


Game.cpp

Find in CGame::LevelUpSettingsHandler
Code:
char * cp, cStr, cVit, cDex, cInt, cMag, cChar;
int iTotalSetting = 0;
 
Replace with
Code:
char * cp;
// sleeq - fix for negative level up points
short * sp;
short cStr, cVit, cDex, cInt, cMag, cChar;
int iTotalSetting = 0;
 
Find
Code:

cStr = *cp;
cp++;

cVit = *cp;
cp++;

cDex = *cp;
cp++;

cInt = *cp;
cp++;

cMag = *cp;
cp++;

cChar = *cp;
cp++;


Replace with
Code:

sp  = (short *)cp;
cStr  = *sp;
cp += 2;

sp  = (short *)cp;
cVit  = *sp;
cp += 2;

sp  = (short *)cp;
cDex  = *sp;
cp += 2;

sp  = (short *)cp;
cInt  = *sp;
cp += 2;

sp  = (short *)cp;
cMag  = *sp;
cp += 2;

sp  = (short *)cp;
cChar  = *sp;
cp += 2;
 
 
Client SRC

Game.h


Find
Code:
char m_cLU_Str, m_cLU_Vit, m_cLU_Dex, m_cLU_Int, m_cLU_Mag, m_cLU_Char;
 
 
Replace with
Code:
short m_cLU_Str, m_cLU_Vit, m_cLU_Dex, m_cLU_Int, m_cLU_Mag, m_cLU_Char; // sleeq - fix for negative level up points
 
 
Game.cpp


Find
Code:

case MSGID_LEVELUPSETTINGS:
        // CLEROTH
        //if ((m_cLU_Str + m_cLU_Vit + m_cLU_Dex + m_cLU_Int + m_cLU_Mag + m_cLU_Char) > 3) return FALSE;

        dwp = (DWORD *)(cMsg + DEF_INDEX4_MSGID);
        *dwp = dwMsgID;
        wp  = (WORD *)(cMsg + DEF_INDEX2_MSGTYPE);
        *wp = NULL;

        cp = (char *)(cMsg + DEF_INDEX2_MSGTYPE + 2);

        *cp = m_cLU_Str;
        cp++;

        *cp = m_cLU_Vit;
        cp++;

        *cp = m_cLU_Dex;
        cp++;

        *cp = m_cLU_Int;
        cp++;

        *cp = m_cLU_Mag;
        cp++;

        *cp = m_cLU_Char;
        cp++;

        iRet = m_pGSock->iSendMsg(cMsg, 12);
        break;
 
 
Replace with
Code:

case MSGID_LEVELUPSETTINGS:
        // sleeq - fix for negative level up points
        dwp = (DWORD *)(cMsg + DEF_INDEX4_MSGID);
        *dwp = dwMsgID;
        wp  = (WORD *)(cMsg + DEF_INDEX2_MSGTYPE);
        *wp = NULL;

        cp = (char *)(cMsg + DEF_INDEX2_MSGTYPE + 2);

        sp = (short *)cp;
        *sp = (short)m_cLU_Str;
        cp += 2;
       
        sp = (short *)cp;
        *sp = (short)m_cLU_Vit;
        cp += 2;
       
        sp = (short *)cp;
        *sp = (short)m_cLU_Dex;
        cp += 2;
       
        sp = (short *)cp;
        *sp = (short)m_cLU_Int;
        cp += 2;
       
        sp = (short *)cp;
        *sp = (short)m_cLU_Mag;
        cp += 2;
       
        sp = (short *)cp;
        *sp = (short)m_cLU_Char;
        cp += 2;

        iRet = m_pGSock->iSendMsg(cMsg, 6 + 12);
        break;
Back to top Go down
 
[FIX] Negative Stat Points
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Join Helbreath :: Open Source / Development Corner :: C++-
Jump to: