diff --git a/Source/msg.cpp b/Source/msg.cpp index 3b31f1109..cb76449b1 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -990,7 +990,7 @@ void __fastcall NetSendCmdLocParam3(unsigned char bHiPri, unsigned char bCmd, un NetSendLoPri((unsigned char *)&cmd, 9u); } -void __fastcall NetSendCmdParam1(unsigned char bHiPri, unsigned char bCmd, unsigned short wParam1) +void __fastcall NetSendCmdParam1(BOOL bHiPri, unsigned char bCmd, unsigned short wParam1) { TCmdParam1 cmd; // [esp+1h] [ebp-3h] diff --git a/Source/msg.h b/Source/msg.h index bb247a6e4..9b81684b4 100644 --- a/Source/msg.h +++ b/Source/msg.h @@ -53,7 +53,7 @@ void __fastcall NetSendCmdLoc(unsigned char bHiPri, unsigned char bCmd, unsigned void __fastcall NetSendCmdLocParam1(unsigned char bHiPri, unsigned char bCmd, unsigned char x, unsigned char y, int wParam1); void __fastcall NetSendCmdLocParam2(unsigned char bHiPri, unsigned char bCmd, unsigned char x, unsigned char y, int wParam1, int wParam2); void __fastcall NetSendCmdLocParam3(unsigned char bHiPri, unsigned char bCmd, unsigned char x, unsigned char y, int wParam1, int wParam2, int wParam3); -void __fastcall NetSendCmdParam1(unsigned char bHiPri, unsigned char bCmd, unsigned short wParam1); +void __fastcall NetSendCmdParam1(BOOL bHiPri, unsigned char bCmd, unsigned short wParam1); void __fastcall NetSendCmdParam2(unsigned char bHiPri, unsigned char bCmd, unsigned short wParam1, unsigned short wParam2); void __fastcall NetSendCmdParam3(unsigned char bHiPri, unsigned char bCmd, unsigned short wParam1, unsigned short wParam2, int wParam3); void __fastcall NetSendCmdQuest(unsigned char bHiPri, unsigned char q); diff --git a/Source/player.cpp b/Source/player.cpp index 421ad22fc..024a5d63d 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -5314,28 +5314,25 @@ void __fastcall ModifyPlrMag(int pnum, int l) void __fastcall ModifyPlrDex(int pnum, int l) { - int v2; // ebx - int v3; // edi - int v4; // esi - int v5; // ecx - int v6; // eax - - v2 = pnum; - v3 = l; - if ( (unsigned int)pnum >= MAX_PLRS ) + if ( (DWORD)pnum >= MAX_PLRS ) { TermMsg("ModifyPlrDex: illegal player %d", pnum); - v4 = v2; - v5 = MaxStats[SLOBYTE(plr[v2]._pClass)][2]; - v6 = plr[v2]._pBaseDex; - if ( v6 + v3 > v5 ) - v3 = v5 - v6; - plr[v4]._pDexterity += v3; - plr[v4]._pBaseDex = v3 + v6; - CalcPlrInv(v2, 1u); - if ( _LOBYTE(plr[v4]._pClass) == 1 ) - plr[v4]._pDamageMod = plr[v4]._pLevel * (plr[v4]._pDexterity + plr[v4]._pStrength) / 200; - if ( v2 == myplr ) - NetSendCmdParam1(0, CMD_SETDEX, plr[v4]._pBaseDex); + } + + if ( plr[pnum]._pBaseDex + l > MaxStats[plr[pnum]._pClass][ATTRIB_DEX] ) { + l = MaxStats[plr[pnum]._pClass][ATTRIB_DEX] - plr[pnum]._pBaseDex; + } + + plr[pnum]._pDexterity += l; + plr[pnum]._pBaseDex += l; + CalcPlrInv(pnum, 1); + + if ( plr[pnum]._pClass == PC_ROGUE ) { + plr[pnum]._pDamageMod = plr[pnum]._pLevel * (plr[pnum]._pDexterity + plr[pnum]._pStrength) / 200; + } + + if ( pnum == myplr ) { + NetSendCmdParam1(0, CMD_SETDEX, plr[pnum]._pBaseDex); + } } void __fastcall ModifyPlrVit(int pnum, int l)