Browse Source

Merge remote-tracking branch 'devilution/master'

pull/4/head
Dennis Duda 8 years ago
parent
commit
ca0e341de2
  1. 4
      Source/missiles.cpp
  2. 2
      Source/monster.cpp
  3. 13
      Source/player.cpp
  4. 2
      Source/player.h
  5. 2
      Source/sound.cpp
  6. 4
      types.h

4
Source/missiles.cpp

@ -585,7 +585,7 @@ void __fastcall GetDamageAmt(int i, int *mind, int *maxd)
*mind = v14;
}
v16 = maxd;
v5 = 2 * plr[myplr]._pLevel + 40; // BUG_FIX: 2 * (plr[myplr]._pLevel + 20) + 4
v5 = 2 * plr[myplr]._pLevel + 40; /// BUGFIX: set to `2 * (plr[myplr]._pLevel + 20) + 4`
*maxd = v5;
if ( v4 <= 0 )
return;
@ -712,7 +712,7 @@ LABEL_43:
*mind = v24;
}
v16 = maxd;
v5 = 2 * plr[myplr]._pLevel + 40; // BUG_FIX: 2 * (plr[myplr]._pLevel + 20) + 4
v5 = 2 * plr[myplr]._pLevel + 40; /// BUGFIX: set to `2 * (plr[myplr]._pLevel + 20) + 4`
*maxd = v5;
if ( v4 <= 0 )
return;

2
Source/monster.cpp

@ -7281,7 +7281,7 @@ void __cdecl ProcessMonsters()
if ( v11 )
{
v16 = monster[v1]._msquelch;
if ( v16 && monster[v1]._mAi != MT_DIABLO ) /* BUG_FIX: change '_mAi' to 'MType->mtype' */
if ( v16 && monster[v1]._mAi != MT_DIABLO ) /// BUGFIX: test `MT_DIABLO` with 'MType->mtype' instead of '_mAi'
monster[v1]._msquelch = v16 - 1;
}
else

13
Source/player.cpp

@ -111,18 +111,18 @@ struct player_cpp_init
// 47F204: using guessed type int player_inf;
// 68643C: using guessed type int player_cpp_init_value;
void __fastcall player_init_cl2_hdrs(char *src, char *dst)
void __fastcall SetPlayerGPtrs(char *pData, char *pAnim)
{
char *v2; // eax
int v3; // esi
signed int v4; // edx
v2 = dst;
v3 = src - dst;
v2 = pAnim;
v3 = pData - pAnim;
v4 = 8;
do
{
*(_DWORD *)v2 = (unsigned int)&src[*(_DWORD *)&v2[v3]];
*(_DWORD *)v2 = (unsigned int)&pData[*(_DWORD *)&v2[v3]];
v2 += 4;
--v4;
}
@ -236,7 +236,7 @@ LABEL_27:
LABEL_37:
sprintf(arglist, "PlrGFX\\%s\\%s\\%s%s.CL2", v17, v15, v15, v19);
LoadFileWithMem(arglist, v6);
player_init_cl2_hdrs((char *)v6, v7);
SetPlayerGPtrs((char *)v6, v7);
v3->_pGFXLoad |= v18;
v5 = leveltype;
goto LABEL_38;
@ -813,6 +813,7 @@ void __fastcall CreatePlayer(int pnum, char c)
}
// interestingly, only the first three hotkeys are reset
// TODO: BUGFIX: clear all 4 hotkeys instead of 3 (demo leftover)
for ( i = 0; i < 3; i++ )
{
plr[pnum]._pSplHotKey[i] = -1;
@ -2337,7 +2338,7 @@ void __fastcall StartPlayerKill(int pnum, int earflag)
PlaySfxLoc(v5, plr[v3 / 0x54D8].WorldX, plr[v3 / 0x54D8].WorldY);
goto LABEL_18;
}
PlaySfxLoc(PS_DEAD, plr[v3 / 0x54D8].WorldX, plr[v3 / 0x54D8].WorldY); /* BUG_FIX: uses wrong sound, should use PS_WARR71 */
PlaySfxLoc(PS_DEAD, plr[v3 / 0x54D8].WorldX, plr[v3 / 0x54D8].WorldY); /// BUGFIX: should use `PS_WARR71` like other classes
LABEL_18:
if ( plr[v3 / 0x54D8]._pgfxnum )
{

2
Source/player.h

@ -20,7 +20,7 @@ extern int deathdelay; // weak
extern int plr_dframe_size; // idb
void __cdecl player_cpp_init();
void __fastcall player_init_cl2_hdrs(char *src, char *dst);
void __fastcall SetPlayerGPtrs(char *pData, char *pAnim); /* unsigned char *+** */
void __fastcall LoadPlrGFX(int pnum, int gfxflag);
void __fastcall InitPlayerGFX(int pnum);
void __fastcall InitPlrGFXMem(int pnum);

2
Source/sound.cpp

@ -367,7 +367,7 @@ void __fastcall sound_create_primary_buffer(int music_track)
a2.cbSize = 0;
}
a2.nChannels = 2;
a2.nBlockAlign = 2 * a2.wBitsPerSample / 8; // a2.nChannels * x / 8 (BUG_FIX: per MSDN)
a2.nBlockAlign = 2 * a2.wBitsPerSample / 8; /// BUGFIX: should be `a2.nChannels * a2.wBitsPerSample / 8`
a2.nAvgBytesPerSec = a2.nSamplesPerSec * a2.nBlockAlign;
sglpDSB->SetFormat(&a2);
}

4
types.h

@ -44,10 +44,6 @@
#include "3rdParty/Storm/Source/storm.h"
#include "3rdParty/PKWare/pkware.h"
// temporarily enable debug features for all builds
#ifndef _DEBUG
#define _DEBUG
#endif
// If defined, use copy protection [Default -> Defined]
//#define COPYPROT
// If defined, don't reload for debuggers [Default -> Undefined]

Loading…
Cancel
Save