From 71f032452eff34c6dc859cad3a320e356147c468 Mon Sep 17 00:00:00 2001 From: Rampastring Date: Sun, 28 Jul 2024 18:58:24 +0300 Subject: [PATCH] Disable shared control patch for DTA --- Makefile | 4 ++++ src/event_declarations.c | 2 ++ src/hotkeys.c | 2 ++ src/shared_control.c | 2 ++ src/spawner/spawner.asm | 7 ++++++- 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8e7f60ed..f68e3c0a 100644 --- a/Makefile +++ b/Makefile @@ -269,7 +269,11 @@ OBJS += src/saved_games_in_subdir.o OBJS += src/savegame.o OBJS += src/scrap_metal_explosion.o +# Only include in: MOD_TO MOD_RUBICON MOD_FD MOD_TM TSCLIENT +ifneq ($(call ifdef_any_of,MOD_TO MOD_TI MOD_RUBICON MOD_FD MOD_TM TSCLIENT),) OBJS += src/shared_control.o +endif + OBJS += src/short_connection_timeout.o OBJS += src/show_stats.o OBJS += src/sidebar.o diff --git a/src/event_declarations.c b/src/event_declarations.c index 5d4028e8..5d54d070 100644 --- a/src/event_declarations.c +++ b/src/event_declarations.c @@ -117,9 +117,11 @@ Extended_Events(EventClass *e) switch(e->Type) { case 0: break; // Empty Event +#ifdef SHAREDCONTROL case 0x24: Toggle_Control(e); break; +#endif case 0x25: Handle_Timing_Change(e); break; diff --git a/src/hotkeys.c b/src/hotkeys.c index 73d45c09..f7c2b169 100644 --- a/src/hotkeys.c +++ b/src/hotkeys.c @@ -16,7 +16,9 @@ HookInitCommands() { &ChatToAllCommand, &ChatToPlayerCommand, &TextBackgroundColorCommand, +#ifdef SHAREDCONTROL &GrantControlCommand, +#endif &ToggleInfoPanelCommand, &PlaceBuildingCommand, &RepeatBuildingCommand, diff --git a/src/shared_control.c b/src/shared_control.c index 5b1553cf..94e29c67 100644 --- a/src/shared_control.c +++ b/src/shared_control.c @@ -6,6 +6,8 @@ #include #include +#define SHAREDCONTROL 1 + CALL(0x00631732, _has_control); CALL(0x00631895, _has_control); CALL(0x006318D6, _has_control); diff --git a/src/spawner/spawner.asm b/src/spawner/spawner.asm index d38d41c2..dcd473f0 100644 --- a/src/spawner/spawner.asm +++ b/src/spawner/spawner.asm @@ -32,12 +32,15 @@ cextern IntegrateMumbleSpawn cextern AttackNeutralUnits cextern ScrapMetal cextern AutoDeployMCV -cextern SharedControl cextern SkipScoreScreen cextern AutoSurrender cextern SkipBriefingOnMissionStart cextern NoRNG +%ifdef SHAREDCONTROL +cextern SharedControl +%endif + @LJMP 0x004E1DE0, _Select_Game_Init_Spawner @LJMP 0x00609470, _Send_Statistics_Packet_Return_If_Skirmish @LJMP 0x005E08E3, _Read_Scenario_INI_Assign_Houses_And_Spawner_House_Settings @@ -1233,8 +1236,10 @@ Initialize_Spawn: lea eax, [MapHash] SpawnINI_Get_String str_Settings, str_MapHash, str_Empty, eax, 255 +%ifdef SHAREDCONTROL SpawnINI_Get_Bool str_Settings, str_SharedControl, 0 mov byte [SharedControl], al +%endif SpawnINI_Get_Bool str_Settings, str_MCVRedeploy, 1 mov byte [MCVRedeploy], al