Skip to content

Commit 62b078a

Browse files
committed
For v1.1.9 quick release for the HOTD2 Remake shit show
1 parent 217874b commit 62b078a

File tree

10 files changed

+379
-57
lines changed

10 files changed

+379
-57
lines changed

COMDeviceList/ComDeviceList.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ quint8 ComDeviceList::GetPlayerLightGunAssignment(quint8 playerNum)
449449
return UNASSIGN;
450450
}
451451

452+
452453
//Save & Load Light guns from/to File
453454
void ComDeviceList::SaveLightGunList()
454455
{

COMDeviceList/ComDeviceList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class ComDeviceList
7171
void DeassignPlayerLightGun(quint8 playerNum);
7272
quint8 GetPlayerLightGunAssignment(quint8 playerNum);
7373

74+
7475
//Save or Load Light Guns to/from a File
7576
void SaveLightGunList();
7677
void LoadLightGunList();

COMDeviceList/LightGun.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1877,8 +1877,14 @@ QStringList LightGun::AmmoValueCommands(bool *isSet, quint16 ammoValue)
18771877
quint8 cmdCount = ammoValueCmds.length ();
18781878
bool doReloadCMD = false;
18791879

1880+
//If Ammo is the same, do nothing
1881+
if(ammoValue == lastAmmoValue)
1882+
{
1883+
*isSet = false;
1884+
return tempSL;
1885+
}
18801886
//Check if Reload Happened
1881-
if(ammoValue > lastAmmoValue)
1887+
else if(ammoValue > lastAmmoValue)
18821888
{
18831889
lastAmmoValue = ammoValue;
18841890
*isSet = reloadCmdsSet;

Global.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <qobject.h>
55

6-
#define VERSION "1.1.8"
6+
#define VERSION "1.1.9 QR"
77
#define VERSIONMAIN 1
88
#define VERSIONMID 1
99
#define VERSIONLAST 3
@@ -380,6 +380,13 @@ extern QString DEFAULTLGFILENAMES_ARRAY[];
380380
#define PLAYER2CHHAR 'P'
381381
#define ALL2CHAR 'A'
382382
#define SLOWMODE "Slow"
383+
#define STATESSECTION "[States]"
384+
#define OPTIONSSECTION "[Options]"
385+
#define ENDOPTIONS "End Options"
386+
#define BLOCKSHAKEOPTION "Block Shake"
387+
#define BLOCKRECOIL_R2SOPTION "Block Recoil_R2S"
388+
#define BLOCKSHAKELENGTH 4
389+
#define BLOCKRECOIL_R2SLENGTH 4
383390

384391
//Number of Supported Recoil Commands 4: Ammo_Value, Recoil, Recoil_R2S, and Recoil_Value
385392
#define NUMBEROFRECOILS 4
@@ -439,6 +446,7 @@ extern QString DEFAULTLGFILENAMES_ARRAY[];
439446
#define RELOADVALUECMD ">Reload_Value"
440447
#define OFFSCREENBUTTONCMD ">Offscreen_Button"
441448
#define OFFSCREENNORMALSHOTCMD ">Offscreen_Normal_Shot"
449+
#define BLOCKSIGNALCOMMAND ">Block_Signal"
442450

443451
#define OPENCOMPORTONLY "Open_COM"
444452
#define CLOSECOMPORTONLY "Close_COM"

HookerEngine/HookCOMPortWin.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ HookCOMPortWin::~HookCOMPortWin()
104104
//qDebug() << "lastError: " << lastError;
105105
//qDebug() << "comPortArray[comPortNum]: " << comPortArray[comPortNum] << "GetLastError(): " << lastError;
106106

107-
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
108-
GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
109-
(LPWSTR)&messageBuffer, 1020, NULL);
107+
//FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
108+
// GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
109+
// (LPWSTR)&messageBuffer, 1020, NULL);
110110

111111
if(!bypassCOMPortConnectFailWarning)
112112
{
@@ -146,15 +146,15 @@ HookCOMPortWin::~HookCOMPortWin()
146146
COMSTAT status;
147147
DWORD errors;
148148

149-
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
149+
DWORD charsCopied = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
150150
GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
151-
(LPWSTR)&messageBuffer, 1020, NULL);
151+
(LPWSTR)&messageBuffer, 0, NULL);
152152

153153
ClearCommError(comPortArray[comPortNum], &errors, &status);
154154

155155
QString critMessage;
156156

157-
if(messageBuffer == nullptr)
157+
if(messageBuffer == nullptr || charsCopied == 0)
158158
critMessage = "Can not get the CommState for the Serial COM Port: "+comPortName+" on Port: "+QString::number(comPortNum)+". This is the default settings for the serial port.";
159159
else
160160
critMessage = "Can not get the CommState for the Serial COM Port: "+comPortName+" on Port: "+QString::number(comPortNum)+". This is the default settings for the serial port. "+QString::fromWCharArray(messageBuffer);
@@ -245,18 +245,19 @@ HookCOMPortWin::~HookCOMPortWin()
245245
COMSTAT status;
246246
DWORD errors;
247247

248-
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
248+
DWORD charsCopied = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
249249
GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
250-
(LPWSTR)&messageBuffer, 1020, NULL);
250+
(LPWSTR)&messageBuffer, 0, NULL);
251251

252252
ClearCommError(comPortArray[comPortNum], &errors, &status);
253253

254254
QString critMessage;
255255

256-
if(messageBuffer == nullptr)
256+
if(messageBuffer == nullptr || charsCopied == 0)
257257
critMessage = "Can not set the CommState for the Serial COM Port: "+comPortName+" on Port: "+QString::number(comPortNum)+". This is the settings for the serial port. ";
258258
else
259259
critMessage = "Can not set the CommState for the Serial COM Port: "+comPortName+" on Port: "+QString::number(comPortNum)+". This is the settings for the serial port. "+QString::fromWCharArray(messageBuffer);
260+
critMessage = "Can not set the CommState for the Serial COM Port: "+comPortName+" on Port: "+QString::number(comPortNum)+". This is the settings for the serial port. ";
260261
emit ErrorMessage("Serial COM Port Error",critMessage);
261262
return;
262263
}
@@ -292,15 +293,15 @@ HookCOMPortWin::~HookCOMPortWin()
292293
COMSTAT status;
293294
DWORD errors;
294295

295-
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
296+
DWORD charsCopied = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
296297
GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
297-
(LPWSTR)&messageBuffer, 1020, NULL);
298+
(LPWSTR)&messageBuffer, 0, NULL);
298299

299300
ClearCommError(comPortArray[comPortNum], &errors, &status);
300301

301302
QString critMessage;
302303

303-
if(messageBuffer == nullptr)
304+
if(messageBuffer == nullptr || charsCopied == 0)
304305
critMessage = "Serial COM Port failed to set TimeOuts, on COM Port: "+QString::number(comPortNum)+". Please check you Serial COM Port connections. Error: "+QString::number(errors);
305306
else
306307
critMessage = "Serial COM Port failed to set TimeOuts, on COM Port: : "+QString::number(comPortNum)+". Please check you Serial COM Port connections. Error: "+QString::number(errors)+" "+QString::fromWCharArray(messageBuffer);

0 commit comments

Comments
 (0)