Skip to content

Commit 79b3e6d

Browse files
committed
GameMode Multiplayer Compatibility Enforcement bugfix
1 parent 25954e1 commit 79b3e6d

2 files changed

Lines changed: 23 additions & 21 deletions

File tree

Source/diablo.cpp

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,19 @@ extern void plrctrls_after_check_curs_move();
147147
extern void plrctrls_every_frame();
148148
extern void plrctrls_after_game_logic();
149149

150+
uint32_t GetGameId()
151+
{
152+
const auto &options = GetOptions();
153+
if (gbIsHellfire) {
154+
if (*options.Gameplay.disableSearch || *options.Gameplay.removeCripplingEffects || *options.Gameplay.sharedXP)
155+
return GameIdHellfireEnhanced;
156+
return gbIsSpawn ? GameIdHellfireSpawn : GameIdHellfireFull;
157+
}
158+
if (*options.Gameplay.disableSearch || *options.Gameplay.removeCripplingEffects || *options.Gameplay.sharedXP)
159+
return GameIdDiabloEnhanced;
160+
return gbIsSpawn ? GameIdDiabloSpawn : GameIdDiabloFull;
161+
}
162+
150163
namespace {
151164

152165
char gszVersionNumber[64] = "internal version unknown";
@@ -2123,31 +2136,31 @@ void InitPadmapActions()
21232136
N_("Move up"),
21242137
N_("Moves the player character up."),
21252138
ControllerButton_BUTTON_DPAD_UP,
2126-
[] {});
2139+
[] { });
21272140
options.Padmapper.AddAction(
21282141
"MoveDown",
21292142
N_("Move down"),
21302143
N_("Moves the player character down."),
21312144
ControllerButton_BUTTON_DPAD_DOWN,
2132-
[] {});
2145+
[] { });
21332146
options.Padmapper.AddAction(
21342147
"MoveLeft",
21352148
N_("Move left"),
21362149
N_("Moves the player character left."),
21372150
ControllerButton_BUTTON_DPAD_LEFT,
2138-
[] {});
2151+
[] { });
21392152
options.Padmapper.AddAction(
21402153
"MoveRight",
21412154
N_("Move right"),
21422155
N_("Moves the player character right."),
21432156
ControllerButton_BUTTON_DPAD_RIGHT,
2144-
[] {});
2157+
[] { });
21452158
options.Padmapper.AddAction(
21462159
"StandGround",
21472160
N_("Stand ground"),
21482161
N_("Hold to prevent the player from moving."),
21492162
ControllerButton_NONE,
2150-
[] {});
2163+
[] { });
21512164
options.Padmapper.AddAction(
21522165
"ToggleStandGround",
21532166
N_("Toggle stand ground"),
@@ -2233,25 +2246,25 @@ void InitPadmapActions()
22332246
N_("Move mouse up"),
22342247
N_("Simulates upward mouse movement."),
22352248
{ ControllerButton_BUTTON_BACK, ControllerButton_BUTTON_DPAD_UP },
2236-
[] {});
2249+
[] { });
22372250
options.Padmapper.AddAction(
22382251
"MouseDown",
22392252
N_("Move mouse down"),
22402253
N_("Simulates downward mouse movement."),
22412254
{ ControllerButton_BUTTON_BACK, ControllerButton_BUTTON_DPAD_DOWN },
2242-
[] {});
2255+
[] { });
22432256
options.Padmapper.AddAction(
22442257
"MouseLeft",
22452258
N_("Move mouse left"),
22462259
N_("Simulates leftward mouse movement."),
22472260
{ ControllerButton_BUTTON_BACK, ControllerButton_BUTTON_DPAD_LEFT },
2248-
[] {});
2261+
[] { });
22492262
options.Padmapper.AddAction(
22502263
"MouseRight",
22512264
N_("Move mouse right"),
22522265
N_("Simulates rightward mouse movement."),
22532266
{ ControllerButton_BUTTON_BACK, ControllerButton_BUTTON_DPAD_RIGHT },
2254-
[] {});
2267+
[] { });
22552268
auto leftMouseDown = [] {
22562269
ControllerButtonCombo standGroundCombo = GetOptions().Padmapper.ButtonComboForAction("StandGround");
22572270
bool standGround = StandToggle || IsControllerButtonComboPressed(standGroundCombo);

Source/diablo.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,7 @@ constexpr uint32_t GameIdHellfireSpawn = LoadBE32("HSHR");
2929
constexpr uint32_t GameIdDiabloEnhanced = LoadBE32("D1EN");
3030
constexpr uint32_t GameIdHellfireEnhanced = LoadBE32("HFEN");
3131

32-
inline uint32_t GetGameId()
33-
{
34-
const auto &options = GetOptions();
35-
if (gbIsHellfire) {
36-
if (*options.Gameplay.disableSearch || *options.Gameplay.removeCripplingEffects || *options.Gameplay.sharedXP)
37-
return GameIdHellfireEnhanced;
38-
return gbIsSpawn ? GameIdHellfireSpawn : GameIdHellfireFull;
39-
}
40-
if (*options.Gameplay.disableSearch || *options.Gameplay.removeCripplingEffects || *options.Gameplay.sharedXP)
41-
return GameIdDiabloEnhanced;
42-
return gbIsSpawn ? GameIdDiabloSpawn : GameIdDiabloFull;
43-
}
32+
uint32_t GetGameId();
4433

4534
#define NUMLEVELS 25
4635

0 commit comments

Comments
 (0)