Skip to content

Commit

Permalink
Disable shared control patch for DTA
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampastring committed Jul 28, 2024
1 parent db82b51 commit 71f0324
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/event_declarations.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/hotkeys.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ HookInitCommands() {
&ChatToAllCommand,
&ChatToPlayerCommand,
&TextBackgroundColorCommand,
#ifdef SHAREDCONTROL
&GrantControlCommand,
#endif
&ToggleInfoPanelCommand,
&PlaceBuildingCommand,
&RepeatBuildingCommand,
Expand Down
2 changes: 2 additions & 0 deletions src/shared_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <stdbool.h>
#include <stddef.h>

#define SHAREDCONTROL 1

CALL(0x00631732, _has_control);
CALL(0x00631895, _has_control);
CALL(0x006318D6, _has_control);
Expand Down
7 changes: 6 additions & 1 deletion src/spawner/spawner.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 71f0324

Please sign in to comment.