Skip to content

Commit b2b660e

Browse files
Add support for 1.6
1 parent c2a55a8 commit b2b660e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

include/Diag.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include "Common.h"
1818

19-
#define CUR_MTA_VERSIONS 5 // beginning at 1; encompasses 1.1, 1.2, 1.3, 1.4, 1.5
19+
#define CUR_MTA_VERSIONS 6 // beginning at 1; encompasses 1.1, 1.2, 1.3, 1.4, 1.5, 1.6
2020

2121
// MTA install path
2222
#define MTAPathValue "Last Install Location"
@@ -25,6 +25,7 @@
2525
#define MTA13PathSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.3"
2626
#define MTA14PathSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.4"
2727
#define MTA15PathSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.5"
28+
#define MTA16PathSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.6"
2829

2930
// GTA:SA path
3031
#define MTAGTAPathValue "GTA:SA Path"
@@ -37,13 +38,15 @@
3738
#define MTA13VerSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.3\\Settings\\general"
3839
#define MTA14VerSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.4\\Settings\\general"
3940
#define MTA15VerSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.5\\Settings\\general"
41+
#define MTA16VerSubKey "SOFTWARE\\Multi Theft Auto: San Andreas All\\1.6\\Settings\\general"
4042

4143
// Nightly download URLs
4244
#define MTA11NightlyURL "https://nightly.mtasa.com/?mtasa-1.1.1-rc-latest"
4345
#define MTA12NightlyURL "https://nightly.mtasa.com/?mtasa-1.2-rc-latest"
4446
#define MTA13NightlyURL "https://nightly.mtasa.com/?mtasa-1.3.5-rc-latest"
4547
#define MTA14NightlyURL "https://nightly.mtasa.com/?mtasa-1.4.1-rc-latest"
4648
#define MTA15NightlyURL "https://nightly.mtasa.com/?mtasa-1.5-rc-latest"
49+
#define MTA16NightlyURL "https://nightly.mtasa.com/?mtasa-1.6-rc-latest"
4750

4851
#define MTAVerURL "https://nightly.mtasa.com/ver/"
4952

src/Diag.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ bool Diag::PollMTAVersions ( void )
376376
MTAVersionsInstalled[3] = ReadRegKey ( MTAPathValue, MTA13PathSubKey ); // store MTA 1.3 path, if present
377377
MTAVersionsInstalled[4] = ReadRegKey ( MTAPathValue, MTA14PathSubKey ); // store MTA 1.4 path, if present
378378
MTAVersionsInstalled[5] = ReadRegKey ( MTAPathValue, MTA15PathSubKey ); // store MTA 1.5 path, if present
379+
MTAVersionsInstalled[6] = ReadRegKey ( MTAPathValue, MTA16PathSubKey ); // store MTA 1.6 path, if present
379380

380381
// if a version isn't installed, "Failed to get key." is returned by ReadRegKey; clear that array element
381382
for ( int i = 1; i <= CUR_MTA_VERSIONS; i++ )
@@ -466,6 +467,10 @@ std::string Diag::GetMTAPath ( void )
466467
MTAPath = ReadRegKey ( MTAPathValue, MTA15PathSubKey );
467468
return MTAPath;
468469
break;
470+
case 6:
471+
MTAPath = ReadRegKey ( MTAPathValue, MTA16PathSubKey );
472+
return MTAPath;
473+
break;
469474
}
470475
return "Unable to read MTA path.";
471476
}
@@ -499,6 +504,11 @@ std::string Diag::GetMTAVersion ( void )
499504
MTAShortVersion = "1.5";
500505
return MTAVersion;
501506
break;
507+
case 6:
508+
MTAVersion = ReadRegKey ( MTAVerValue, MTA16VerSubKey );
509+
MTAShortVersion = "1.6";
510+
return MTAVersion;
511+
break;
502512
}
503513
return "Unable to read MTA version.";
504514
}
@@ -534,6 +544,9 @@ void Diag::UpdateMTA ( void )
534544
case 5:
535545
url = MTA15NightlyURL;
536546
break;
547+
case 6:
548+
url = MTA16NightlyURL;
549+
break;
537550
}
538551

539552
#ifndef SKIPUPDATE

0 commit comments

Comments
 (0)