Fix offset in weapon set by adding IR Scanner and Night Vision

This commit is contained in:
Jonaeru committed 2025-03-30 22:31:51 +09:00
1 parent e32d719c16
commit edd58c8925
2 files changed
+25 -15

No files matched your search

+10 -2
View File
@@ -57,18 +57,26 @@ u8 *preprocessMpConfigs(u8* data, u32 size, u32* outSize)
for (s32 j = 0; j < ARRAYCOUNT(cfg->setup.weapons); ++j) {
#if VERSION == VERSION_JPN_FINAL /* TODO: replace with runtime check */
if (cfg->setup.weapons[j] >= 0x24) {
// weapons after and including the shield need to be shifted
// weapons after and including the shield need to be shifted (for classic weapons)
cfg->setup.weapons[j] += (MPWEAPON_SHIELD - MPWEAPON_PP9I);
}
if (cfg->setup.weapons[j] >= 0x22) {
// weapons after and including the cloaking device need to be shifted (for IR Scanner and Night Vision)
cfg->setup.weapons[j] += (MPWEAPON_CLOAKINGDEVICE - MPWEAPON_NIGHTVISION);
}
if (cfg->setup.weapons[j] >= 0x19) {
// weapons after the combat knife also need to be shifted up in JPN
cfg->setup.weapons[j]++;
}
#else
// in other versions we only care about the shield and above
if (cfg->setup.weapons[j] >= 0x25) {
// weapons after and including the shield need to be shifted (for classic weapons)
cfg->setup.weapons[j] += (MPWEAPON_SHIELD - MPWEAPON_PP9I);
}
if (cfg->setup.weapons[j] >= 0x23) {
// weapons after and including the cloaking device need to be shifted (for IR Scanner and Night Vision)
cfg->setup.weapons[j] += (MPWEAPON_CLOAKINGDEVICE - MPWEAPON_NIGHTVISION);
}
#endif
}
}
+15 -13
View File
@@ -2993,7 +2993,7 @@
#define MPWEAPON_SHIELD (VERSION == VERSION_JPN_FINAL ? 0x24 : 0x25)
#define MPWEAPON_DISABLED (VERSION == VERSION_JPN_FINAL ? 0x25 : 0x26)
#define NUM_MPWEAPONS (VERSION == VERSION_JPN_FINAL ? 0x26 : 0x27)
#else // add all classic weapons to multiplayer and allow combat knife in JPN
#else // add all classic weapons to multiplayer and allow combat knife in JPN and add IR Scanner and Night Vision
#define MPWEAPON_COMBATKNIFE 0x19
#define MPWEAPON_CROSSBOW 0x1a
#define MPWEAPON_TRANQUILIZER 0x1b
@@ -3004,18 +3004,20 @@
#define MPWEAPON_REMOTEMINE 0x20
#define MPWEAPON_LASER 0x21
#define MPWEAPON_XRAYSCANNER 0x22
#define MPWEAPON_CLOAKINGDEVICE 0x23
#define MPWEAPON_COMBATBOOST 0x24
#define MPWEAPON_PP9I 0x25
#define MPWEAPON_CC13 0x26
#define MPWEAPON_KL01313 0x27
#define MPWEAPON_KF7SPECIAL 0x28
#define MPWEAPON_ZZT 0x29
#define MPWEAPON_DMC 0x2a
#define MPWEAPON_AR53 0x2b
#define MPWEAPON_RCP45 0x2c
#define MPWEAPON_SHIELD 0x2d
#define MPWEAPON_DISABLED 0x2e
#define MPWEAPON_NIGHTVISION 0x23
#define MPWEAPON_IRSCANNER 0x24
#define MPWEAPON_CLOAKINGDEVICE 0x25
#define MPWEAPON_COMBATBOOST 0x26
#define MPWEAPON_PP9I 0x27
#define MPWEAPON_CC13 0x28
#define MPWEAPON_KL01313 0x29
#define MPWEAPON_KF7SPECIAL 0x2a
#define MPWEAPON_ZZT 0x2b
#define MPWEAPON_DMC 0x2c
#define MPWEAPON_AR53 0x2d
#define MPWEAPON_RCP45 0x2e
#define MPWEAPON_SHIELD 0x2f
#define MPWEAPON_DISABLED 0x30
#define NUM_MPWEAPONS 0x31
#endif