Browse Source

the big PR of the day

pull/88/head
galaxyhaxz 7 years ago
parent
commit
508a653a3d
  1. 34
      Source/diablo.cpp
  2. 2
      Source/diablo.h

34
Source/diablo.cpp

@ -1024,22 +1024,28 @@ BOOL PressSysKey(int wParam)
return TRUE;
}
void diablo_hotkey_msg(int dwMsg)
void diablo_hotkey_msg(DWORD dwMsg)
{
char Filename[MAX_PATH];
char ReturnedString[MAX_SEND_STR_LEN];
char *separator;
if (gbMaxPlayers != 1) {
if (!GetModuleFileName(ghInst, Filename, sizeof(Filename)))
app_fatal("Can't get program name");
separator = strrchr(Filename, '\\');
if (separator)
*separator = '\0';
strcat(Filename, "\\Diablo.ini");
GetPrivateProfileString("NetMsg", spszMsgKeyTbl[dwMsg], spszMsgTbl[dwMsg], ReturnedString, sizeof(ReturnedString), Filename);
NetSendCmdString(-1, ReturnedString);
char *s;
char szFileName[MAX_PATH];
char szMsg[MAX_SEND_STR_LEN];
if(gbMaxPlayers == 1) {
return;
}
if(GetModuleFileName(ghInst, szFileName, sizeof(szFileName)) == 0) {
app_fatal("Can't get program name");
}
s = strrchr(szFileName, '\\');
if(s != NULL) {
*s = '\0';
}
strcat(szFileName, "\\Diablo.ini");
/// ASSERT: assert(dwMsg < sizeof(spszMsgTbl) / sizeof(spszMsgTbl[0]));
GetPrivateProfileString("NetMsg", spszMsgKeyTbl[dwMsg], spszMsgTbl[dwMsg], szMsg, sizeof(szMsg), szFileName);
NetSendCmdString(-1, szMsg);
}
// 48436C: using guessed type char *spszMsgTbl[4];
// 48437C: using guessed type char *spszMsgKeyTbl[4];

2
Source/diablo.h

@ -54,7 +54,7 @@ void LeftMouseUp();
void RightMouseDown();
void j_gmenu_on_mouse_move(LPARAM lParam);
BOOL PressSysKey(int wParam);
void diablo_hotkey_msg(int dwMsg);
void diablo_hotkey_msg(DWORD dwMsg);
void ReleaseKey(int vkey);
void PressKey(int vkey);
void diablo_pause_game();

Loading…
Cancel
Save